Skip to content
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

[regression] ambiguous local variable #71765

Closed
Mark-Simulacrum opened this issue May 1, 2020 · 2 comments · Fixed by #71846
Closed

[regression] ambiguous local variable #71765

Mark-Simulacrum opened this issue May 1, 2020 · 2 comments · Fixed by #71846
Labels
A-resolve Area: Name resolution C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

For example:

INFO] [stderr] error[E0659]: `time` is ambiguous (glob import vs glob import in the same module)
[INFO] [stderr]    --> src/main.rs:257:13
[INFO] [stderr]     |
[INFO] [stderr] 257 |     let mut time = Local::now();
[INFO] [stderr]     |             ^^^^ ambiguous name
[INFO] [stderr]     |
[INFO] [stderr] note: `time` could refer to the function imported here
[INFO] [stderr]    --> src/main.rs:4:5
[INFO] [stderr]     |
[INFO] [stderr] 4   | use libc::*;
[INFO] [stderr]     |     ^^^^^^^
[INFO] [stderr]     = help: consider adding an explicit import of `time` to disambiguate
[INFO] [stderr] note: `time` could also refer to the function imported here
[INFO] [stderr]    --> src/main.rs:11:5
[INFO] [stderr]     |
[INFO] [stderr] 11  | use xcb_bindings::*;
[INFO] [stderr]     |     ^^^^^^^^^^^^^^^
[INFO] [stderr]     = help: consider adding an explicit import of `time` to disambiguate
[INFO] [stderr] 

cc @petrochenkov

@Mark-Simulacrum Mark-Simulacrum added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 1, 2020
@Mark-Simulacrum Mark-Simulacrum added this to the 1.44 milestone May 1, 2020
@petrochenkov petrochenkov self-assigned this May 1, 2020
@jonas-schievink jonas-schievink added C-bug Category: This is a bug. A-resolve Area: Name resolution labels May 1, 2020
@petrochenkov
Copy link
Contributor

This is a regression from #70006.

#70006 produced an ambiguity error even if the binding is syntactically unambiguous (e.g. mut time like in the example above) for some future-compatibility reasons (#33118 (comment)), but it can be easily tweaked to not produce it because backward-compatibility is more important.

@petrochenkov
Copy link
Contributor

Fixed in #71846.

@petrochenkov petrochenkov removed their assignment May 3, 2020
@bors bors closed this as completed in de27cd7 May 5, 2020
@wesleywiser wesleywiser added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants