Modify some feature-gate tests to also check command-line handling

This commit is contained in:
Zalathar 2024-11-18 13:38:39 +11:00
parent 5ec7d6eee7
commit 9d6b2283d6
6 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,5 @@
error[E0658]: link kind `link-arg` is unstable
--> $DIR/feature-gate-link-arg-attribute.rs:1:15
--> $DIR/feature-gate-link-arg-attribute.rs:5:15
|
LL | #[link(kind = "link-arg", name = "foo")]
| ^^^^^^^^^^

View File

@ -0,0 +1,2 @@
error: unknown linking modifier `link-arg`, expected one of: bundle, verbatim, whole-archive, as-needed

View File

@ -1,5 +1,9 @@
//@ revisions: in_attr in_flag
//@[in_flag] compile-flags: -l dylib:+link-arg=foo
#[cfg(in_attr)]
#[link(kind = "link-arg", name = "foo")]
//~^ ERROR link kind `link-arg` is unstable
//[in_attr]~^ ERROR link kind `link-arg` is unstable
extern "C" {}
fn main() {}

View File

@ -1,5 +1,5 @@
error[E0658]: linking modifier `as-needed` is unstable
--> $DIR/feature-gate-native_link_modifiers_as_needed.rs:1:50
--> $DIR/feature-gate-native_link_modifiers_as_needed.rs:5:50
|
LL | #[link(name = "foo", kind = "dylib", modifiers = "+as-needed")]
| ^^^^^^^^^^^^

View File

@ -0,0 +1,2 @@
error: linking modifier `as-needed` is unstable and only accepted on the nightly compiler

View File

@ -1,5 +1,9 @@
//@ revisions: in_attr in_flag
//@[in_flag] compile-flags: -l dylib:+as-needed=foo
#[cfg(in_attr)]
#[link(name = "foo", kind = "dylib", modifiers = "+as-needed")]
//~^ ERROR: linking modifier `as-needed` is unstable
//[in_attr]~^ ERROR: linking modifier `as-needed` is unstable
extern "C" {}
fn main() {}