Skip to content

Commit e67c228

Browse files
committed
Fix rebase, fix some tests
1 parent 5f975e9 commit e67c228

File tree

6 files changed

+23
-22
lines changed

6 files changed

+23
-22
lines changed

src/librustc_trans/adt.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -749,12 +749,12 @@ fn generic_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
749749
};
750750
match name {
751751
None => {
752-
TypeContext::direct(Type::struct_(cx, &[fill_ty], un.packed))
752+
Type::struct_(cx, &[fill_ty], un.packed)
753753
}
754754
Some(name) => {
755755
let mut llty = Type::named_struct(cx, name);
756756
llty.set_struct_body(&[fill_ty], un.packed);
757-
TypeContext::direct(llty)
757+
llty
758758
}
759759
}
760760
}

src/librustc_trans/debuginfo/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
421421
// Only "class" methods are generally understood by LLVM,
422422
// so avoid methods on other types (e.g. `<*mut T>::null`).
423423
match impl_self_ty.sty {
424-
ty::TyStruct(..) | ty::TyEnum(..) => {
424+
ty::TyStruct(..) | ty::TyUnion(..) | ty::TyEnum(..) => {
425425
Some(type_metadata(cx, impl_self_ty, syntax_pos::DUMMY_SP))
426426
}
427427
_ => None

src/librustc_trans/glue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, g: DropGlueK
489489
}
490490
ty::TyStruct(def, _) | ty::TyEnum(def, _)
491491
if def.dtor_kind().is_present() && !skip_dtor => {
492-
trans_struct_drop(bcx, t, v0)
492+
trans_struct_drop(bcx, t, v0, false)
493493
}
494494
ty::TyUnion(def, _) => {
495495
if def.dtor_kind().is_present() && !skip_dtor {

src/test/compile-fail/deriving-non-type.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@
1212

1313
struct S;
1414

15-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
15+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
1616
trait T { }
1717

18-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
18+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
1919
impl S { }
2020

21-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
21+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
2222
impl T for S { }
2323

24-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
24+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
2525
static s: usize = 0;
2626

27-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
27+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
2828
const c: usize = 0;
2929

30-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
30+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
3131
mod m { }
3232

33-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
33+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
3434
extern "C" { }
3535

36-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
36+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
3737
type A = usize;
3838

39-
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
39+
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions
4040
fn main() { }

src/test/debuginfo/union-smoke.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,33 @@
1616

1717
// gdb-command:run
1818
// gdb-command:print u
19-
// gdb-check:$1 = {a = 11 '\v', b = 11}
19+
// gdb-check:$1 = {a = {__0 = 2 '\002', __1 = 2 '\002'}, b = 514}
2020
// gdb-command:print union_smoke::SU
21-
// gdb-check:$2 = {a = 10 '\n', b = 10}
21+
// gdb-check:$2 = {a = {__0 = 1 '\001', __1 = 1 '\001'}, b = 257}
2222

2323
// === LLDB TESTS ==================================================================================
2424

2525
// lldb-command:run
2626
// lldb-command:print a
27-
// lldb-check:[...]$0 = {a = 11 '\v', b = 11}
27+
// lldb-check:[...]$0 = {a = {__0 = 2 '\002', __1 = 2 '\002'}, b = 514}
2828
// lldb-command:print union_smoke::SU
29-
// lldb-check:[...]$1 = {a = 10 '\n', b = 10}
29+
// lldb-check:[...]$1 = {a = {__0 = 1 '\001', __1 = 1 '\001'}, b = 257}
3030

3131
#![allow(unused)]
3232
#![feature(omit_gdb_pretty_printer_section)]
3333
#![omit_gdb_pretty_printer_section]
3434
#![feature(untagged_unions)]
3535

3636
union U {
37-
a: u8,
38-
b: u64,
37+
a: (u8, u8),
38+
b: u16,
3939
}
4040

41-
static SU: U = U { a: 10 };
41+
static mut SU: U = U { a: (1, 1) };
4242

4343
fn main() {
44-
let u = U { b: 11 };
44+
let u = U { b: (2 << 8) + 2 };
45+
unsafe { SU = U { a: (1, 1) } }
4546

4647
zzz(); // #break
4748
}

src/test/incremental/struct_change_field_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct Y {
3737
#[rustc_dirty(label="TypeckItemBody", cfg="cfail2")]
3838
pub fn use_X() -> u32 {
3939
let x: X = X { x: 22 };
40-
//[cfail2]~^ ERROR structure `X` has no field named `x`
40+
//[cfail2]~^ ERROR struct `X` has no field named `x`
4141
x.x as u32
4242
//[cfail2]~^ ERROR attempted access of field `x`
4343
}

0 commit comments

Comments
 (0)