diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/rfcs/rfc-2396-target_feature-11 | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/rfcs/rfc-2396-target_feature-11')
15 files changed, 0 insertions, 555 deletions
diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/check-pass.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/check-pass.rs deleted file mode 100644 index e0842bfa4..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/check-pass.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Tests the new rules added by RFC 2396, including: -// - applying `#[target_feature]` to safe functions is allowed -// - calling functions with `#[target_feature]` is allowed in -// functions which have (at least) the same features -// - calling functions with `#[target_feature]` is allowed in -// unsafe contexts -// - functions with `#[target_feature]` can coerce to unsafe fn pointers - -// check-pass -// only-x86_64 -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - -#![feature(target_feature_11)] - -#[target_feature(enable = "sse2")] -const fn sse2() {} - -#[cfg(target_feature = "sse2")] -const SSE2_ONLY: () = unsafe { - sse2(); -}; - -#[target_feature(enable = "sse2")] -fn also_sse2() { - sse2(); -} - -#[target_feature(enable = "sse2")] -#[target_feature(enable = "avx")] -fn sse2_and_avx() { - sse2(); -} - -struct Foo; - -impl Foo { - #[target_feature(enable = "sse2")] - fn sse2(&self) { - sse2(); - } -} - -fn main() { - if cfg!(target_feature = "sse2") { - unsafe { - sse2(); - Foo.sse2(); - } - } - let sse2_ptr: unsafe fn() = sse2; -} diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs deleted file mode 100644 index a59d7c2d7..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Tests #73631: closures inherit `#[target_feature]` annotations - -// check-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck -// only-x86_64 - -#![feature(target_feature_11)] - -#[target_feature(enable="avx")] -fn also_use_avx() { - println!("Hello from AVX") -} - -#[target_feature(enable="avx")] -fn use_avx() -> Box<dyn Fn()> { - Box::new(|| also_use_avx()) -} - -fn main() {} diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/feature-gate-target_feature_11.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/feature-gate-target_feature_11.rs deleted file mode 100644 index 975d7a1f6..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/feature-gate-target_feature_11.rs +++ /dev/null @@ -1,6 +0,0 @@ -// only-x86_64 - -#[target_feature(enable = "sse2")] //~ ERROR can only be applied to `unsafe` functions -fn foo() {} - -fn main() {} diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/feature-gate-target_feature_11.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/feature-gate-target_feature_11.stderr deleted file mode 100644 index 18917fd25..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/feature-gate-target_feature_11.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions - --> $DIR/feature-gate-target_feature_11.rs:3:1 - | -LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | fn foo() {} - | -------- not an `unsafe` function - | - = note: see issue #69098 <https://github.com/rust-lang/rust/issues/69098> for more information - = help: add `#![feature(target_feature_11)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr deleted file mode 100644 index cf5815df5..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/fn-ptr.rs:11:21 - | -LL | #[target_feature(enable = "sse2")] - | ---------------------------------- `#[target_feature]` added here -... -LL | let foo: fn() = foo; - | ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers - | | - | expected due to this - | - = note: expected fn pointer `fn()` - found fn item `fn() {foo}` - = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs deleted file mode 100644 index c95d4a08e..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs +++ /dev/null @@ -1,12 +0,0 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck -// only-x86_64 - -#![feature(target_feature_11)] - -#[target_feature(enable = "sse2")] -fn foo() {} - -fn main() { - let foo: fn() = foo; //~ ERROR mismatched types -} diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr deleted file mode 100644 index cf5815df5..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/fn-ptr.rs:11:21 - | -LL | #[target_feature(enable = "sse2")] - | ---------------------------------- `#[target_feature]` added here -... -LL | let foo: fn() = foo; - | ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers - | | - | expected due to this - | - = note: expected fn pointer `fn()` - found fn item `fn() {foo}` - = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs deleted file mode 100644 index 43bda4962..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs +++ /dev/null @@ -1,34 +0,0 @@ -// only-x86_64 - -#![feature(target_feature_11)] - -#[target_feature(enable = "avx")] -fn foo() {} - -#[target_feature(enable = "avx")] -unsafe fn foo_unsafe() {} - -fn call(f: impl Fn()) { - f() -} - -fn call_mut(f: impl FnMut()) { - f() -} - -fn call_once(f: impl FnOnce()) { - f() -} - -fn main() { - call(foo); //~ ERROR expected a `Fn<()>` closure, found `fn() {foo}` - call_mut(foo); //~ ERROR expected a `FnMut<()>` closure, found `fn() {foo}` - call_once(foo); //~ ERROR expected a `FnOnce<()>` closure, found `fn() {foo}` - - call(foo_unsafe); - //~^ ERROR expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}` - call_mut(foo_unsafe); - //~^ ERROR expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` - call_once(foo_unsafe); - //~^ ERROR expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` -} diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr deleted file mode 100644 index fc7bf2277..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr +++ /dev/null @@ -1,105 +0,0 @@ -error[E0277]: expected a `Fn<()>` closure, found `fn() {foo}` - --> $DIR/fn-traits.rs:24:10 - | -LL | call(foo); - | ---- ^^^ expected an `Fn<()>` closure, found `fn() {foo}` - | | - | required by a bound introduced by this call - | - = help: the trait `Fn<()>` is not implemented for fn item `fn() {foo}` - = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` - = note: `#[target_feature]` functions do not implement the `Fn` traits -note: required by a bound in `call` - --> $DIR/fn-traits.rs:11:17 - | -LL | fn call(f: impl Fn()) { - | ^^^^ required by this bound in `call` - -error[E0277]: expected a `FnMut<()>` closure, found `fn() {foo}` - --> $DIR/fn-traits.rs:25:14 - | -LL | call_mut(foo); - | -------- ^^^ expected an `FnMut<()>` closure, found `fn() {foo}` - | | - | required by a bound introduced by this call - | - = help: the trait `FnMut<()>` is not implemented for fn item `fn() {foo}` - = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` - = note: `#[target_feature]` functions do not implement the `Fn` traits -note: required by a bound in `call_mut` - --> $DIR/fn-traits.rs:15:21 - | -LL | fn call_mut(f: impl FnMut()) { - | ^^^^^^^ required by this bound in `call_mut` - -error[E0277]: expected a `FnOnce<()>` closure, found `fn() {foo}` - --> $DIR/fn-traits.rs:26:15 - | -LL | call_once(foo); - | --------- ^^^ expected an `FnOnce<()>` closure, found `fn() {foo}` - | | - | required by a bound introduced by this call - | - = help: the trait `FnOnce<()>` is not implemented for fn item `fn() {foo}` - = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` - = note: `#[target_feature]` functions do not implement the `Fn` traits -note: required by a bound in `call_once` - --> $DIR/fn-traits.rs:19:22 - | -LL | fn call_once(f: impl FnOnce()) { - | ^^^^^^^^ required by this bound in `call_once` - -error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}` - --> $DIR/fn-traits.rs:28:10 - | -LL | call(foo_unsafe); - | ---- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }` - | | - | required by a bound introduced by this call - | - = help: the trait `Fn<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` - = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` - = note: `#[target_feature]` functions do not implement the `Fn` traits -note: required by a bound in `call` - --> $DIR/fn-traits.rs:11:17 - | -LL | fn call(f: impl Fn()) { - | ^^^^ required by this bound in `call` - -error[E0277]: expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` - --> $DIR/fn-traits.rs:30:14 - | -LL | call_mut(foo_unsafe); - | -------- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }` - | | - | required by a bound introduced by this call - | - = help: the trait `FnMut<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` - = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` - = note: `#[target_feature]` functions do not implement the `Fn` traits -note: required by a bound in `call_mut` - --> $DIR/fn-traits.rs:15:21 - | -LL | fn call_mut(f: impl FnMut()) { - | ^^^^^^^ required by this bound in `call_mut` - -error[E0277]: expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` - --> $DIR/fn-traits.rs:32:15 - | -LL | call_once(foo_unsafe); - | --------- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }` - | | - | required by a bound introduced by this call - | - = help: the trait `FnOnce<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` - = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` - = note: `#[target_feature]` functions do not implement the `Fn` traits -note: required by a bound in `call_once` - --> $DIR/fn-traits.rs:19:22 - | -LL | fn call_once(f: impl FnOnce()) { - | ^^^^^^^^ required by this bound in `call_once` - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/issue-99876.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/issue-99876.rs deleted file mode 100644 index 033dcdfc0..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/issue-99876.rs +++ /dev/null @@ -1,9 +0,0 @@ -// check-pass - -#![feature(target_feature_11)] - -struct S<T>(T) -where - [T; (|| {}, 1).1]: Copy; - -fn main() {} diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.mir.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.mir.stderr deleted file mode 100644 index 0ef7b8b09..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.mir.stderr +++ /dev/null @@ -1,83 +0,0 @@ -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:23:5 - | -LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:26:5 - | -LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:29:5 - | -LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:36:5 - | -LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:39:5 - | -LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:46:5 - | -LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:49:5 - | -LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:52:5 - | -LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:60:5 - | -LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:65:18 - | -LL | const name: () = sse2(); - | ^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error: aborting due to 10 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs deleted file mode 100644 index cebc6f947..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs +++ /dev/null @@ -1,69 +0,0 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck -// only-x86_64 - -#![feature(target_feature_11)] - -#[target_feature(enable = "sse2")] -const fn sse2() {} - -#[target_feature(enable = "avx")] -#[target_feature(enable = "bmi2")] -fn avx_bmi2() {} - -struct Quux; - -impl Quux { - #[target_feature(enable = "avx")] - #[target_feature(enable = "bmi2")] - fn avx_bmi2(&self) {} -} - -fn foo() { - sse2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe - avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe - Quux.avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe -} - -#[target_feature(enable = "sse2")] -fn bar() { - avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe - Quux.avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe -} - -#[target_feature(enable = "avx")] -fn baz() { - sse2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe - avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe - Quux.avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe -} - -#[target_feature(enable = "avx")] -#[target_feature(enable = "bmi2")] -fn qux() { - sse2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe -} - -const name: () = sse2(); -//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe -//[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe - -fn main() {} diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.thir.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.thir.stderr deleted file mode 100644 index c75ac6e8b..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.thir.stderr +++ /dev/null @@ -1,83 +0,0 @@ -error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:23:5 - | -LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:26:5 - | -LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:29:5 - | -LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:36:5 - | -LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:39:5 - | -LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:46:5 - | -LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:49:5 - | -LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:52:5 - | -LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:60:5 - | -LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:65:18 - | -LL | const name: () = sse2(); - | ^^^^^^ call to function with `#[target_feature]` - | - = note: can only be called if the required target features are available - -error: aborting due to 10 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs deleted file mode 100644 index 7314fa8cc..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs +++ /dev/null @@ -1,21 +0,0 @@ -// only-x86_64 - -#![feature(target_feature_11)] - -trait Foo { - fn foo(&self); - unsafe fn unsf_foo(&self); -} - -struct Bar; - -impl Foo for Bar { - #[target_feature(enable = "sse2")] - //~^ ERROR cannot be applied to safe trait method - fn foo(&self) {} - - #[target_feature(enable = "sse2")] - unsafe fn unsf_foo(&self) {} -} - -fn main() {} diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr deleted file mode 100644 index 07d6e0900..000000000 --- a/src/test/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `#[target_feature(..)]` cannot be applied to safe trait method - --> $DIR/trait-impl.rs:13:5 - | -LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be applied to safe trait method -LL | -LL | fn foo(&self) {} - | ------------- not an `unsafe` function - -error: aborting due to previous error - |