-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Refactor absolute_paths
#13041
Refactor absolute_paths
#13041
Conversation
Went ahead and changed Also make sure to ping me to squash this before merging. Those last two commit messages are useless. |
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.
Took me a fair bit to go through the test changes but looks good (aside from 2 minor things). What you said with not counting the last segment for type/trait associated items also makes sense to me.
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.
There's one missing test annotation that I missed last time (normally I wouldn't comment on this since I don't think we really require them yet, but since you already went out of your way to annotate it all). All other changes look good to me.
r=me either way
//~[no_short]| absolute_paths | ||
let _ = std::option::Option::None::<i32>; | ||
//~[default]^ absolute_paths | ||
//~[no_short]| absolute_paths |
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.
//~[no_short]| absolute_paths | |
//~[no_short]| absolute_paths | |
//~[allow_crates]| absolute_paths |
☔ The latest upstream changes (presumably #13088) made this pull request unmergeable. Please resolve the merge conflicts. |
* Check the path length first * Use `is_from_proc_macro` * Use symbols instead of strings when checking crate names
@bors r=y21 |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Checks are rearranged to do the more expensive checks later. Since the most likely path length will be one (locals and imported/local items) this will exclude such paths on the first check.
Tests were rewritten as they were hard to follow (annotations would have helped), spammy (lots of tests for the same thing) and insufficient.
One thing thing that came up and should be decided on now is what to do about the difference between
path::to::Trait::item
(4 segments) andpath::to::Type::item
(3 segments). The current behaviour treats these as different lengths which is terrible. I personally think these should both be three segments since the item can't actually be imported. Only the type or the trait could be. This makescrate_name::Trait::item
the shortest absolute path which is shorter than the lint allows by default.changelog: None