Skip to content

Commit

Permalink
Rollup merge of #135225 - erickt:fix-test, r=jieyouxu
Browse files Browse the repository at this point in the history
Explicitly build proc macro test with panic=unwind

Fuchsia explicitly builds rust and all rust targets with `-C panic=abort` to minimize code generation size. However, when compiling a proc-macro with this setting it can cause a warning to be emitted, which breaks `tests/ui/invalid-compile-flags/crate-type-flag.rs`. This hasn't been a problem in the past for us since we compile our proc macros on host, rather than inside Fuchsia.

This attempts to fix the issue by explicitly requiring that we're using the unwinder when compiling this test to avoid the warning being emitted.

Fixes #135223
  • Loading branch information
matthiaskrgr authored Jan 9, 2025
2 parents a9614a5 + 4994296 commit 84910fc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ rm tests/ui/mir/mir_raw_fat_ptr.rs # same
rm tests/ui/consts/issue-33537.rs # same
rm tests/ui/consts/const-mut-refs-crate.rs # same
rm tests/ui/abi/large-byval-align.rs # exceeds implementation limit of Cranelift
rm tests/ui/invalid-compile-flags/crate-type-flag.rs # warning about proc-macros and panic=abort

# doesn't work due to the way the rustc test suite is invoked.
# should work when using ./x.py test the way it is intended
Expand Down
1 change: 1 addition & 0 deletions tests/ui/invalid-compile-flags/crate-type-flag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
//@[bin] check-pass

//@[proc_dash_macro] ignore-wasm (proc-macro is not supported)
//@[proc_dash_macro] needs-unwind (panic=abort causes warning to be emitted)
//@[proc_dash_macro] compile-flags: --crate-type=proc-macro
//@[proc_dash_macro] check-pass

Expand Down

0 comments on commit 84910fc

Please sign in to comment.