diff options
| author | Michael Goulet <michael@errs.io> | 2024-05-24 15:17:34 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-05-24 21:53:39 -0400 |
| commit | 045f448e26257c7b19bf6d68c8e5e9d09ab4df79 (patch) | |
| tree | 9daae047b2d3724ae539d76d3a6cd05eb4949c00 /tests/ui/codegen | |
| parent | 36153f1a4e3162f0a143c7b3e468ecb3beb0008e (diff) | |
| download | rust-045f448e26257c7b19bf6d68c8e5e9d09ab4df79.tar.gz rust-045f448e26257c7b19bf6d68c8e5e9d09ab4df79.zip | |
Don't eagerly monomorphize drop for types that are impossible to instantiate
Diffstat (limited to 'tests/ui/codegen')
| -rw-r--r-- | tests/ui/codegen/mono-impossible-drop.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/codegen/mono-impossible-drop.rs b/tests/ui/codegen/mono-impossible-drop.rs new file mode 100644 index 00000000000..dec013cfe54 --- /dev/null +++ b/tests/ui/codegen/mono-impossible-drop.rs @@ -0,0 +1,18 @@ +//@ compile-flags: -Clink-dead-code=on --crate-type=lib +//@ build-pass + +#![feature(trivial_bounds)] +#![allow(trivial_bounds)] + +// Make sure we don't monomorphize the drop impl for `Baz`, since it has predicates +// that don't hold under a reveal-all param env. + +trait Foo { + type Assoc; +} + +struct Bar; + +struct Baz(<Bar as Foo>::Assoc) +where + Bar: Foo; |
