Rollup merge of #134173 - onur-ozkan:allow-symbol-intern-string-literal, r=jieyouxu

allow `symbol_intern_string_literal` lint in test modules

Since #133545, `x check compiler --stage 1` no longer works because compiler test modules trigger `symbol_intern_string_literal` lint errors. Bootstrap shouldn't control when to ignore or enable this lint in the compiler tree (using `Kind != Test` was ineffective for obvious reasons).

Also, conditionally adding this rustflag invalidates the build cache between `x test` and other commands.

This PR removes the `Kind` check from bootstrap and handles it directly in the compiler tree in a more natural way.
This commit is contained in:
Matthias Krüger 2024-12-12 08:07:03 +01:00 committed by GitHub
commit 958fc08e68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,5 @@
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
use std::assert_matches::assert_matches;
use std::io::prelude::*;
use std::iter::Peekable;

View file

@ -1,3 +1,5 @@
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
use rustc_ast::token::{self, IdentIsRaw};
use rustc_ast::tokenstream::{TokenStream, TokenTree};
use rustc_span::{BytePos, Span, Symbol, create_default_session_globals_then};