diff options
| author | bors <bors@rust-lang.org> | 2022-09-10 04:14:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-10 04:14:34 +0000 |
| commit | cedd26b1ea066fe243b82b0f78e37066c6f4d789 (patch) | |
| tree | 9e259edeea5fcf1e113ca5b609ce3bb7674b5c38 /src | |
| parent | 87eb3e2dfad244025bd5ee3161be66c271f691d8 (diff) | |
| parent | c7475011a398b9aa35c60e20f1b396dc0fc65afa (diff) | |
| download | rust-cedd26b1ea066fe243b82b0f78e37066c6f4d789.tar.gz rust-cedd26b1ea066fe243b82b0f78e37066c6f4d789.zip | |
Auto merge of #99916 - dpaoliello:stablizerawdylib, r=wesleywiser
Stabilize raw-dylib for non-x86 This stabilizes the `raw-dylib` and `link_ordinal` features (#58713) for non-x86 architectures (i.e., `x86_64`, `aarch64` and `thumbv7a`): * Marked the `raw_dylib` feature as `active`. * Marked the `link_ordinal` attribute as `ungated`. * Added new errors if either feature is used on x86 targets without the `raw_dylib` feature being enabled. * Updated tests to only set the `raw_dylib` feature when building for x86.
Diffstat (limited to 'src')
42 files changed, 73 insertions, 224 deletions
diff --git a/src/doc/unstable-book/src/language-features/raw-dylib.md b/src/doc/unstable-book/src/language-features/raw-dylib.md index 23fc5b3052d..5fd208ae757 100644 --- a/src/doc/unstable-book/src/language-features/raw-dylib.md +++ b/src/doc/unstable-book/src/language-features/raw-dylib.md @@ -26,9 +26,9 @@ fn main() { ## Limitations -Currently, this feature is only supported on `-windows-msvc` targets. Non-Windows platforms don't have import -libraries, and an incompatibility between LLVM and the BFD linker means that it is not currently supported on -`-windows-gnu` targets. +This feature is unstable for the `x86` architecture, and stable for all other architectures. -On the `i686-pc-windows-msvc` target, this feature supports only the `cdecl`, `stdcall`, `system`, and `fastcall` -calling conventions. +This feature is only supported on Windows. + +On the `x86` architecture, this feature supports only the `cdecl`, `stdcall`, `system`, `fastcall`, and +`vectorcall` calling conventions. diff --git a/src/test/run-make/raw-dylib-alt-calling-convention/lib.rs b/src/test/run-make/raw-dylib-alt-calling-convention/lib.rs index b5e9415b2be..fe74fbfd264 100644 --- a/src/test/run-make/raw-dylib-alt-calling-convention/lib.rs +++ b/src/test/run-make/raw-dylib-alt-calling-convention/lib.rs @@ -1,5 +1,5 @@ -#![feature(raw_dylib)] #![feature(abi_vectorcall)] +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[repr(C)] #[derive(Clone)] diff --git a/src/test/run-make/raw-dylib-link-ordinal/lib.rs b/src/test/run-make/raw-dylib-link-ordinal/lib.rs index 5efce4e938c..bb25ac64c61 100644 --- a/src/test/run-make/raw-dylib-link-ordinal/lib.rs +++ b/src/test/run-make/raw-dylib-link-ordinal/lib.rs @@ -1,4 +1,4 @@ -#![feature(raw_dylib)] +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "exporter", kind = "raw-dylib")] extern { diff --git a/src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs b/src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs index 07dd3d7be9b..b7921396a0f 100644 --- a/src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs +++ b/src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs @@ -1,4 +1,4 @@ -#![feature(raw_dylib)] +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "exporter", kind = "raw-dylib")] extern "stdcall" { diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs index 0594b1384ec..fc47a9061d3 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs @@ -1,10 +1,11 @@ +// only-x86 #[link(name = "foo")] extern "C" { #[link_ordinal(42)] - //~^ ERROR: the `#[link_ordinal]` attribute is an experimental feature + //~^ ERROR: `#[link_ordinal]` is unstable on x86 fn foo(); #[link_ordinal(5)] - //~^ ERROR: the `#[link_ordinal]` attribute is an experimental feature + //~^ ERROR: `#[link_ordinal]` is unstable on x86 static mut imported_variable: i32; } diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr index d39969b61ca..0e900760d24 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr @@ -1,5 +1,5 @@ -error[E0658]: the `#[link_ordinal]` attribute is an experimental feature - --> $DIR/feature-gate-raw-dylib-2.rs:3:5 +error[E0658]: `#[link_ordinal]` is unstable on x86 + --> $DIR/feature-gate-raw-dylib-2.rs:4:5 | LL | #[link_ordinal(42)] | ^^^^^^^^^^^^^^^^^^^ @@ -7,8 +7,8 @@ LL | #[link_ordinal(42)] = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information = help: add `#![feature(raw_dylib)]` to the crate attributes to enable -error[E0658]: the `#[link_ordinal]` attribute is an experimental feature - --> $DIR/feature-gate-raw-dylib-2.rs:6:5 +error[E0658]: `#[link_ordinal]` is unstable on x86 + --> $DIR/feature-gate-raw-dylib-2.rs:7:5 | LL | #[link_ordinal(5)] | ^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs index 33655cf8bdc..295f502d6a3 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs @@ -1,7 +1,7 @@ // only-windows // only-x86 #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")] -//~^ ERROR link kind `raw-dylib` is unstable +//~^ ERROR link kind `raw-dylib` is unstable on x86 //~| ERROR import name type is unstable extern "C" {} diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr index be82dd11926..d6b165b7610 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr @@ -1,4 +1,4 @@ -error[E0658]: link kind `raw-dylib` is unstable +error[E0658]: link kind `raw-dylib` is unstable on x86 --> $DIR/feature-gate-raw-dylib-import-name-type.rs:3:29 | LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")] diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib.rs index f894f517b38..291cca8fd25 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib.rs +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib.rs @@ -1,6 +1,7 @@ // only-windows +// only-x86 #[link(name = "foo", kind = "raw-dylib")] -//~^ ERROR: link kind `raw-dylib` is unstable +//~^ ERROR: link kind `raw-dylib` is unstable on x86 extern "C" {} fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr index ca7a61f6413..f02241e4908 100644 --- a/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr +++ b/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr @@ -1,5 +1,5 @@ -error[E0658]: link kind `raw-dylib` is unstable - --> $DIR/feature-gate-raw-dylib.rs:2:29 +error[E0658]: link kind `raw-dylib` is unstable on x86 + --> $DIR/feature-gate-raw-dylib.rs:3:29 | LL | #[link(name = "foo", kind = "raw-dylib")] | ^^^^^^^^^^^ diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs index 9e739c02dc8..22d57f8bedd 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs @@ -1,7 +1,6 @@ // only-windows // only-x86 #![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete #[link(name = "foo", kind = "raw-dylib", import_name_type = 6)] //~^ ERROR import name type must be of the form `import_name_type = "string"` diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr index ee10b0114a4..0e95fec29d2 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr @@ -1,17 +1,8 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/import-name-type-invalid-format.rs:3:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: import name type must be of the form `import_name_type = "string"` - --> $DIR/import-name-type-invalid-format.rs:6:42 + --> $DIR/import-name-type-invalid-format.rs:5:42 | LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = 6)] | ^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs index c404dbae468..7ccb0082fb9 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs @@ -2,7 +2,6 @@ // only-windows // only-x86 #![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated", import_name_type = "decorated")] //~^ ERROR multiple `import_name_type` arguments in a single `#[link]` attribute diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr index 936c8aa7359..7c0e0be911f 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr @@ -1,17 +1,8 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/import-name-type-multiple.rs:4:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: multiple `import_name_type` arguments in a single `#[link]` attribute - --> $DIR/import-name-type-multiple.rs:7:74 + --> $DIR/import-name-type-multiple.rs:6:74 | LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated", import_name_type = "decorated")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs index 350b0294641..f728a578d3b 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs @@ -1,7 +1,6 @@ // only-windows // only-x86 #![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete #[link(name = "foo", kind = "raw-dylib", import_name_type = "unknown")] //~^ ERROR unknown import name type `unknown`, expected one of: decorated, noprefix, undecorated diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr index b6871a0d317..2b299f2fea3 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr @@ -1,17 +1,8 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/import-name-type-unknown-value.rs:3:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: unknown import name type `unknown`, expected one of: decorated, noprefix, undecorated - --> $DIR/import-name-type-unknown-value.rs:6:42 + --> $DIR/import-name-type-unknown-value.rs:5:42 | LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "unknown")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs index b467917bacc..ae9207864a2 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs @@ -1,7 +1,6 @@ // only-windows // only-x86 #![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete #[link(name = "foo", import_name_type = "decorated")] //~^ ERROR import name type can only be used with link kind `raw-dylib` diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr index c35333fb88d..5898cd875a1 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr @@ -1,23 +1,14 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/import-name-type-unsupported-link-kind.rs:3:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: import name type can only be used with link kind `raw-dylib` - --> $DIR/import-name-type-unsupported-link-kind.rs:6:22 + --> $DIR/import-name-type-unsupported-link-kind.rs:5:22 | LL | #[link(name = "foo", import_name_type = "decorated")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: import name type can only be used with link kind `raw-dylib` - --> $DIR/import-name-type-unsupported-link-kind.rs:10:39 + --> $DIR/import-name-type-unsupported-link-kind.rs:9:39 | LL | #[link(name = "bar", kind = "static", import_name_type = "decorated")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs index 4e6de7d6ac3..346ea18a8f8 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs @@ -1,7 +1,5 @@ // only-windows // ignore-x86 -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")] //~^ ERROR import name type is only supported on x86 extern "C" { } diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr index d8a585145a7..b56449299b7 100644 --- a/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr @@ -1,17 +1,8 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/import-name-type-x86-only.rs:3:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: import name type is only supported on x86 - --> $DIR/import-name-type-x86-only.rs:5:42 + --> $DIR/import-name-type-x86-only.rs:3:42 | LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs index 77f425c3e45..1a128c87a0c 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs @@ -1,5 +1,4 @@ -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name="foo")] extern "C" { diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr index dfe9d031c77..481a06d2797 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr @@ -1,23 +1,14 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/link-ordinal-and-name.rs:1:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: cannot use `#[link_name]` with `#[link_ordinal]` - --> $DIR/link-ordinal-and-name.rs:7:5 + --> $DIR/link-ordinal-and-name.rs:6:5 | LL | #[link_ordinal(42)] | ^^^^^^^^^^^^^^^^^^^ error: cannot use `#[link_name]` with `#[link_ordinal]` - --> $DIR/link-ordinal-and-name.rs:11:5 + --> $DIR/link-ordinal-and-name.rs:10:5 | LL | #[link_ordinal(5)] | ^^^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs index 4687fe47f90..7c8da050cf6 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs @@ -1,5 +1,4 @@ -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "foo")] extern "C" { diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr index 1d0fad6cb49..55cdcad75a4 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr @@ -1,14 +1,5 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/link-ordinal-invalid-format.rs:1:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: illegal ordinal format in `link_ordinal` - --> $DIR/link-ordinal-invalid-format.rs:6:5 + --> $DIR/link-ordinal-invalid-format.rs:5:5 | LL | #[link_ordinal("JustMonika")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -16,12 +7,12 @@ LL | #[link_ordinal("JustMonika")] = note: an unsuffixed integer value, e.g., `1`, is expected error: illegal ordinal format in `link_ordinal` - --> $DIR/link-ordinal-invalid-format.rs:9:5 + --> $DIR/link-ordinal-invalid-format.rs:8:5 | LL | #[link_ordinal("JustMonika")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: an unsuffixed integer value, e.g., `1`, is expected -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs index becf2700aeb..9feed394110 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs @@ -1,5 +1,4 @@ -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "foo")] extern "C" { diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr index 5b0ec869d03..853cdad8c1c 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr @@ -1,14 +1,5 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/link-ordinal-missing-argument.rs:1:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: incorrect number of arguments to `#[link_ordinal]` - --> $DIR/link-ordinal-missing-argument.rs:6:5 + --> $DIR/link-ordinal-missing-argument.rs:5:5 | LL | #[link_ordinal()] | ^^^^^^^^^^^^^^^^^ @@ -16,12 +7,12 @@ LL | #[link_ordinal()] = note: the attribute requires exactly one argument error: incorrect number of arguments to `#[link_ordinal]` - --> $DIR/link-ordinal-missing-argument.rs:9:5 + --> $DIR/link-ordinal-missing-argument.rs:8:5 | LL | #[link_ordinal()] | ^^^^^^^^^^^^^^^^^ | = note: the attribute requires exactly one argument -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs index 7b07d09e72a..631c363d4ba 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs @@ -1,6 +1,5 @@ // only-windows -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "foo", kind = "raw-dylib")] extern "C" { diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr index 92a39b3d1b0..c0453d2bf01 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr @@ -1,35 +1,26 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/link-ordinal-multiple.rs:2:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: multiple `link_ordinal` attributes - --> $DIR/link-ordinal-multiple.rs:7:5 + --> $DIR/link-ordinal-multiple.rs:6:5 | LL | #[link_ordinal(1)] | ^^^^^^^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/link-ordinal-multiple.rs:8:5 + --> $DIR/link-ordinal-multiple.rs:7:5 | LL | #[link_ordinal(2)] | ^^^^^^^^^^^^^^^^^^ error: multiple `link_ordinal` attributes - --> $DIR/link-ordinal-multiple.rs:10:5 + --> $DIR/link-ordinal-multiple.rs:9:5 | LL | #[link_ordinal(1)] | ^^^^^^^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/link-ordinal-multiple.rs:11:5 + --> $DIR/link-ordinal-multiple.rs:10:5 | LL | #[link_ordinal(2)] | ^^^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs index 5d273d52a92..54e614164b3 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs @@ -1,5 +1,4 @@ -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link_ordinal(123)] //~^ ERROR attribute should be applied to a foreign function or static diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr index 8fa2f16f44d..ec4104fbe50 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr @@ -1,29 +1,20 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/link-ordinal-not-foreign-fn.rs:1:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: attribute should be applied to a foreign function or static - --> $DIR/link-ordinal-not-foreign-fn.rs:4:1 + --> $DIR/link-ordinal-not-foreign-fn.rs:3:1 | LL | #[link_ordinal(123)] | ^^^^^^^^^^^^^^^^^^^^ error: attribute should be applied to a foreign function or static - --> $DIR/link-ordinal-not-foreign-fn.rs:8:1 + --> $DIR/link-ordinal-not-foreign-fn.rs:7:1 | LL | #[link_ordinal(123)] | ^^^^^^^^^^^^^^^^^^^^ error: attribute should be applied to a foreign function or static - --> $DIR/link-ordinal-not-foreign-fn.rs:12:1 + --> $DIR/link-ordinal-not-foreign-fn.rs:11:1 | LL | #[link_ordinal(42)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors; 1 warning emitted +error: aborting due to 3 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs index 99d7d9d0b7e..46731581ebc 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs @@ -1,5 +1,4 @@ -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "foo")] extern "C" { diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr index 36f278bd856..fef6de6aedf 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr @@ -1,14 +1,5 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/link-ordinal-too-large.rs:1:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: ordinal value in `link_ordinal` is too large: `72436` - --> $DIR/link-ordinal-too-large.rs:6:5 + --> $DIR/link-ordinal-too-large.rs:5:5 | LL | #[link_ordinal(72436)] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -16,12 +7,12 @@ LL | #[link_ordinal(72436)] = note: the value may not exceed `u16::MAX` error: ordinal value in `link_ordinal` is too large: `72436` - --> $DIR/link-ordinal-too-large.rs:9:5 + --> $DIR/link-ordinal-too-large.rs:8:5 | LL | #[link_ordinal(72436)] | ^^^^^^^^^^^^^^^^^^^^^^ | = note: the value may not exceed `u16::MAX` -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs index eca4186e593..71e0ac9f3ee 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs @@ -1,5 +1,4 @@ -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "foo")] extern "C" { diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr index 745aab24dc7..7e0fcd845cb 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr @@ -1,14 +1,5 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/link-ordinal-too-many-arguments.rs:1:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: incorrect number of arguments to `#[link_ordinal]` - --> $DIR/link-ordinal-too-many-arguments.rs:6:5 + --> $DIR/link-ordinal-too-many-arguments.rs:5:5 | LL | #[link_ordinal(3, 4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -16,12 +7,12 @@ LL | #[link_ordinal(3, 4)] = note: the attribute requires exactly one argument error: incorrect number of arguments to `#[link_ordinal]` - --> $DIR/link-ordinal-too-many-arguments.rs:9:5 + --> $DIR/link-ordinal-too-many-arguments.rs:8:5 | LL | #[link_ordinal(3, 4)] | ^^^^^^^^^^^^^^^^^^^^^ | = note: the attribute requires exactly one argument -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs index 99f317399d7..329c93fc196 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs @@ -1,5 +1,4 @@ -#![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "foo")] extern "C" { diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr index f1eeb22da59..5fbffbda570 100644 --- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr @@ -1,23 +1,14 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/link-ordinal-unsupported-link-kind.rs:1:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: `#[link_ordinal]` is only supported if link kind is `raw-dylib` - --> $DIR/link-ordinal-unsupported-link-kind.rs:6:5 + --> $DIR/link-ordinal-unsupported-link-kind.rs:5:5 | LL | #[link_ordinal(3)] | ^^^^^^^^^^^^^^^^^^ error: `#[link_ordinal]` is only supported if link kind is `raw-dylib` - --> $DIR/link-ordinal-unsupported-link-kind.rs:13:5 + --> $DIR/link-ordinal-unsupported-link-kind.rs:12:5 | LL | #[link_ordinal(3)] | ^^^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs b/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs index 13c9aa01e34..6542faad264 100644 --- a/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs +++ b/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs @@ -3,7 +3,6 @@ // compile-flags: --crate-type lib --emit link #![allow(clashing_extern_declarations)] #![feature(raw_dylib)] -//~^ WARN the feature `raw_dylib` is incomplete #[link(name = "foo", kind = "raw-dylib")] extern "C" { fn f(x: i32); diff --git a/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr b/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr index 93ca8f4d8d4..c6808bec7b5 100644 --- a/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr @@ -1,17 +1,8 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/multiple-declarations.rs:5:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error: multiple declarations of external function `f` from library `foo.dll` have different calling conventions - --> $DIR/multiple-declarations.rs:15:9 + --> $DIR/multiple-declarations.rs:14:9 | LL | fn f(x: i32); | ^^^^^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error diff --git a/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs b/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs index 5856b18aa16..4efffbd532e 100644 --- a/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs +++ b/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs @@ -1,7 +1,6 @@ // ignore-windows // compile-flags: --crate-type lib -#![feature(raw_dylib)] -//~^ WARNING: the feature `raw_dylib` is incomplete +#![cfg_attr(target_arch = "x86", feature(raw_dylib))] #[link(name = "foo", kind = "raw-dylib")] //~^ ERROR: link kind `raw-dylib` is only supported on Windows targets extern "C" {} diff --git a/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr b/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr index 600aac81a35..14e791f1fb9 100644 --- a/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr @@ -1,18 +1,9 @@ -warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/raw-dylib-windows-only.rs:3:12 - | -LL | #![feature(raw_dylib)] - | ^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information - error[E0455]: link kind `raw-dylib` is only supported on Windows targets - --> $DIR/raw-dylib-windows-only.rs:5:29 + --> $DIR/raw-dylib-windows-only.rs:4:29 | LL | #[link(name = "foo", kind = "raw-dylib")] | ^^^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error For more information about this error, try `rustc --explain E0455`. diff --git a/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs b/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs index dc647fd63f5..2f5a23e47a7 100644 --- a/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs +++ b/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs @@ -1,8 +1,6 @@ // only-x86_64 // only-windows // compile-flags: --crate-type lib --emit link -#![allow(incomplete_features)] -#![feature(raw_dylib)] #[link(name = "foo", kind = "raw-dylib")] extern "stdcall" { fn f(x: i32); diff --git a/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr b/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr index d8a2a6af9c1..f8265ae6919 100644 --- a/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr +++ b/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr @@ -1,5 +1,5 @@ error: ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture - --> $DIR/unsupported-abi.rs:8:5 + --> $DIR/unsupported-abi.rs:6:5 | LL | fn f(x: i32); | ^^^^^^^^^^^^^ |
