-
Notifications
You must be signed in to change notification settings - Fork 13.3k
nice_name
should be used in diagnostics of extern crate icky_name as nice_name
#121168
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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
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 |
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``
# for free
to join this conversation on GitHub.
Already have an account?
# 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: