Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add typo suggestion for a misspelt Cargo environment variable#148559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
chenyukang wants to merge1 commit intorust-lang:master
base:master
Choose a base branch
Loading
fromchenyukang:yukang-fix-148439-env

Conversation

@chenyukang
Copy link
Member

@chenyukangchenyukang commentedNov 6, 2025
edited by rustbot
Loading

Fixes#148439

@rustbotrustbot added S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. T-compilerRelevant to the compiler team, which will review and decide on the PR/issue. labelsNov 6, 2025
@rustbot
Copy link
Collaborator

r?@fee1-dead

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

User? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@chenyukangchenyukangforce-pushed theyukang-fix-148439-env branch 2 times, most recently from48c2fbb to1f8b6daCompareNovember 6, 2025 04:14
Comment on lines +187 to +189
constKNOWN_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
Copy link
Member

Choose a reason for hiding this comment

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

Discussion (non-blocking): I have two reservations about making this suggestion:

  1. Wouldn't this depend on the specific cargo version?
  2. Basically, what I was trying to get at, is thatin principle I feel likerustc should not make assumptions aboutcargo (that is,rustc should not "know" aboutcargo's existence), becausecargo isn't the only way to invokerustc.

I guess I could be convinced by "well, most usersdo build withcargo", so don't consider this a hard-blocking concern.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

  1. I'm not sure, there is a similar list for this inrust-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.
  2. I agreerustc should 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.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, seems alright, was just curious to hear what you think.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@UrgauUrgauUrgau left review comments

@jieyouxujieyouxujieyouxu left review comments

Assignees

@fee1-deadfee1-dead

Labels

S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Misleading suggestion when using env!() on a misspelt Cargo environment variable

6 participants

@chenyukang@rustbot@rust-log-analyzer@Urgau@jieyouxu@fee1-dead

[8]ページ先頭

©2009-2025 Movatter.jp