Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 08290b2

Browse files
committedJan 11, 2017
Make type_is_fat_ptr not depend on LLVM.
1 parent 7461038 commit 08290b2

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed
 

‎src/librustc_trans/common.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,10 @@ use rustc_i128::u128;
4545
pub use context::{CrateContext, SharedCrateContext};
4646

4747
pub fn type_is_fat_ptr<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
48-
match ty.sty {
49-
ty::TyRawPtr(ty::TypeAndMut{ty, ..}) |
50-
ty::TyRef(_, ty::TypeAndMut{ty, ..}) |
51-
ty::TyBox(ty) => {
52-
!ccx.shared().type_is_sized(ty)
53-
}
54-
_ => {
55-
false
56-
}
48+
if let Layout::FatPointer { .. } = *ccx.layout_of(ty) {
49+
true
50+
} else {
51+
false
5752
}
5853
}
5954

0 commit comments

Comments
 (0)
Please sign in to comment.