Allow (but don't require) #[unsafe(naked)] so that compiler-builtins can upgrade to it by folkertdev · Pull Request #139797 · rust-lang/rust (original) (raw)

tracking issue: #138997

Per #134213 (comment), we want to make the #[naked] attribute an unsafe attribute. Making that change runs into a cyclic dependency with compiler-builtins which uses #[naked], where rustc needs an updated compiler-builtins and vice versa.

So based on #139753 and #t-compiler/help > updating `compiler-builtins` and `rustc`, this PR allows, but does not require #[unsafe(naked)], and makes that change for some of the tests to check that both #[naked] and #[unsafe(naked)] are accepted.

Then we can upgrade and synchronize compiler-builtins, and then make #[naked] (without unsafe) invalid.

r? @traviscross (or someone from t-compiler if you're faster and this look allright)