about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-12 15:39:48 +0000
committerbors <bors@rust-lang.org>2025-02-12 15:39:48 +0000
commitced8e650cddbafad92094b2c89dee97b8a807d9c (patch)
tree0edf13ef4bc9ac6037578f94162a0cee2fa0d17d
parent552a959051cebf8f88a8f558399baf733bec9ce0 (diff)
parentd5f645647f25fcc259a1b78cabe38cc23dc06d3b (diff)
downloadrust-ced8e650cddbafad92094b2c89dee97b8a807d9c.tar.gz
rust-ced8e650cddbafad92094b2c89dee97b8a807d9c.zip
Auto merge of #135336 - tshepang:patch-5, r=jieyouxu
clarify and document needs-dynamic-linking

try-job: test-various
-rw-r--r--src/doc/rustc-dev-guide/src/tests/directives.md2
-rw-r--r--tests/ui/invalid-compile-flags/crate-type-flag.rs10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/doc/rustc-dev-guide/src/tests/directives.md b/src/doc/rustc-dev-guide/src/tests/directives.md
index 9e0f8f9c279..b6209bcb2d8 100644
--- a/src/doc/rustc-dev-guide/src/tests/directives.md
+++ b/src/doc/rustc-dev-guide/src/tests/directives.md
@@ -192,6 +192,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
+  (which is orthogonal to it being unable to create `dylib` and `cdylib` crate types)
 
 The following directives will check LLVM support:
 
diff --git a/tests/ui/invalid-compile-flags/crate-type-flag.rs b/tests/ui/invalid-compile-flags/crate-type-flag.rs
index bc7a0bc46c3..07d853b3307 100644
--- a/tests/ui/invalid-compile-flags/crate-type-flag.rs
+++ b/tests/ui/invalid-compile-flags/crate-type-flag.rs
@@ -17,12 +17,12 @@
 //@[staticlib] compile-flags: --crate-type=staticlib
 //@[staticlib] check-pass
 
-//@[dylib] ignore-musl (dylibs are not supported)
-//@[dylib] ignore-wasm (dylibs are not supported)
+//@[dylib] ignore-musl (dylib is supported, but musl libc is statically linked by default)
+//@[dylib] ignore-wasm (dylib is not supported)
 //@[dylib] compile-flags: --crate-type=dylib
 //@[dylib] check-pass
 
-//@[cdylib] ignore-musl (cdylibs are not supported)
+//@[cdylib] ignore-musl (cdylib is supported, but musl libc is statically linked by default)
 //@[cdylib] compile-flags: --crate-type=cdylib
 //@[cdylib] check-pass
 
@@ -39,9 +39,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.