Skip to content

regression: NonZero is ambiguous #121604

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

Closed
Mark-Simulacrum opened this issue Feb 25, 2024 · 5 comments
Closed

regression: NonZero is ambiguous #121604

Mark-Simulacrum opened this issue Feb 25, 2024 · 5 comments
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Feb 25, 2024

My guess is this will be closed as expected, but should be a conscious decision.

[INFO] [stdout] error[E0659]: `NonZero` is ambiguous
[INFO] [stdout]    --> src/impls.rs:723:14
[INFO] [stdout]     |
[INFO] [stdout] 723 |         impl NonZero for $nzty {
[INFO] [stdout]     |              ^^^^^^^ ambiguous name
[INFO] [stdout]     |
[INFO] [stdout]     = note: ambiguous because of multiple glob imports of a name in the same module
[INFO] [stdout] note: `NonZero` could refer to the trait imported here
[INFO] [stdout]    --> src/impls.rs:1:5
[INFO] [stdout]     |
[INFO] [stdout] 1   | use crate::*;
[INFO] [stdout]     |     ^^^^^^^^
[INFO] [stdout]     = help: consider adding an explicit import of `NonZero` to disambiguate
[INFO] [stdout] note: `NonZero` could also refer to the struct imported here
[INFO] [stdout]    --> src/impls.rs:2:5
[INFO] [stdout]     |
[INFO] [stdout] 2   | use core::num::*;
[INFO] [stdout]     |     ^^^^^^^^^^^^
[INFO] [stdout]     = help: consider adding an explicit import of `NonZero` to disambiguate
@Mark-Simulacrum Mark-Simulacrum added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Feb 25, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.77.0 milestone Feb 25, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 25, 2024
@Mark-Simulacrum Mark-Simulacrum changed the title regression: NonZero is ambigous regression: NonZero is ambiguous Feb 25, 2024
@dtolnay
Copy link
Member

dtolnay commented Feb 26, 2024

Relevant documentation: https://doc.rust-lang.org/1.76.0/cargo/reference/semver.html#item-new

"glob imports are a known forwards-compatibility hazard. Glob imports of items from external crates should be avoided."

Normally, unless the breakage is extraordinarily disruptive (affecting a foundational library that is unmaintained but still widely-used) we move on and remind the author not to use glob imports.

@apiraino
Copy link
Contributor

Removing prioritization since affected crates are taking care of this ([Zulip discussion](The authors of an affected crate were mentioned and already updated their code (in zommiommy/common_traits@ab8e504) so I think this is under control (so my understanding).

@rustbot label -I-prioritize

@rustbot rustbot removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 26, 2024
@jieyouxu
Copy link
Member

Can this issue be closed if it's intentional breakage?

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 26, 2024
@apiraino
Copy link
Contributor

Can this issue be closed if it's intentional breakage?

Speaking for me personally: yes. But 🙂

I'm not sure how crater runs regressions are treated and if T-infra prefers to go through them again at a later stage and decide for a close.

@zommiommy
Copy link
Contributor

Yeah, we handled the change so it's absolutely not a priority, nor a problem and thus it can be closed.

Then, we'll deal with the glob imports, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants