diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2022-05-27 19:53:31 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2022-06-01 10:41:50 -0700 |
| commit | 9b2d80a197453001f9acd40020c1db6c0178c7fe (patch) | |
| tree | 876dc00b0a3a0aacea42246bf805ff2a4dd9b178 /src/test/ui/structs | |
| parent | f023b920b195477b65945550a2c5949ca7e7cf3e (diff) | |
Provide more context when denying invalid type params
Diffstat (limited to 'src/test/ui/structs')
| -rw-r--r-- | src/test/ui/structs/struct-path-self.stderr | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/ui/structs/struct-path-self.stderr b/src/test/ui/structs/struct-path-self.stderr index 693ed35cbc9..f8b85559db8 100644 --- a/src/test/ui/structs/struct-path-self.stderr +++ b/src/test/ui/structs/struct-path-self.stderr @@ -9,6 +9,12 @@ error[E0109]: type arguments are not allowed for this type | LL | let z = Self::<u8> {}; | ^^ type argument not allowed + | +help: the `Self` type doesn't accept type parameters + | +LL - let z = Self::<u8> {}; +LL + let z = Self {}; + | error[E0071]: expected struct, variant or union type, found type parameter `Self` --> $DIR/struct-path-self.rs:7:17 @@ -27,12 +33,38 @@ error[E0109]: type arguments are not allowed for this type | LL | let z = Self::<u8> {}; | ^^ type argument not allowed + | +note: the `Self` type is `S` + --> $DIR/struct-path-self.rs:1:8 + | +LL | struct S; + | ^ `Self` corresponds to this type +... +LL | impl Tr for S { + | ------------- `Self` is `S` in this `impl` +help: the `Self` type doesn't accept type parameters, use the concrete type's name `S` instead if you want to specify its type parameters + | +LL | let z = S::<u8> {}; + | ~ error[E0109]: type arguments are not allowed for this type --> $DIR/struct-path-self.rs:30:24 | LL | let z = Self::<u8> {}; | ^^ type argument not allowed + | +note: the `Self` type is `S` + --> $DIR/struct-path-self.rs:1:8 + | +LL | struct S; + | ^ `Self` corresponds to this type +... +LL | impl S { + | ------ `Self` is `S` in this `impl` +help: the `Self` type doesn't accept type parameters, use the concrete type's name `S` instead if you want to specify its type parameters + | +LL | let z = S::<u8> {}; + | ~ error: aborting due to 6 previous errors |
