about summary refs log tree commit diff
path: root/tests/ui/codegen/mono-impossible-drop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/codegen/mono-impossible-drop.rs')
-rw-r--r--tests/ui/codegen/mono-impossible-drop.rs18
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;