Skip to content

allow symbol_intern_string_literal lint in test modules #134173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/rustc_ast/src/util/comments/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]

use rustc_span::create_default_session_globals_then;

use super::*;
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_hir/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]

use rustc_data_structures::stable_hasher::Hash64;
use rustc_span::def_id::{DefPathHash, StableCrateId};
use rustc_span::edition::Edition;
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_lint/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]

use rustc_span::{Symbol, create_default_session_globals_then};

use crate::levels::parse_lint_and_tool_name;
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_parse/src/parser/tests.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_parse/src/parser/tokenstream/tests.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_span/src/edit_distance/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]

use super::*;

#[test]
Expand Down
7 changes: 1 addition & 6 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,12 +1035,7 @@ impl Builder<'_> {
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");
}
rustflags.arg("-Drustc::symbol_intern_string_literal");
}
// FIXME(edition_2024): Change this to `-Wrust_2024_idioms` when all
// of the individual lints are satisfied.
Expand Down
Loading