Skip to content

Commit 006c744

Browse files
author
Ariel Ben-Yehuda
authored
Rollup merge of rust-lang#40279 - gibfahn:test-unwind, r=est31
Add compile-fail tests for remaining items in whitelist and remove it Add compile-fail tests for `cfg_target_thread_local` and `unwind_attributes`, and remove the whitelist. Let me know if I should clean up the tests (or if I've done anything else wrong, this is my first contribution to rust). cc/ @est31
2 parents 4eb7a33 + 7c88d9e commit 006c744

File tree

4 files changed

+72
-6
lines changed

4 files changed

+72
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2016 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+
#![feature(thread_local)]
12+
#![feature(cfg_target_thread_local)]
13+
#![crate_type = "lib"]
14+
15+
#[no_mangle]
16+
#[cfg_attr(target_thread_local, thread_local)]
17+
pub static FOO: u32 = 3;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2016 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+
// ignore-windows
12+
// aux-build:cfg-target-thread-local.rs
13+
14+
#![feature(thread_local)]
15+
16+
extern crate cfg_target_thread_local;
17+
18+
extern {
19+
#[cfg_attr(target_thread_local, thread_local)]
20+
//~^ `cfg(target_thread_local)` is experimental and subject to change (see issue #29594)
21+
22+
static FOO: u32;
23+
}
24+
25+
fn main() {
26+
assert_eq!(FOO, 3);
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
// compile-flags: -C no-prepopulate-passes
12+
13+
#![crate_type = "lib"]
14+
15+
extern {
16+
// CHECK: Function Attrs: nounwind
17+
// CHECK-NEXT: declare void @extern_fn
18+
fn extern_fn();
19+
// CHECK-NOT: Function Attrs: nounwind
20+
// CHECK: declare void @unwinding_extern_fn
21+
#[unwind] //~ ERROR #[unwind] is experimental
22+
fn unwinding_extern_fn();
23+
}
24+
25+
pub unsafe fn force_declare() {
26+
extern_fn();
27+
unwinding_extern_fn();
28+
}

src/tools/tidy/src/features.rs

-6
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,11 @@ pub fn check(path: &Path, bad: &mut bool) {
165165
}
166166
});
167167

168-
// FIXME get this whitelist empty.
169-
let whitelist = vec![
170-
"cfg_target_thread_local", "unwind_attributes",
171-
];
172-
173168
// Only check the number of lang features.
174169
// Obligatory testing for library features is dumb.
175170
let gate_untested = features.iter()
176171
.filter(|&(_, f)| f.level == Status::Unstable)
177172
.filter(|&(_, f)| !f.has_gate_test)
178-
.filter(|&(n, _)| !whitelist.contains(&n.as_str()))
179173
.collect::<Vec<_>>();
180174

181175
for &(name, _) in gate_untested.iter() {

0 commit comments

Comments
 (0)