Skip to content

lint on Ident::from_str_and_span taking a string literal - #163429

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cyrgani:preintern-lint
Sep 28, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cyrgani:preintern-lint

Conversation

@cyrgani

@cyrgani cyrgani commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

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 Idents with Symbols.

This function is a wrapper around `Symbol::intern`, which is already checked by the `rustc::symbol_intern_string_literal` lint.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 28, 2026
@rustbot

rustbot commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

r? @folkertdev

rustbot has assigned @folkertdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 19 candidates

@rust-log-analyzer

This comment was marked as resolved.

@folkertdev

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9c7ce01 has been approved by folkertdev

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 28, 2026
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.
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
rust-bors Bot merged commit 52519b5 into rust-lang:main Sep 28, 2026
21 of 26 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Sep 28, 2026
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.
@cyrgani
cyrgani deleted the preintern-lint branch September 28, 2026 19:11
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants