diff options
| author | Michael Goulet <michael@errs.io> | 2023-03-13 21:35:15 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-03-13 21:35:20 +0000 |
| commit | 0bb876ebe76dee4c3f00fcd3c581d87ad67940ef (patch) | |
| tree | 787b35eff1fe3cf662e847e4d4c6864b53002e11 /tests | |
| parent | f1b1ed7e18f1fbe5226a96626827c625985f8285 (diff) | |
| download | rust-0bb876ebe76dee4c3f00fcd3c581d87ad67940ef.tar.gz rust-0bb876ebe76dee4c3f00fcd3c581d87ad67940ef.zip | |
Layout of `&dyn Trait<[type error]>` is still wide
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/layout/transmute-to-tail-with-err.rs | 8 | ||||
| -rw-r--r-- | tests/ui/layout/transmute-to-tail-with-err.stderr | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/layout/transmute-to-tail-with-err.rs b/tests/ui/layout/transmute-to-tail-with-err.rs new file mode 100644 index 00000000000..6753ce15ed1 --- /dev/null +++ b/tests/ui/layout/transmute-to-tail-with-err.rs @@ -0,0 +1,8 @@ +trait Trait<T> {} + +struct Bar(Box<dyn Trait<T>>); +//~^ ERROR cannot find type `T` in this scope + +fn main() { + let x: Bar = unsafe { std::mem::transmute(()) }; +} diff --git a/tests/ui/layout/transmute-to-tail-with-err.stderr b/tests/ui/layout/transmute-to-tail-with-err.stderr new file mode 100644 index 00000000000..97ab59c398a --- /dev/null +++ b/tests/ui/layout/transmute-to-tail-with-err.stderr @@ -0,0 +1,14 @@ +error[E0412]: cannot find type `T` in this scope + --> $DIR/transmute-to-tail-with-err.rs:3:26 + | +LL | struct Bar(Box<dyn Trait<T>>); + | ^ not found in this scope + | +help: you might be missing a type parameter + | +LL | struct Bar<T>(Box<dyn Trait<T>>); + | +++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. |
