rustc_trans: do not store pair fields if they are ZSTs.
This commit is contained in:
parent
c94a9ac8ae
commit
1a2eb4953e
2 changed files with 20 additions and 6 deletions
|
|
@ -13,13 +13,15 @@
|
|||
#![crate_type = "lib"]
|
||||
use std::marker::PhantomData;
|
||||
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct Zst { phantom: PhantomData<Zst> }
|
||||
|
||||
// CHECK-LABEL: @mir
|
||||
// CHECK-NOT: store{{.*}}undef
|
||||
#[no_mangle]
|
||||
fn mir(){
|
||||
// CHECK-NOT: getelementptr
|
||||
// CHECK-NOT: store{{.*}}undef
|
||||
fn mir() {
|
||||
let x = Zst { phantom: PhantomData };
|
||||
let y = (x, 0);
|
||||
drop(y);
|
||||
drop((0, x));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue