Mark functions returning uninhabited types as noreturn
This commit is contained in:
parent
ff65726ebf
commit
69ec4aa97c
3 changed files with 19 additions and 9 deletions
|
|
@ -8,17 +8,27 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -g -C no-prepopulate-passes
|
||||
// ignore-tidy-linelength
|
||||
// min-llvm-version 4.0
|
||||
|
||||
// compile-flags: -g -C no-prepopulate-passes
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// CHECK: {{.*}}DISubprogram{{.*}}name: "foo"{{.*}}DIFlagNoReturn
|
||||
|
||||
fn foo() -> ! {
|
||||
#[no_mangle]
|
||||
pub fn foo() -> ! {
|
||||
// CHECK: @foo() unnamed_addr #0
|
||||
loop {}
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
foo();
|
||||
pub enum EmptyEnum {}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn bar() -> EmptyEnum {
|
||||
// CHECK: @bar() unnamed_addr #0
|
||||
loop {}
|
||||
}
|
||||
|
||||
// CHECK: attributes #0 = {{{.*}} noreturn {{.*}}}
|
||||
|
||||
// CHECK: DISubprogram(name: "foo", {{.*}} DIFlagNoReturn
|
||||
// CHECK: DISubprogram(name: "bar", {{.*}} DIFlagNoReturn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue