diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-04-26 10:43:00 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-04-26 14:49:28 +0000 |
| commit | 3568bdc6cdf04da3bf8f1be02741ea731265a3da (patch) | |
| tree | f0b01b7b7588baf7c0cf525b12a77525d4113e53 /src/test/ui/rfcs | |
| parent | 1c988cfa0b7f4d3bc5b1cb40dc5002f5adbfb9ad (diff) | |
| download | rust-3568bdc6cdf04da3bf8f1be02741ea731265a3da.tar.gz rust-3568bdc6cdf04da3bf8f1be02741ea731265a3da.zip | |
Revert "add `DefId` to unsafety violations and display function path in E0133"
This reverts commit 8b8f6653cfd54525714f02efe7af0a0f830e185c.
Diffstat (limited to 'src/test/ui/rfcs')
3 files changed, 58 insertions, 38 deletions
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 index 6743f0802a0..0ef7b8b09f1 100644 --- 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 @@ -1,4 +1,4 @@ -error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block +error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block --> $DIR/safe-calls.rs:23:5 | LL | sse2(); @@ -6,72 +6,72 @@ LL | sse2(); | = 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:24:5 +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 `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:25:5 +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 `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:30:5 +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 `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:31:5 +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 `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:36:5 +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 `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:37:5 +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 `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:38:5 +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 `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:44:5 +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 `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block - --> $DIR/safe-calls.rs:47:18 +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]` 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 index ec10fca96f9..cebc6f94784 100644 --- 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 @@ -20,30 +20,50 @@ impl Quux { } fn foo() { - sse2(); //~ ERROR call to function `sse2` with `#[target_feature]` is unsafe - avx_bmi2(); //~ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe - Quux.avx_bmi2(); //~ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe + 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(); //~ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe - Quux.avx_bmi2(); //~ ERROR call to function `Quux::avx_bmi2` 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")] fn baz() { - sse2(); //~ ERROR call to function `sse2` with `#[target_feature]` is unsafe - avx_bmi2(); //~ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe - Quux.avx_bmi2(); //~ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe + 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(); //~ ERROR call to function `sse2` with `#[target_feature]` is unsafe + 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(); //~ 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 index 6743f0802a0..c75ac6e8b9a 100644 --- 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 @@ -7,7 +7,7 @@ LL | sse2(); = 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:24:5 + --> $DIR/safe-calls.rs:26:5 | LL | avx_bmi2(); | ^^^^^^^^^^ call to function with `#[target_feature]` @@ -15,7 +15,7 @@ LL | avx_bmi2(); = 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:25:5 + --> $DIR/safe-calls.rs:29:5 | LL | Quux.avx_bmi2(); | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` @@ -23,7 +23,7 @@ LL | Quux.avx_bmi2(); = 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:30:5 + --> $DIR/safe-calls.rs:36:5 | LL | avx_bmi2(); | ^^^^^^^^^^ call to function with `#[target_feature]` @@ -31,7 +31,7 @@ LL | avx_bmi2(); = 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:31:5 + --> $DIR/safe-calls.rs:39:5 | LL | Quux.avx_bmi2(); | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` @@ -39,7 +39,7 @@ LL | Quux.avx_bmi2(); = 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:36:5 + --> $DIR/safe-calls.rs:46:5 | LL | sse2(); | ^^^^^^ call to function with `#[target_feature]` @@ -47,7 +47,7 @@ LL | sse2(); = 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:37:5 + --> $DIR/safe-calls.rs:49:5 | LL | avx_bmi2(); | ^^^^^^^^^^ call to function with `#[target_feature]` @@ -55,7 +55,7 @@ LL | avx_bmi2(); = 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:38:5 + --> $DIR/safe-calls.rs:52:5 | LL | Quux.avx_bmi2(); | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` @@ -63,7 +63,7 @@ LL | Quux.avx_bmi2(); = 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:44:5 + --> $DIR/safe-calls.rs:60:5 | LL | sse2(); | ^^^^^^ call to function with `#[target_feature]` @@ -71,7 +71,7 @@ LL | sse2(); = 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:47:18 + --> $DIR/safe-calls.rs:65:18 | LL | const name: () = sse2(); | ^^^^^^ call to function with `#[target_feature]` |
