Change ty.kind to a method

This commit is contained in:
LeSeulArtichaut 2020-08-03 00:49:11 +02:00
parent ef55a0a92f
commit 3e14b684dd
189 changed files with 947 additions and 899 deletions

View file

@ -19,7 +19,7 @@ pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
let align = bx.const_usize(layout.align.abi.bytes());
return (size, align);
}
match t.kind {
match t.kind() {
ty::Dynamic(..) => {
// load size/align from vtable
let vtable = info.unwrap();
@ -64,7 +64,7 @@ pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
let size = bx.add(sized_size, unsized_size);
// Packed types ignore the alignment of their fields.
if let ty::Adt(def, _) = t.kind {
if let ty::Adt(def, _) = t.kind() {
if def.repr.packed() {
unsized_align = sized_align;
}