Skip to content

Commit 6b76c9e

Browse files
committed
Auto merge of #40252 - topecongiro:compile-fail-test-cfg-stmt-expr, r=petrochenkov
Add compile fail test for stmt_expr_attributes Adds a missing feature gate test for `stmt_expr_attributes`. Issue #39059.
2 parents ba07bd5 + 255d59f commit 6b76c9e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
const X: i32 = #[allow(dead_code)] 8;
12+
//~^ ERROR attributes on non-item statements and expressions are experimental. (see issue #15701)
13+
14+
fn main() {}

Diff for: src/tools/tidy/src/features.rs

-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ pub fn check(path: &Path, bad: &mut bool) {
167167

168168
// FIXME get this whitelist empty.
169169
let whitelist = vec![
170-
"stmt_expr_attributes",
171170
"cfg_target_thread_local", "unwind_attributes",
172171
];
173172

0 commit comments

Comments
 (0)