summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/early/invalid-const-arguments.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/const-generics/early/invalid-const-arguments.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/const-generics/early/invalid-const-arguments.stderr')
-rw-r--r--src/test/ui/const-generics/early/invalid-const-arguments.stderr73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/early/invalid-const-arguments.stderr b/src/test/ui/const-generics/early/invalid-const-arguments.stderr
new file mode 100644
index 000000000..b46e7e24f
--- /dev/null
+++ b/src/test/ui/const-generics/early/invalid-const-arguments.stderr
@@ -0,0 +1,73 @@
+error[E0412]: cannot find type `N` in this scope
+ --> $DIR/invalid-const-arguments.rs:5:16
+ |
+LL | struct A<const N: u8>;
+ | ---------------------- similarly named struct `A` defined here
+LL | trait Foo {}
+LL | impl Foo for A<N> {}
+ | ^
+ |
+help: a struct with a similar name exists
+ |
+LL | impl Foo for A<A> {}
+ | ~
+help: you might be missing a type parameter
+ |
+LL | impl<N> Foo for A<N> {}
+ | +++
+
+error[E0412]: cannot find type `T` in this scope
+ --> $DIR/invalid-const-arguments.rs:14:32
+ |
+LL | struct A<const N: u8>;
+ | ---------------------- similarly named struct `A` defined here
+...
+LL | impl<const N: u8> Foo for C<N, T> {}
+ | ^
+ |
+help: a struct with a similar name exists
+ |
+LL | impl<const N: u8> Foo for C<N, A> {}
+ | ~
+help: you might be missing a type parameter
+ |
+LL | impl<const N: u8, T> Foo for C<N, T> {}
+ | +++
+
+error[E0747]: unresolved item provided when a constant was expected
+ --> $DIR/invalid-const-arguments.rs:5:16
+ |
+LL | impl Foo for A<N> {}
+ | ^
+ |
+help: if this generic argument was intended as a const parameter, surround it with braces
+ |
+LL | impl Foo for A<{ N }> {}
+ | + +
+
+error[E0747]: type provided when a constant was expected
+ --> $DIR/invalid-const-arguments.rs:10:19
+ |
+LL | impl<N> Foo for B<N> {}
+ | ^
+ |
+help: consider changing this type parameter to be a `const` generic
+ |
+LL | impl<const N: u8> Foo for B<N> {}
+ | ~~~~~~~~~~~
+
+error[E0747]: unresolved item provided when a constant was expected
+ --> $DIR/invalid-const-arguments.rs:14:32
+ |
+LL | impl<const N: u8> Foo for C<N, T> {}
+ | ^
+ |
+help: if this generic argument was intended as a const parameter, surround it with braces
+ |
+LL | impl<const N: u8> Foo for C<N, { T }> {}
+ | + +
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0412, E0747.
+For more information about an error, try `rustc --explain E0412`.