-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Make generic parameters always use modern hygiene #63083
Conversation
They were resolved with modern hygiene, making this just a strange way to shadow lifetimes.
Declarations were already modernized, resulting in cases where a macro couldn't resolve it's own identifier.
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
@matthewjasper |
@@ -872,8 +872,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Resolver<'a> { | |||
debug!("(resolving function) entering function"); | |||
let rib_kind = match function_kind { | |||
FnKind::ItemFn(..) => FnItemRibKind, | |||
FnKind::Method(..) => AssocItemRibKind, | |||
FnKind::Closure(_) => NormalRibKind, | |||
FnKind::Method(..) | FnKind::Closure(_) => NormalRibKind, |
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 is this changed, and why did it work previously?
I don't quite remember all the differences between many kinds of ribs that act as "barriers" for names.
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.
So the reason that this has little effect is that there is already an AssocItemRib around all associated items that holds any generic parameters. Since generic parameters can be seen through associated items, this rib isn't stopping any names from being visible.
The reason for the change is so that function parameters don't end up in an associated item rib, and get resolved with the wrong hygiene.
@bors r+ |
📌 Commit 0fb9295 has been approved by |
…petrochenkov Make generic parameters always use modern hygiene * E0263 (lifetime parameter declared twice in the same scope) now compares modernized identifiers. * Const parameters are now resolved with modern hygiene. Closes rust-lang#58307 Closes rust-lang#60746 Closes rust-lang#61574 Closes rust-lang#62433
…petrochenkov Make generic parameters always use modern hygiene * E0263 (lifetime parameter declared twice in the same scope) now compares modernized identifiers. * Const parameters are now resolved with modern hygiene. Closes rust-lang#58307 Closes rust-lang#60746 Closes rust-lang#61574 Closes rust-lang#62433
…petrochenkov Make generic parameters always use modern hygiene * E0263 (lifetime parameter declared twice in the same scope) now compares modernized identifiers. * Const parameters are now resolved with modern hygiene. Closes rust-lang#58307 Closes rust-lang#60746 Closes rust-lang#61574 Closes rust-lang#62433
Rollup of 12 pull requests Successful merges: - #61965 (Remove mentions of removed `offset_to` method from `align_offset` docs) - #62928 (Syntax: Recover on `for ( $pat in $expr ) $block`) - #63000 (Impl Debug for Chars) - #63083 (Make generic parameters always use modern hygiene) - #63087 (Add very simple edition check to tidy.) - #63093 (Properly check the defining scope of existential types) - #63096 (Add tests for some `existential_type` ICEs) - #63099 (vxworks: Remove Linux-specific comments.) - #63106 (ci: Skip installing SWIG/xz on OSX ) - #63108 (Add links to None in Option doc) - #63109 (std: Fix a failing `fs` test on Windows) - #63111 (Add syntactic and semantic tests for rest patterns, i.e. `..`) Failed merges: r? @ghost
Closes #58307
Closes #60746
Closes #61574
Closes #62433