Add typo suggestion for a misspelt Cargo environment variable#148559
Merged
bors merged 1 commit intorust-lang:masterfrom Nov 7, 2025
Merged
Add typo suggestion for a misspelt Cargo environment variable#148559bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
This comment has been minimized.
This comment has been minimized.
48c2fbb to
1f8b6da
Compare
jieyouxu
reviewed
Nov 6, 2025
Comment on lines
+187
to
+189
| const KNOWN_CARGO_VARS: &[&str] = &[ | ||
| // List of known Cargo environment variables that are set for crates (not build scripts, OUT_DIR etc). | ||
| // See: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates |
Member
There was a problem hiding this comment.
Discussion (non-blocking): I have two reservations about making this suggestion:
- Wouldn't this depend on the specific cargo version?
- Basically, what I was trying to get at, is that in principle I feel like
rustcshould not make assumptions aboutcargo(that is,rustcshould not "know" aboutcargo's existence), becausecargoisn't the only way to invokerustc.
I guess I could be convinced by "well, most users do build with cargo", so don't consider this a hard-blocking concern.
Member
Author
There was a problem hiding this comment.
- I'm not sure, there is a similar list for this in
rust-analyzer: https://github.com/chenyukang/rust/blob/702bf000a0b5062d8b5ced717a26d70919df6ba0/src/tools/rust-analyzer/crates/project-model/src/env.rs#L9-L49 , I guess there is a better and general way to keep it synced. - I agree
rustcshould not knowing details about cargo, I think it's ok since we need to check the prefix withCARGO_of env:
https://github.com/rust-lang/rust/pull/148559/files#diff-0eaa1095d59f2f3d9c015005d15fd8f7cda13121a8404d77b2955fc5fcd40449R213, and it's a note but not code suggestions, it's maybe incorrect for rare scenarios.
Member
There was a problem hiding this comment.
Yeah, seems alright, was just curious to hear what you think.
Urgau
reviewed
Nov 6, 2025
1f8b6da to
ad471f4
Compare
This comment has been minimized.
This comment has been minimized.
Kivooeo
approved these changes
Nov 6, 2025
ad471f4 to
760e803
Compare
This comment has been minimized.
This comment has been minimized.
760e803 to
553d580
Compare
This comment has been minimized.
This comment has been minimized.
553d580 to
3edd25f
Compare
Member
|
@bors r+ |
Collaborator
bors
added a commit
that referenced
this pull request
Nov 7, 2025
Rollup of 12 pull requests Successful merges: - #145768 (Offload device) - #145992 (Stabilize `vec_deque_pop_if`) - #147416 (Early return if span is from expansion so we dont get empty span and ice later on) - #147808 (btree: cleanup difference, intersection, is_subset) - #148520 (style: Use binary literals instead of hex literals in doctests for `highest_one` and `lowest_one`) - #148559 (Add typo suggestion for a misspelt Cargo environment variable) - #148567 (Fix incorrect precedence caused by range expression) - #148570 (Fix mismatched brackets in generated .dir-locals.el) - #148575 (fix dev guide link in rustc_query_system/dep_graph/README.md) - #148578 (core docs: add notes about availability of `Atomic*::from_mut_slice`) - #148603 (Backport 1.91.1 relnotes to main) - #148609 (Sync str::rsplit_once example with str::split_once) r? `@ghost` `@rustbot` modify labels: rollup
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.
Fixes #148439