diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/missing/missing-items/missing-type-parameter2.stderr | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/missing/missing-items/missing-type-parameter2.stderr')
-rw-r--r-- | tests/ui/missing/missing-items/missing-type-parameter2.stderr | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/tests/ui/missing/missing-items/missing-type-parameter2.stderr b/tests/ui/missing/missing-items/missing-type-parameter2.stderr new file mode 100644 index 000000000..f33951c98 --- /dev/null +++ b/tests/ui/missing/missing-items/missing-type-parameter2.stderr @@ -0,0 +1,121 @@ +error[E0412]: cannot find type `N` in this scope + --> $DIR/missing-type-parameter2.rs:3:8 + | +LL | struct X<const N: u8>(); + | ------------------------ similarly named struct `X` defined here +LL | +LL | impl X<N> {} + | ^ + | +help: a struct with a similar name exists + | +LL | impl X<X> {} + | ~ +help: you might be missing a type parameter + | +LL | impl<N> X<N> {} + | +++ + +error[E0412]: cannot find type `N` in this scope + --> $DIR/missing-type-parameter2.rs:6:28 + | +LL | impl<T, const A: u8 = 2> X<N> {} + | - ^ + | | + | similarly named type parameter `T` defined here + | +help: a type parameter with a similar name exists + | +LL | impl<T, const A: u8 = 2> X<T> {} + | ~ +help: you might be missing a type parameter + | +LL | impl<T, const A: u8 = 2, N> X<N> {} + | +++ + +error[E0412]: cannot find type `T` in this scope + --> $DIR/missing-type-parameter2.rs:11:20 + | +LL | struct X<const N: u8>(); + | ------------------------ similarly named struct `X` defined here +... +LL | fn foo(_: T) where T: Send {} + | ^ + | +help: a struct with a similar name exists + | +LL | fn foo(_: T) where X: Send {} + | ~ +help: you might be missing a type parameter + | +LL | fn foo<T>(_: T) where T: Send {} + | +++ + +error[E0412]: cannot find type `T` in this scope + --> $DIR/missing-type-parameter2.rs:11:11 + | +LL | struct X<const N: u8>(); + | ------------------------ similarly named struct `X` defined here +... +LL | fn foo(_: T) where T: Send {} + | ^ + | +help: a struct with a similar name exists + | +LL | fn foo(_: X) where T: Send {} + | ~ +help: you might be missing a type parameter + | +LL | fn foo<T>(_: T) where T: Send {} + | +++ + +error[E0412]: cannot find type `A` in this scope + --> $DIR/missing-type-parameter2.rs:15:24 + | +LL | struct X<const N: u8>(); + | ------------------------ similarly named struct `X` defined here +... +LL | fn bar<const N: u8>(_: A) {} + | ^ + | +help: a struct with a similar name exists + | +LL | fn bar<const N: u8>(_: X) {} + | ~ +help: you might be missing a type parameter + | +LL | fn bar<const N: u8, A>(_: A) {} + | +++ + +error[E0747]: unresolved item provided when a constant was expected + --> $DIR/missing-type-parameter2.rs:3:8 + | +LL | impl X<N> {} + | ^ + | +help: if this generic argument was intended as a const parameter, surround it with braces + | +LL | impl X<{ N }> {} + | + + + +error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions + --> $DIR/missing-type-parameter2.rs:6:9 + | +LL | impl<T, const A: u8 = 2> X<N> {} + | ^^^^^^^^^^^^^^^ + +error[E0747]: unresolved item provided when a constant was expected + --> $DIR/missing-type-parameter2.rs:6:28 + | +LL | impl<T, const A: u8 = 2> X<N> {} + | ^ + | +help: if this generic argument was intended as a const parameter, surround it with braces + | +LL | impl<T, const A: u8 = 2> X<{ N }> {} + | + + + +error: aborting due to 8 previous errors + +Some errors have detailed explanations: E0412, E0747. +For more information about an error, try `rustc --explain E0412`. |