Skip to content

Commit

Permalink
Auto merge of #135336 - tshepang:patch-5, r=jieyouxu
Browse files Browse the repository at this point in the history
use target feature and not target name

Also, modify 1 test to test cli functionality in all targets
  • Loading branch information
bors committed Jan 12, 2025
2 parents 12445e0 + 3e9cbc1 commit 8e4ea5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/doc/rustc-dev-guide/src/tests/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ settings:
specified atomic widths, e.g. the test with `//@ needs-target-has-atomic: 8,
16, ptr` will only run if it supports the comma-separated list of atomic
widths.
- `needs-dynamic-linking` - ignores if target does not support dynamic linking,
meaning it cannot create `dylib` and `cdylib` crates types

The following directives will check LLVM support:

Expand Down
9 changes: 3 additions & 6 deletions tests/ui/invalid-compile-flags/crate-type-flag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
//@[staticlib] compile-flags: --crate-type=staticlib
//@[staticlib] check-pass

//@[dylib] ignore-musl (dylibs are not supported)
//@[dylib] ignore-wasm (dylibs are not supported)
//@[dylib] needs-dynamic-linking
//@[dylib] compile-flags: --crate-type=dylib
//@[dylib] check-pass

//@[cdylib] ignore-musl (cdylibs are not supported)
//@[cdylib] needs-dynamic-linking
//@[cdylib] compile-flags: --crate-type=cdylib
//@[cdylib] check-pass

Expand All @@ -39,9 +38,7 @@
//@[multivalue] compile-flags: --crate-type=lib,rlib,staticlib
//@[multivalue] check-pass

//@[multivalue_combined] ignore-musl (dylibs are not supported)
//@[multivalue_combined] ignore-wasm (dylibs are not supported)
//@[multivalue_combined] compile-flags: --crate-type=lib,rlib,staticlib --crate-type=dylib
//@[multivalue_combined] compile-flags: --crate-type=lib,rlib --crate-type=staticlib
//@[multivalue_combined] check-pass

// `proc-macro` is accepted, but `proc_macro` is not.
Expand Down

0 comments on commit 8e4ea5e

Please sign in to comment.