Skip to content

Commit

Permalink
Modify some feature-gate tests to also check command-line handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Nov 18, 2024
1 parent 5ec7d6e commit 9d6b228
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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")]
| ^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: unknown linking modifier `link-arg`, expected one of: bundle, verbatim, whole-archive, as-needed

6 changes: 5 additions & 1 deletion tests/ui/feature-gates/feature-gate-link-arg-attribute.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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")]
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: linking modifier `as-needed` is unstable and only accepted on the nightly compiler

Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 9d6b228

Please sign in to comment.