-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Report text_direction_codepoint_in_literal when parsing #141004
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
base: master
Are you sure you want to change the base?
Report text_direction_codepoint_in_literal when parsing #141004
Conversation
r? @davidtwco rustbot has assigned @davidtwco. Use |
This comment has been minimized.
This comment has been minimized.
- The lint is now reported in code that gets removed/modified/duplicated by macro expansion. - Spans are more accurate - Fixes rust-lang#140281
f5d463a
to
92445ef
Compare
This comment has been minimized.
This comment has been minimized.
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
2f169d6
to
c5f6a06
Compare
This comment has been minimized.
This comment has been minimized.
c5f6a06
to
8e2a331
Compare
@@ -3793,7 +3793,7 @@ declare_lint! { | |||
/// ```rust,compile_fail | |||
/// #![deny(text_direction_codepoint_in_comment)] | |||
/// fn main() { | |||
/// println!("{:?}"); // ''); | |||
#[doc = " println!(\"{:?}\"); // '\u{202E}');"] |
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.
why should we use #[doc = "..."]
as the example?
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.
The example isn't changed here. The attribute is used so that the RLO can be escaped. This is to avoid having to set #![allow(text_direction_codepoint_in_literal)]
on the whole crate because the allow attribute no longer works at the item level.
I think we can find the |
The lint is now reported in code that gets removed/modified/duplicated by macro expansion, and spans are more accurate so we don't get ICEs from trying to split a span in the middle of a character.
This removes support for lint level attributes for
text_direction_codepoint_in_literal
except at the crate level, I don't think that there's an easy way around this when the lint can be reported on code that's removed bycfg
or that is only in the input of a macro.Fixes #140281