diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-04-05 00:24:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-05 00:24:33 +0200 |
| commit | 3c2e4ff525a710987c4e01805edf051740cb022b (patch) | |
| tree | 5d5d3047093a747e9f411de20de4227ec8c0cf78 /src/test | |
| parent | fbe89e20e83bd726b34ee0462ac96f2515f5945d (diff) | |
| parent | 5839bff0bac6063147c8905388713a787577208f (diff) | |
Rollup merge of #83820 - petrochenkov:nolinkargs, r=nagisa
Remove attribute `#[link_args]` Closes https://github.com/rust-lang/rust/issues/29596 The attribute could always be replaced with `-C link-arg`, but cargo didn't provide a reasonable way to pass such flags to rustc. Now cargo supports `cargo:rustc-link-arg*` directives in build scripts (https://doc.rust-lang.org/cargo/reference/unstable.html#extra-link-arg), so this attribute can be removed.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/incremental/hashes/extern_mods.rs | 16 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/link-args-order/Makefile | 2 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/link-args-order/empty.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-link_args.rs | 17 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-link_args.stderr | 30 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-15487.rs | 13 | ||||
| -rw-r--r-- | src/test/ui/linkage-attr/invalid-link-args.rs | 14 |
7 files changed, 1 insertions, 96 deletions
diff --git a/src/test/incremental/hashes/extern_mods.rs b/src/test/incremental/hashes/extern_mods.rs index 7a923134331..93e70d3792c 100644 --- a/src/test/incremental/hashes/extern_mods.rs +++ b/src/test/incremental/hashes/extern_mods.rs @@ -12,7 +12,6 @@ #![allow(warnings)] #![feature(rustc_attrs)] #![feature(unboxed_closures)] -#![feature(link_args)] #![crate_type = "rlib"] // Change function name -------------------------------------------------------- @@ -146,21 +145,6 @@ extern "C" { pub fn add_function2(); } -// Change link-args ------------------------------------------------------------ -#[cfg(cfail1)] -#[link_args = "-foo -bar"] -extern "C" { - pub fn change_link_args(c: i32); -} - -#[cfg(not(cfail1))] -#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")] -#[rustc_clean(cfg = "cfail3")] -#[link_args = "-foo -bar -baz"] -extern "C" { - pub fn change_link_args(c: i32); -} - // Change link-name ------------------------------------------------------------ #[cfg(cfail1)] #[link(name = "foo")] diff --git a/src/test/run-make-fulldeps/link-args-order/Makefile b/src/test/run-make-fulldeps/link-args-order/Makefile index 98c1e0eac3b..f94e882ccb6 100644 --- a/src/test/run-make-fulldeps/link-args-order/Makefile +++ b/src/test/run-make-fulldeps/link-args-order/Makefile @@ -6,5 +6,5 @@ RUSTC_FLAGS = -C linker-flavor=ld -C link-arg=a -C link-args="b c" -C link-args= RUSTC_FLAGS_PRE = -C linker-flavor=ld -Z pre-link-arg=a -Z pre-link-args="b c" -Z pre-link-args="d e" -Z pre-link-arg=f all: - $(RUSTC) $(RUSTC_FLAGS) empty.rs 2>&1 | $(CGREP) '"a" "b" "c" "d" "e" "f" "g"' + $(RUSTC) $(RUSTC_FLAGS) empty.rs 2>&1 | $(CGREP) '"a" "b" "c" "d" "e" "f"' $(RUSTC) $(RUSTC_FLAGS_PRE) empty.rs 2>&1 | $(CGREP) '"a" "b" "c" "d" "e" "f"' diff --git a/src/test/run-make-fulldeps/link-args-order/empty.rs b/src/test/run-make-fulldeps/link-args-order/empty.rs index 2439171004b..f328e4d9d04 100644 --- a/src/test/run-make-fulldeps/link-args-order/empty.rs +++ b/src/test/run-make-fulldeps/link-args-order/empty.rs @@ -1,6 +1 @@ -#![feature(link_args)] - -#[link_args = "g"] -extern "C" {} - fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-link_args.rs b/src/test/ui/feature-gates/feature-gate-link_args.rs deleted file mode 100644 index e1c651f46fb..00000000000 --- a/src/test/ui/feature-gates/feature-gate-link_args.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Test that `#[link_args]` attribute is gated by `link_args` -// feature gate, both when it occurs where expected (atop -// `extern { }` blocks) and where unexpected. - -// sidestep warning (which is correct, but misleading for -// purposes of this test) -#![allow(unused_attributes)] -#![link_args = "-l unexpected_use_as_inner_attr_on_mod"] -//~^ ERROR the `link_args` attribute is experimental - -#[link_args = "-l expected_use_case"] -//~^ ERROR the `link_args` attribute is experimental -extern "C" {} - -#[link_args = "-l unexected_use_on_non_extern_item"] -//~^ ERROR: the `link_args` attribute is experimental -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-link_args.stderr b/src/test/ui/feature-gates/feature-gate-link_args.stderr deleted file mode 100644 index ae4918f5c9f..00000000000 --- a/src/test/ui/feature-gates/feature-gate-link_args.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0658]: the `link_args` attribute is experimental and not portable across platforms, it is recommended to use `#[link(name = "foo")] instead - --> $DIR/feature-gate-link_args.rs:11:1 - | -LL | #[link_args = "-l expected_use_case"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #29596 <https://github.com/rust-lang/rust/issues/29596> for more information - = help: add `#![feature(link_args)]` to the crate attributes to enable - -error[E0658]: the `link_args` attribute is experimental and not portable across platforms, it is recommended to use `#[link(name = "foo")] instead - --> $DIR/feature-gate-link_args.rs:15:1 - | -LL | #[link_args = "-l unexected_use_on_non_extern_item"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #29596 <https://github.com/rust-lang/rust/issues/29596> for more information - = help: add `#![feature(link_args)]` to the crate attributes to enable - -error[E0658]: the `link_args` attribute is experimental and not portable across platforms, it is recommended to use `#[link(name = "foo")] instead - --> $DIR/feature-gate-link_args.rs:8:1 - | -LL | #![link_args = "-l unexpected_use_as_inner_attr_on_mod"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #29596 <https://github.com/rust-lang/rust/issues/29596> for more information - = help: add `#![feature(link_args)]` to the crate attributes to enable - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issues/issue-15487.rs b/src/test/ui/issues/issue-15487.rs deleted file mode 100644 index 34ac53be5be..00000000000 --- a/src/test/ui/issues/issue-15487.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass -#![allow(unused_attributes)] -// ignore-windows -// ignore-wasm32-bare no libs to link -// ignore-sgx no libs to link -#![feature(link_args)] - -#[link_args = "-lc -lm"] -#[link_args = " -lc"] -#[link_args = "-lc "] -extern "C" {} - -fn main() {} diff --git a/src/test/ui/linkage-attr/invalid-link-args.rs b/src/test/ui/linkage-attr/invalid-link-args.rs deleted file mode 100644 index 7418691d014..00000000000 --- a/src/test/ui/linkage-attr/invalid-link-args.rs +++ /dev/null @@ -1,14 +0,0 @@ -// build-fail -// dont-check-compiler-stderr -// ignore-msvc due to linker-flavor=ld -// error-pattern:aFdEfSeVEEE -// compile-flags: -C linker-flavor=ld - -/* Make sure invalid link_args are printed to stderr. */ - -#![feature(link_args)] - -#[link_args = "aFdEfSeVEEE"] -extern "C" {} - -fn main() {} |
