diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-07-16 18:09:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-16 18:09:10 +0200 |
| commit | 73028fe48320766d5dd931394c2d7b17bed14646 (patch) | |
| tree | 2cbed28bdaca67ac56f013fc05c2fd8614920264 /src/bootstrap | |
| parent | 7409a5281de87e3e1f63fe3c05346fe8431147c4 (diff) | |
| parent | 28503d69ac204ff208d115aea30dc09d6fca8728 (diff) | |
| download | rust-73028fe48320766d5dd931394c2d7b17bed14646.tar.gz rust-73028fe48320766d5dd931394c2d7b17bed14646.zip | |
Rollup merge of #127730 - compiler-errors:ed-2024-unsafe, r=petrochenkov
Fix and enforce `unsafe_op_in_unsafe_fn` in compiler
In preparation for edition 2024, this PR previews the fallout of enabling the `unsafe_op_in_unsafe_fn` lint in the compiler, since it's defaulting to warn in the new edition (#112038).
The major annoyance comes primarily from the `rustc_codegen_llvm` module, where there's a ton of unsafe calls. I tended to wrap individual calls to unsafe fns in `unsafe {}`, but there a handful of places I chose to just wrap several calls in an `unsafe {}` block just because it would've been excessive to wrap each call individually.
This doesn't enable the lint for the standard library, since I'm not totally certain what T-libs prefers w/ this lint.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/builder.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index ebd62bb032f..71009d56366 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -2001,6 +2001,7 @@ impl<'a> Builder<'a> { // FIXME(edition_2024): Change this to `-Wrust_2024_idioms` when all // of the individual lints are satisfied. rustflags.arg("-Wkeyword_idents_2024"); + rustflags.arg("-Wunsafe_op_in_unsafe_fn"); } if self.config.rust_frame_pointers { |
