Skip to content

Commit

Permalink
Rollup merge of rust-lang#130860 - tmandry:fix-directives, r=compiler…
Browse files Browse the repository at this point in the history
…-errors

Fix directives for lint-non-snake-case-crate

This test fails on targets without unwinding or with `--target-rustcflags=-Cpanic=abort` because the proc macro was compiled as the target, not the host. Some targets were explicitly disabled to pass CI, but these directives are more general.

* `needs-dynamic-linking` is self explanatory
* `force-host` for proc macros
* `no-prefer-dynamic` is apparently also used for proc macros

Note that `needs-unwind` can also be useful for situations other than proc macros where unwinding is necessary.

r? `@jieyouxu`
  • Loading branch information
matthiaskrgr authored Sep 26, 2024
2 parents 31f854f + c5925ef commit 2a3de63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ui/lint/non-snake-case/lint-non-snake-case-crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

// But should fire on non-binary crates.

//@[cdylib_] ignore-musl (dylibs are not supported)
//@[dylib_] ignore-musl (dylibs are not supported)
//@[dylib_] ignore-wasm (dylib is not supported)
//@[proc_macro_] ignore-wasm (dylib is not supported)
//@[cdylib_] needs-dynamic-linking
//@[dylib_] needs-dynamic-linking
//@[proc_macro_] force-host
//@[proc_macro_] no-prefer-dynamic

//@[cdylib_] compile-flags: --crate-type=cdylib
//@[dylib_] compile-flags: --crate-type=dylib
Expand Down

0 comments on commit 2a3de63

Please sign in to comment.