Skip to content

Commit

Permalink
auto merge of #9491 : thestinger/rust/noreturn, r=huonw
Browse files Browse the repository at this point in the history
Closes #9317
  • Loading branch information
bors committed Sep 25, 2013
2 parents 797a373 + e76bfae commit 5375cf8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ pub fn decl_rust_fn(ccx: &mut CrateContext, inputs: &[ty::t], output: ty::t,
let llfn = decl_cdecl_fn(ccx.llmod, name, llfty);

match ty::get(output).sty {
// functions returning bottom may unwind, but can never return normally
ty::ty_bot => {
unsafe {
llvm::LLVMAddFunctionAttr(llfn, lib::llvm::NoReturnAttribute as c_uint)
}
}
// `~` pointer return values never alias because ownership is transferred
ty::ty_uniq(*) |
ty::ty_evec(_, ty::vstore_uniq) => {
Expand Down

0 comments on commit 5375cf8

Please sign in to comment.