Don't eagerly monomorphize drop for types that are impossible to instantiate
This commit is contained in:
parent
36153f1a4e
commit
045f448e26
2 changed files with 27 additions and 0 deletions
18
tests/ui/codegen/mono-impossible-drop.rs
Normal file
18
tests/ui/codegen/mono-impossible-drop.rs
Normal file
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue