Skip to content

Commit e3ab8cb

Browse files
committed
Add test for the feature gate
1 parent 63bc48b commit e3ab8cb

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/liballoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub mod rc;
9898
/// Common out-of-memory routine
9999
#[cold]
100100
#[inline(never)]
101-
#[unsafe_no_nounwind]
101+
#[unsafe_no_unwind]
102102
pub fn oom() -> ! {
103103
// FIXME(#14674): This really needs to do something other than just abort
104104
// here, but any printing done must be *guaranteed* to not

src/librustc/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ impl LintPass for UnusedAttributes {
654654
"omit_gdb_pretty_printer_section",
655655
"unsafe_no_drop_flag",
656656
"can_unwind",
657-
"nounwind",
657+
"unsafe_no_unwind",
658658

659659
// used in resolve
660660
"prelude_import",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![allow(dead_code)]
12+
13+
#[can_unwind]
14+
extern fn foo() { } //~ ERROR the `#[can_unwind]` attribute is an experimental feature
15+
16+
#[unsafe_no_unwind]
17+
fn main() {} //~ ERROR the `#[unsafe_no_unwind]` attribute is an experimental feature

0 commit comments

Comments
 (0)