Repository navigation
lint on Ident::from_str_and_span taking a string literal - #163429
Merged
Merged
Conversation
This function is a wrapper around `Symbol::intern`, which is already checked by the `rustc::symbol_intern_string_literal` lint.
Collaborator
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 28, 2026
lint on `Ident::from_str_and_span` taking a string literal This function is a wrapper around `Symbol::intern`, which is already checked by the `rustc::symbol_intern_string_literal` lint. This PR extends that lint to check `Ident::from_str_and_span` as well and updates all affected calls in the compiler. I ran into this when trying to replace some `Ident`s with `Symbol`s.
This was referenced Sep 28, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 28, 2026
…uwer Rollup of 7 pull requests Successful merges: - #163327 (remove `MutTy`) - #162910 (Deterministic encoding of `DefPathHashMap`) - #163009 (dont store arbitrary parsed attributes in thir) - #162683 (Use attribute parser for `#[inline()]` attribute check) - #163429 (lint on `Ident::from_str_and_span` taking a string literal) - #163431 (Allow `#[repr(simd)]` with `f16b`) - #163433 (Support also `try-jobs:` to specify custom try jobs)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 28, 2026
Rollup merge of #163429 - cyrgani:preintern-lint, r=folkertdev lint on `Ident::from_str_and_span` taking a string literal This function is a wrapper around `Symbol::intern`, which is already checked by the `rustc::symbol_intern_string_literal` lint. This PR extends that lint to check `Ident::from_str_and_span` as well and updates all affected calls in the compiler. I ran into this when trying to replace some `Ident`s with `Symbol`s.
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Sep 29, 2026
…uwer Rollup of 7 pull requests Successful merges: - rust-lang/rust#163327 (remove `MutTy`) - rust-lang/rust#162910 (Deterministic encoding of `DefPathHashMap`) - rust-lang/rust#163009 (dont store arbitrary parsed attributes in thir) - rust-lang/rust#162683 (Use attribute parser for `#[inline()]` attribute check) - rust-lang/rust#163429 (lint on `Ident::from_str_and_span` taking a string literal) - rust-lang/rust#163431 (Allow `#[repr(simd)]` with `f16b`) - rust-lang/rust#163433 (Support also `try-jobs:` to specify custom try jobs)
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Oct 1, 2026
…nathanBrouwer Rollup of 7 pull requests Successful merges: - rust-lang#163327 (remove `MutTy`) - rust-lang#162910 (Deterministic encoding of `DefPathHashMap`) - rust-lang#163009 (dont store arbitrary parsed attributes in thir) - rust-lang#162683 (Use attribute parser for `#[inline()]` attribute check) - rust-lang#163429 (lint on `Ident::from_str_and_span` taking a string literal) - rust-lang#163431 (Allow `#[repr(simd)]` with `f16b`) - rust-lang#163433 (Support also `try-jobs:` to specify custom try jobs)
AzureXuanVerse
pushed a commit
to AzureXuanVerse/rustfmt
that referenced
this pull request
Oct 7, 2026
…uwer Rollup of 7 pull requests Successful merges: - rust-lang/rust#163327 (remove `MutTy`) - rust-lang/rust#162910 (Deterministic encoding of `DefPathHashMap`) - rust-lang/rust#163009 (dont store arbitrary parsed attributes in thir) - rust-lang/rust#162683 (Use attribute parser for `#[inline()]` attribute check) - rust-lang/rust#163429 (lint on `Ident::from_str_and_span` taking a string literal) - rust-lang/rust#163431 (Allow `#[repr(simd)]` with `f16b`) - rust-lang/rust#163433 (Support also `try-jobs:` to specify custom try jobs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This function is a wrapper around
Symbol::intern, which is already checked by therustc::symbol_intern_string_literallint. This PR extends that lint to checkIdent::from_str_and_spanas well and updates all affected calls in the compiler.I ran into this when trying to replace some
Idents withSymbols.