Don't suggest adding Self as a type parameter
This commit is contained in:
parent
018c319b21
commit
047de83e02
2 changed files with 3 additions and 4 deletions
|
@ -1807,7 +1807,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
|
|||
path: &[Segment],
|
||||
) -> Option<(Span, &'static str, String, Applicability)> {
|
||||
let (ident, span) = match path {
|
||||
[segment] if !segment.has_generic_args => {
|
||||
[segment] if !segment.has_generic_args && segment.ident.name != kw::SelfUpper => {
|
||||
(segment.ident.to_string(), segment.ident.span)
|
||||
}
|
||||
_ => return None,
|
||||
|
|
|
@ -2,9 +2,8 @@ error[E0411]: cannot find type `Self` in this scope
|
|||
--> $DIR/issue-62364-self-ty-arg.rs:5:29
|
||||
|
|
||||
LL | type Alias<'a> = Struct<&'a Self>;
|
||||
| ----- - ^^^^ `Self` is only available in impls, traits, and type definitions
|
||||
| | |
|
||||
| | help: you might be missing a type parameter: `, Self`
|
||||
| ----- ^^^^ `Self` is only available in impls, traits, and type definitions
|
||||
| |
|
||||
| `Self` not allowed in a type alias
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
Loading…
Add table
Reference in a new issue