-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nice_name
should be used in diagnostics of extern crate icky_name as nice_name
#121168
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
anforowicz
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Feb 15, 2024
Is this something worth fixing? Is the original crate name worth preferring over the aliased name in some scenarios? |
BTW: I also want to note/highlight that I am not able to repro the problem without using
|
/cc @danakj |
jieyouxu
added
the
D-papercut
Diagnostics: An error or lint that needs small tweaks.
label
Feb 15, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 27, 2024
…, r=davidtwco Fix issues in suggesting importing extern crate paths Fixes rust-lang#121168 r? `@petrochenkov`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 27, 2024
…, r=davidtwco Fix issues in suggesting importing extern crate paths Fixes rust-lang#121168 r? ``@petrochenkov``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 27, 2024
…, r=davidtwco Fix issues in suggesting importing extern crate paths Fixes rust-lang#121168 r? ```@petrochenkov```
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Feb 28, 2024
…, r=davidtwco Fix issues in suggesting importing extern crate paths Fixes rust-lang#121168 r? `@petrochenkov`
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 28, 2024
Rollup merge of rust-lang#121226 - chenyukang:yukang-fix-import-alias, r=davidtwco Fix issues in suggesting importing extern crate paths Fixes rust-lang#121168 r? ``@petrochenkov``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
Some build environments (e.g. Chromium (*), Bazel) may generate crate names based on names of build targets. While this results in globally-unique (**) crate names, it results in long and quite unwieldy crate names. Both Chromium and Blaze provide a macro to help working with such crate names:
The macro usage above expands to something like:
Unfortunately, it seems that some
rustc
diagnostics keep referring to the long and unwieldy name.(*) see
chromium_prelude/import_attribute.rs
andchromium/build/rust/rust_static_library.gni
(**) globally-unique crate names = within a given build tree
Other cases
No response
Rust Version
Anything else?
More detailed repro can be found below:
The text was updated successfully, but these errors were encountered: