From 72d2db7bf46f565f4ee5cc73d65b4f4906e7420e Mon Sep 17 00:00:00 2001 From: clubby789 Date: Wed, 27 Nov 2024 17:21:59 +0000 Subject: Implement lint against `Symbol::intern` on a string literal --- src/bootstrap/src/core/builder/cargo.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/bootstrap') diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index 0688a1d6892..13f351de20e 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -1030,6 +1030,15 @@ impl Builder<'_> { if mode == Mode::Rustc { rustflags.arg("-Wrustc::internal"); + // cfg(bootstrap) - remove this check when lint is in bootstrap compiler + if stage != 0 { + // Lint is allow by default so downstream tools don't get a lit + // they can do nothing about + // We shouldn't be preinterning symbols used by tests + if cmd_kind != Kind::Test { + 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"); -- cgit 1.4.1-3-g733a5