about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-03-10 15:57:22 +0100
committerGitHub <noreply@github.com>2025-03-10 15:57:22 +0100
commit44ec67fffbe9f7846d00cf8a0d457cfc681fea08 (patch)
treeb95874b3300e1579fca2f78dfd200eb55ea1361c /src
parent2abeceeb97f180bec3a331b240160c240285dd89 (diff)
parent063ef18fdc10cb0eb49e1af855e1a8e807e73eed (diff)
Rollup merge of #138306 - jieyouxu:revert-workspace-lints, r=Noratrieb
Revert "Use workspace lints for crates in `compiler/` #138084"

Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). The problem is that the `rustc-src` component doesn't include the root `Cargo.toml` manifest.

This breakage was reported in https://github.com/rust-lang/rust/issues/138304.

This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.

cc `@RalfJung`

r? `@nnethercote` (sorry, I didn't consider this being a thing 💀)
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/builder/cargo.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index 2cbf82ccda3..12dd40d14e9 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -1072,17 +1072,12 @@ impl Builder<'_> {
         }
 
         if mode == Mode::Rustc {
-            // NOTE: rustc-specific lints are specified here. Normal rust lints
-            // are specified in the `[workspace.lints.rust]` section in the
-            // top-level `Cargo.toml`. If/when tool lints are supported by
-            // Cargo, these lints can be move to a `[workspace.lints.rustc]`
-            // section in the top-level `Cargo.toml`.
-            //
-            // NOTE: these flags are added to RUSTFLAGS, which is ignored when
-            // compiling proc macro crates such as `rustc_macros`,
-            // unfortunately.
             rustflags.arg("-Wrustc::internal");
             rustflags.arg("-Drustc::symbol_intern_string_literal");
+            // 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 {