From 5969712c3f2163b7ca6f809e0f5e31f73e8898bb Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 21 Apr 2018 15:16:59 -0700 Subject: [PATCH] Remove unused AllocatorTy::Bang --- src/librustc_allocator/expand.rs | 4 +--- src/librustc_allocator/lib.rs | 1 - src/librustc_trans/allocator.rs | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/librustc_allocator/expand.rs b/src/librustc_allocator/expand.rs index ffd02108c27..9338d000c12 100644 --- a/src/librustc_allocator/expand.rs +++ b/src/librustc_allocator/expand.rs @@ -245,7 +245,7 @@ impl<'a> AllocFnFactory<'a> { self.cx.expr_ident(self.span, ident) } - AllocatorTy::ResultPtr | AllocatorTy::Bang | AllocatorTy::Unit => { + AllocatorTy::ResultPtr | AllocatorTy::Unit => { panic!("can't convert AllocatorTy to an argument") } } @@ -262,8 +262,6 @@ impl<'a> AllocFnFactory<'a> { (self.ptr_u8(), expr) } - AllocatorTy::Bang => (self.cx.ty(self.span, TyKind::Never), expr), - AllocatorTy::Unit => (self.cx.ty(self.span, TyKind::Tup(Vec::new())), expr), AllocatorTy::Layout | AllocatorTy::Usize | AllocatorTy::Ptr => { diff --git a/src/librustc_allocator/lib.rs b/src/librustc_allocator/lib.rs index f3103e21606..969086815de 100644 --- a/src/librustc_allocator/lib.rs +++ b/src/librustc_allocator/lib.rs @@ -47,7 +47,6 @@ pub struct AllocatorMethod { } pub enum AllocatorTy { - Bang, Layout, Ptr, ResultPtr, diff --git a/src/librustc_trans/allocator.rs b/src/librustc_trans/allocator.rs index f2dd2ed8460..ffebb959ebf 100644 --- a/src/librustc_trans/allocator.rs +++ b/src/librustc_trans/allocator.rs @@ -43,13 +43,11 @@ pub(crate) unsafe fn trans(tcx: TyCtxt, mods: &ModuleLlvm, kind: AllocatorKind) AllocatorTy::Ptr => args.push(i8p), AllocatorTy::Usize => args.push(usize), - AllocatorTy::Bang | AllocatorTy::ResultPtr | AllocatorTy::Unit => panic!("invalid allocator arg"), } } let output = match method.output { - AllocatorTy::Bang => None, AllocatorTy::ResultPtr => Some(i8p), AllocatorTy::Unit => None,