Skip to content

Commit f81f945

Browse files
committed
Rollup merge of rust-lang#23578 - fhahn:issue-22820-feature-gate-tests1, r=alexcrichton
...ures. Namely: * `box_syntax` * `box_patterns` * `simd_ffi` * `macro_reexport` cc rust-lang#22820
2 parents 4271986 + c48bb85 commit f81f945

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2014 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+
// Test that macro reexports item are gated by `macro_reexport` feature gate.
12+
13+
// aux-build:macro_reexport_1.rs
14+
// ignore-stage1
15+
16+
#![crate_type = "dylib"]
17+
18+
#[macro_reexport(reexported)]
19+
#[macro_use] #[no_link]
20+
extern crate macro_reexport_1;
21+
//~^ ERROR macros reexports are experimental and possibly buggy
22+
//~| HELP add #![feature(macro_reexport)] to the crate attributes to enable
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
// Test that patterns including the box syntax are gated by `box_patterns` feature gate.
12+
13+
fn main() {
14+
let x = Box::new(1);
15+
16+
match x {
17+
box 1 => (),
18+
//~^ box pattern syntax is experimental
19+
//~| add #![feature(box_patterns)] to the crate attributes to enable
20+
_ => ()
21+
};
22+
}
+17
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+
// Test that the use of the box syntax is gated by `box_syntax` feature gate.
12+
13+
fn main() {
14+
let x = box 3;
15+
//~^ ERROR box expression syntax is experimental; you can call `Box::new` instead.
16+
//~| HELP add #![feature(box_syntax)] to the crate attributes to enable
17+
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
// Test that the use of smid types in the ffi is gated by `smid_ffi` feature gate.
12+
13+
#![feature(simd)]
14+
15+
#[repr(C)]
16+
#[derive(Copy)]
17+
#[simd]
18+
pub struct f32x4(f32, f32, f32, f32);
19+
20+
#[allow(dead_code)]
21+
extern {
22+
fn foo(x: f32x4);
23+
//~^ ERROR use of SIMD type `f32x4` in FFI is highly experimental and may result in invalid code
24+
//~| HELP add #![feature(simd_ffi)] to the crate attributes to enable
25+
}
26+
27+
fn main() {}

0 commit comments

Comments
 (0)