-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unrelated compiler errors affects inferring a type #95648
Labels
C-bug
Category: This is a bug.
Comments
This was referenced Apr 7, 2022
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Apr 7, 2022
Don't report numeric inference ambiguity when we have previous errors Fixes rust-lang#95648
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Apr 8, 2022
Don't report numeric inference ambiguity when we have previous errors Fixes rust-lang#95648
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Apr 8, 2022
Don't report numeric inference ambiguity when we have previous errors Fixes rust-lang#95648
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Apr 8, 2022
Don't report numeric inference ambiguity when we have previous errors Fixes rust-lang#95648
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Apr 9, 2022
Don't report numeric inference ambiguity when we have previous errors Fixes rust-lang#95648
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I run this code (via
cargo run
):I get the output I expected (i.e., a single line of output that says "My number is 42").
However, if I run this code (via the same
cargo run
with no other changes):I get two compiler errors. The first error indicates that
foo
is not in scope - this makes sense, I have not definedfoo
anywhere. However, the second error indicates (provided below) does not make sense:It appears that, when there are no other compiler issues, the compiler can infer a type for
42
just fine. However, as soon as any other compiler issue appears, it loses the ability to infer type. That doesn't make sense to me - the ability to infer type should be unrelated to any other compiler errors present.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: