Skip to content

fix(str_to_string): false positive non-str types#16571

Merged
samueltardieu merged 1 commit intorust-lang:masterfrom
nyurik:16569
Feb 19, 2026
Merged

fix(str_to_string): false positive non-str types#16571
samueltardieu merged 1 commit intorust-lang:masterfrom
nyurik:16569

Conversation

@nyurik
Copy link
Copy Markdown
Contributor

@nyurik nyurik commented Feb 15, 2026

Fix #16569 bug introduced in #16512

changelog: [str_to_string]: fix false positive

r? @samueltardieu

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 15, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Feb 15, 2026

r? @dswij

rustbot has assigned @dswij.
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: 7 candidates
  • 7 candidates expanded to 7 candidates
  • Random selection from Jarcho, dswij, llogiq, samueltardieu

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 15, 2026

Lintcheck changes for 1994230

Lint Added Removed Changed
clippy::str_to_string 0 8 10

This comment will be updated if you push new changes

@nyurik
Copy link
Copy Markdown
Contributor Author

nyurik commented Feb 15, 2026

I checked the clippy changes reported in #16571 (comment) - everything seems correct

Jarcho
Jarcho previously requested changes Feb 15, 2026
diag.span_suggestion(expr.span, "try", format!("{snippet}.to_owned()"), applicability);
},
);
} else if let ExprKind::Path(_) = expr.kind
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but this can be if let Res::Def(..) = expr.basic_res()

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 15, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Feb 15, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Feb 15, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Feb 17, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@nyurik nyurik requested a review from Jarcho February 19, 2026 05:06
@nyurik
Copy link
Copy Markdown
Contributor Author

nyurik commented Feb 19, 2026

@samueltardieu I think this can't be auto-merged until @Jarcho approves it?

@samueltardieu
Copy link
Copy Markdown
Member

Looks like this is blocking the merge. Since you've addressed @Jarcho's point about correctness (peel_refs()), I'll merge this so that it gets included in today's repository sync. If we miss it, we'll have to do a beta backport, and those are usually done at the end of the beta cycle, so we'll have the bug present for 6 more weeks and I think it's a serious issue.

@samueltardieu samueltardieu dismissed Jarcho’s stale review February 19, 2026 07:30

Main point addressed, and need to get included in the repo sync.

@samueltardieu samueltardieu added this pull request to the merge queue Feb 19, 2026
Merged via the queue into rust-lang:master with commit a25baf6 Feb 19, 2026
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 19, 2026
@nyurik nyurik deleted the 16569 branch February 19, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FP: clippy::str-to-string suggestion for non-&str type

5 participants