summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/rpit/non-defining-use.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/ui/impl-trait/rpit/non-defining-use.stderr
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/impl-trait/rpit/non-defining-use.stderr')
-rw-r--r--tests/ui/impl-trait/rpit/non-defining-use.stderr31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/rpit/non-defining-use.stderr b/tests/ui/impl-trait/rpit/non-defining-use.stderr
new file mode 100644
index 000000000..19987d476
--- /dev/null
+++ b/tests/ui/impl-trait/rpit/non-defining-use.stderr
@@ -0,0 +1,31 @@
+error[E0792]: expected generic type parameter, found `u8`
+ --> $DIR/non-defining-use.rs:4:12
+ |
+LL | fn foo<T>() -> impl Sized {
+ | - this generic parameter must be used with a generic type parameter
+LL | let _: () = foo::<u8>();
+ | ^^
+
+error[E0792]: expected generic type parameter, found `u8`
+ --> $DIR/non-defining-use.rs:8:12
+ |
+LL | fn bar<T>(val: T) -> impl Sized {
+ | - this generic parameter must be used with a generic type parameter
+LL | let _: u8 = bar(0u8);
+ | ^^
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/non-defining-use.rs:8:17
+ |
+LL | let _: u8 = bar(0u8);
+ | ^^^^^^^^ expected `T`, got `u8`
+ |
+note: previous use here
+ --> $DIR/non-defining-use.rs:7:22
+ |
+LL | fn bar<T>(val: T) -> impl Sized {
+ | ^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0792`.