Uh oh!
There was an error while loading. Please reload this page.
Account for associated type, const and static when using type argument - #62004
Account for associated type, const and static when using type argument#62004estebank wants to merge 2 commits into
Conversation
rust-highfive
commented
Jun 20, 2019
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
495a620 to
7932b04CompareThere was a problem hiding this comment.
Please use some other terminology than "scope", it's incredibly overloaded in resolve.
Also, could you move enum CurrentScope and its impls into diagnostics.rs?
There was a problem hiding this comment.
What would be a better name?
There was a problem hiding this comment.
BodyOwner / DefOwner maybe? (though Def is similarly unfortunately overloaded)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When using a type argument from the enclosing scope in an associated type, const or static item provide a more targetted E0401 error, instead of blaming the "outer function" blindly.
7932b04 to
7515e71Comparebors
commented
Jul 7, 2019
☔ The latest upstream changes (presumably #62467) made this pull request unmergeable. Please resolve the merge conflicts. |
| //~^ ERROR can't use generic parameters in a `const` | ||
| //~| ERROR can't use generic parameters in a `const` | ||
| type Type = T; | ||
| //~^ ERROR can't use generic parameters in associated type |
There was a problem hiding this comment.
Here Type is not an associated type alias but rather a free type alias.
| if let Some((sugg_span, new_snippet)) = cm.generate_local_type_param_snippet(span) { | ||
| if !resolver.scope.is_other() { | ||
| err.help(&format!( | ||
| "{} need a type instead of a generic parameter", |
There was a problem hiding this comment.
| "{} need a type instead of a generic parameter", | |
| "{} needs a type instead of a generic parameter", |
totsteps
commented
Jul 23, 2019
ping from triage @estebank any updates on this? |
totsteps
commented
Jul 30, 2019
ping from triage @cramertj this PR is waiting for your review? |
estebank
commented
Jul 30, 2019
I have some WIP code in my local branch to address some of the comments and will need a rebase. I won't be getting to it until at least the weekend. |
estebank
commented
Aug 7, 2019
Closing, I'll reopen when I get back to this. |
When using a type argument from the enclosing scope in an associated type,
const or static item provide a more targetted E0401 error, instead of
blaming the "outer function" blindly.
Fix#45447.