Don't suggest std:: rustfix paths in #![no_std] crates - #163096
Merged
Merged
Conversation
Collaborator
|
r? @oli-obk rustbot has assigned @oli-obk. Use Why was this reviewer chosen?The reviewer was selected based on:
|
lapla-cogito
commented
Sep 21, 2026
| } | ||
|
|
||
| /// Crate to use for rustfix / diagnostic paths that exist in both `std` and `core`. Returns `None` for `#![no_core]`. | ||
| pub(crate) fn std_or_core(cx: &LateContext<'_>) -> Option<&'static str> { |
Contributor
Author
There was a problem hiding this comment.
Note that Clippy has a function that does the same thing. Once this PR is merged (and after a sync occurs), I think I’ll prepare a patch to make Clippy use the std_or_core from rustc instead.
lapla-cogito
force-pushed
the
std_or_core
branch
from
September 21, 2026 08:57
a2e84f2 to
4e89118
Compare
This comment has been minimized.
This comment has been minimized.
lapla-cogito
force-pushed
the
std_or_core
branch
from
September 21, 2026 09:05
4e89118 to
e883ca3
Compare
oli-obk
requested changes
Sep 23, 2026
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
lapla-cogito
force-pushed
the
std_or_core
branch
from
September 23, 2026 10:54
e883ca3 to
64245e7
Compare
Contributor
Author
|
@rustbot ready |
oli-obk
reviewed
Sep 23, 2026
lapla-cogito
force-pushed
the
std_or_core
branch
from
September 23, 2026 12:43
64245e7 to
e31fb47
Compare
Contributor
|
@bors r+ rollup |
Contributor
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Sep 23, 2026
Don't suggest `std::` rustfix paths in `#![no_std]` crates Several lints emit rustfix suggestions with hard-coded `std::...` paths. In `#![no_std]` crates those paths do not exist of course, so `cargo fix` can leave the crate unable to compile. This is best reviewed per commit.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
Rollup of 8 pull requests Successful merges: - #162976 (fix quadratic naming of duplicate sidebar links) - #163222 (Enable EII tests for cg_gcc) - #162942 (Remove `StashKey::AssociatedTypeSuggestion`) - #163096 (Don't suggest `std::` rustfix paths in `#![no_std]` crates) - #163110 (Mark `std::os::wasip2` with correct doc-cfgs, mark as unstable) - #163185 (properly decrement available_depth on cycles and provisional cache hits) - #163214 (revert r14 register names for arm) - #163226 (miri subtree update)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
Rollup of 8 pull requests Successful merges: - #162976 (fix quadratic naming of duplicate sidebar links) - #163222 (Enable EII tests for cg_gcc) - #162942 (Remove `StashKey::AssociatedTypeSuggestion`) - #163096 (Don't suggest `std::` rustfix paths in `#![no_std]` crates) - #163110 (Mark `std::os::wasip2` with correct doc-cfgs, mark as unstable) - #163185 (properly decrement available_depth on cycles and provisional cache hits) - #163214 (revert r14 register names for arm) - #163226 (miri subtree update)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
…uwer Rollup of 14 pull requests Successful merges: - #162976 (fix quadratic naming of duplicate sidebar links) - #161275 (Refactor `core::cmp::{smallest, largest}` & add `mir-opt` test) - #163143 (cg_llvm: Use fewer FFI calls to check the target CPU's features) - #163188 (Adjust for Arm64EC name mangling when checking for exported symbols) - #163211 (`rustc_builtin_macros` cleanup, part 6) - #161386 (Don't merge distinct impl candidates) - #162942 (Remove `StashKey::AssociatedTypeSuggestion`) - #163096 (Don't suggest `std::` rustfix paths in `#![no_std]` crates) - #163110 (Mark `std::os::wasip2` with correct doc-cfgs, mark as unstable) - #163185 (properly decrement available_depth on cycles and provisional cache hits) - #163214 (revert r14 register names for arm) - #163226 (miri subtree update) - #163228 (Add regression test for trait predicate with escaping bounds) - #163234 (`rustc_dump_symbol_name`: add demangling information as a note instead)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
Rollup merge of #163096 - lapla-cogito:std_or_core, r=oli-obk Don't suggest `std::` rustfix paths in `#![no_std]` crates Several lints emit rustfix suggestions with hard-coded `std::...` paths. In `#![no_std]` crates those paths do not exist of course, so `cargo fix` can leave the crate unable to compile. This is best reviewed per commit.
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Sep 25, 2026
…uwer Rollup of 14 pull requests Successful merges: - rust-lang/rust#162976 (fix quadratic naming of duplicate sidebar links) - rust-lang/rust#161275 (Refactor `core::cmp::{smallest, largest}` & add `mir-opt` test) - rust-lang/rust#163143 (cg_llvm: Use fewer FFI calls to check the target CPU's features) - rust-lang/rust#163188 (Adjust for Arm64EC name mangling when checking for exported symbols) - rust-lang/rust#163211 (`rustc_builtin_macros` cleanup, part 6) - rust-lang/rust#161386 (Don't merge distinct impl candidates) - rust-lang/rust#162942 (Remove `StashKey::AssociatedTypeSuggestion`) - rust-lang/rust#163096 (Don't suggest `std::` rustfix paths in `#![no_std]` crates) - rust-lang/rust#163110 (Mark `std::os::wasip2` with correct doc-cfgs, mark as unstable) - rust-lang/rust#163185 (properly decrement available_depth on cycles and provisional cache hits) - rust-lang/rust#163214 (revert r14 register names for arm) - rust-lang/rust#163226 (miri subtree update) - rust-lang/rust#163228 (Add regression test for trait predicate with escaping bounds) - rust-lang/rust#163234 (`rustc_dump_symbol_name`: add demangling information as a note instead)
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.
Several lints emit rustfix suggestions with hard-coded
std::...paths. In#![no_std]crates those paths do not exist of course, socargo fixcan leave the crate unable to compile.This is best reviewed per commit.