-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove suffix
from MetaItemLit
#120705
Remove suffix
from MetaItemLit
#120705
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
9883a7c
to
5b855ee
Compare
This comment has been minimized.
This comment has been minimized.
5b855ee
to
8959eb3
Compare
@@ -1791,7 +1787,7 @@ impl StrLit { | |||
StrStyle::Cooked => token::Str, | |||
StrStyle::Raw(n) => token::StrRaw(n), | |||
}; | |||
token::Lit::new(token_kind, self.symbol, self.suffix) | |||
token::Lit::new(token_kind, self.symbol, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether this can be merged depends on the use of this function an its MetaItemLit
equivalent.
Without this change the conversion "token -> ast -> token" was lossless for literals, but now it is lossy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are used in macros.
I found a couple usages in rustfmt where unfortunately this may change behavior for a very specific case - formatting hex literals. I tried to verify this with a rustfmt test but Edit: Oh well I'll just commit the test. |
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
clippy parses the suffix manually in cases where it's necessary from the literal's span. Not sure if rustfmt can/should do this tho - just the first thing that came to mind if it does change |
☔ The latest upstream changes (presumably #121142) made this pull request unmergeable. Please resolve the merge conflicts. |
@rustbot author |
It definitely should and has previously in my experience. If you want to confirm locally then doing something like adding a comment within any of the "before" files under |
@camsteffen any updates on this? thanks |
Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this. @rustbot label: +S-inactive |
...as well as
StrLit
for which I believe it is alwaysNone
. Otherwise, I believe the only functional change is in ast pretty printing where1_u32
may change to1u32
.