-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiline string attr display #81438
Multiline string attr display #81438
Conversation
We definitely have code for this somewhere already. I would actually have expected the parser to handle this for us so we don't ever see this. |
I think the issue is that we get the attributes using: .filter_map(|attr| {
if ALLOWED_ATTRIBUTES.contains(&attr.name_or_empty()) {
Some(pprust::attribute_to_string(&attr))
} else {
None
}
}) which seems very hacky. |
I think we want to use something like @rustbot label: -S-waiting-on-review +S-waiting-on-author |
The problem here is that we print not only the value but the whole attr. So here, we print |
maybe we can fix the pretty printer to use |
Sounds like a good idea! I'll go with this then. |
It seems that the pretty printer cannot really use
So in the meantime, I opened a discussion about it in zulip here. One extra thing to be added here would be a test to ensure that the sources display still has the original content too. |
☔ The latest upstream changes (presumably #83880) made this pull request unmergeable. Please resolve the merge conflicts. |
This is not needed so badly anymore since we removed |
I'm going to close this for now since this PR isn't actionable. |
Fixes #81482.
As you see here (or on the screenshot below):
The backslash is kept in the string literal in the end. This fix removes it, however I wonder if there isn't a function to do that already in the compiler (couldn't find anything so...). Maybe you might have some information about it @oli-obk ?
cc @CraftSpider
r? @camelid