You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bad replacement for unsafe extern block suggestion #126756
error: items in unadorned `extern` blocks cannot have safety qualifiers
--> src/main.rs:4:5
|
3 | extern "C" {
| ---------- help: add unsafe to this `extern` block
4 | unsafe fn foo();
| ^^^^^^^^^^^^^^^^
When the suggestion is applied, the code results in:
#![feature(unsafe_extern_blocks)]{unsafefnfoo();}
Although the suggestion is currently marked MaybeIncorrect, I think it should still provide something that is closer to being correct than to delete it. It also seems like this should be a relatively simple replacement that should support MachineApplicable. Ref:
Activity
traviscross commentedon Jun 25, 2024
cc @spastorino
spastorino commentedon Jun 25, 2024
@chenyukang if you want to take this one, go ahead. Also assigned myself for tracking purposes but I can fix this easily too.
chenyukang commentedon Jun 26, 2024
sorry for the delay, submitted a PR #126973.
Rollup merge of rust-lang#126973 - chenyukang:yukang-fix-126756-unsaf…
Rollup merge of rust-lang#126973 - chenyukang:yukang-fix-126756-unsaf…
Unrolled build for rust-lang#126973
Rollup merge of rust-lang#127921 - spastorino:stabilize-unsafe-extern…
Rollup merge of rust-lang#127921 - spastorino:stabilize-unsafe-extern…
Unrolled build for rust-lang#127921