Make generic parameters always use modern hygiene#63083
Make generic parameters always use modern hygiene#63083bors merged 3 commits intorust-lang:masterfrom
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 |
| FnKind::ItemFn(..) => FnItemRibKind, | ||
| FnKind::Method(..) => AssocItemRibKind, | ||
| FnKind::Closure(_) => NormalRibKind, | ||
| FnKind::Method(..) | FnKind::Closure(_) => NormalRibKind, |
There was a problem hiding this comment.
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.
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