Skip to content

Commit

Permalink
Remove unused AllocatorTy::Bang
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Apr 22, 2018
1 parent 9e8f683 commit 5969712
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
4 changes: 1 addition & 3 deletions src/librustc_allocator/expand.rs
Expand Up @@ -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")
}
}
Expand All @@ -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 => {
Expand Down
1 change: 0 additions & 1 deletion src/librustc_allocator/lib.rs
Expand Up @@ -47,7 +47,6 @@ pub struct AllocatorMethod {
}

pub enum AllocatorTy {
Bang,
Layout,
Ptr,
ResultPtr,
Expand Down
2 changes: 0 additions & 2 deletions src/librustc_trans/allocator.rs
Expand Up @@ -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,

Expand Down

0 comments on commit 5969712

Please sign in to comment.