summaryrefslogtreecommitdiffstats
path: root/src/test/ui/destructure-trait-ref.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/destructure-trait-ref.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/destructure-trait-ref.stderr')
-rw-r--r--src/test/ui/destructure-trait-ref.stderr65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/test/ui/destructure-trait-ref.stderr b/src/test/ui/destructure-trait-ref.stderr
new file mode 100644
index 000000000..18a889837
--- /dev/null
+++ b/src/test/ui/destructure-trait-ref.stderr
@@ -0,0 +1,65 @@
+error[E0033]: type `&dyn T` cannot be dereferenced
+ --> $DIR/destructure-trait-ref.rs:26:9
+ |
+LL | let &x = &1isize as &dyn T;
+ | ^^ type `&dyn T` cannot be dereferenced
+
+error[E0033]: type `&dyn T` cannot be dereferenced
+ --> $DIR/destructure-trait-ref.rs:27:10
+ |
+LL | let &&x = &(&1isize as &dyn T);
+ | ^^ type `&dyn T` cannot be dereferenced
+
+error[E0033]: type `Box<dyn T>` cannot be dereferenced
+ --> $DIR/destructure-trait-ref.rs:28:9
+ |
+LL | let box x = Box::new(1isize) as Box<dyn T>;
+ | ^^^^^ type `Box<dyn T>` cannot be dereferenced
+
+error[E0308]: mismatched types
+ --> $DIR/destructure-trait-ref.rs:32:10
+ |
+LL | let &&x = &1isize as &dyn T;
+ | ^^ ----------------- this expression has type `&dyn T`
+ | |
+ | expected trait object `dyn T`, found reference
+ |
+ = note: expected trait object `dyn T`
+ found reference `&_`
+help: consider removing `&` from the pattern
+ |
+LL - let &&x = &1isize as &dyn T;
+LL + let &x = &1isize as &dyn T;
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/destructure-trait-ref.rs:36:11
+ |
+LL | let &&&x = &(&1isize as &dyn T);
+ | ^^ -------------------- this expression has type `&&dyn T`
+ | |
+ | expected trait object `dyn T`, found reference
+ |
+ = note: expected trait object `dyn T`
+ found reference `&_`
+help: consider removing `&` from the pattern
+ |
+LL - let &&&x = &(&1isize as &dyn T);
+LL + let &&x = &(&1isize as &dyn T);
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/destructure-trait-ref.rs:40:13
+ |
+LL | let box box x = Box::new(1isize) as Box<dyn T>;
+ | ^^^^^ ------------------------------ this expression has type `Box<dyn T>`
+ | |
+ | expected trait object `dyn T`, found struct `Box`
+ |
+ = note: expected trait object `dyn T`
+ found struct `Box<_>`
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0033, E0308.
+For more information about an error, try `rustc --explain E0033`.