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

Error message on Windows missing "required by" hint #66860

Closed
Cerber-Ursi opened this issue Nov 29, 2019 · 3 comments
Closed

Error message on Windows missing "required by" hint #66860

Cerber-Ursi opened this issue Nov 29, 2019 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Cerber-Ursi
Copy link
Contributor

Cerber-Ursi commented Nov 29, 2019

I've found some kind of regression in error reporting. In short, the same code compiled by nightly-2019-11-25 yields different error messages on Linux (Ubuntu) and Windows. On Ubuntu:

error[E0283]: type annotations needed: cannot resolve `_: error_mismatch::Trait`
 --> tests/fail.rs:4:13
  |
4 |     let _ = collect();
  |             ^^^^^^^
  | 
 ::: /home/runner/work/test-error-mismatch/test-error-mismatch/src/lib.rs:9:19
  |
9 | pub fn collect<T: Trait>() -> T {
  |                   ----- required by this bound in `error_mismatch::collect`

On Windows:

error[E0283]: type annotations needed: cannot resolve `_: error_mismatch::Trait`
 --> tests\fail.rs:4:13
  |
4 |     let _ = collect();
  |             ^^^^^^^

Reproduction is here: https://github.com/Cerber-Ursi/test-error-mismatch/runs/325632093 (tests are failing intentionally - in real project this is handled by trybuild).

@jonas-schievink jonas-schievink added A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. labels Nov 29, 2019
@estebank
Copy link
Contributor

estebank commented Dec 6, 2019

CC #53081

@estebank estebank added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 30, 2020
@mibac138
Copy link
Contributor

mibac138 commented May 5, 2020

I can reproduce this on 1.43, however I can't on nightly. I think this was fixed along with #53081 in #70642?

1.43 output

error[E0283]: type annotations needed
 --> tests\fail.rs:4:13
  |
4 |     let _ = collect();
  |         -   ^^^^^^^
  |         |   |
  |         |   cannot infer type for type parameter `T` declared on the function `collect`
  |         |   help: consider specifying the type argument in the function call: `collect::<T>`
  |         consider giving this pattern a type
  |
  = note: cannot resolve `_: error_mismatch::Trait`

nightly 2020-04-27 output

error[E0283]: type annotations needed
 --> tests\fail.rs:4:13
4 |     let _ = collect();
  |         -   ^^^^^^^ cannot infer type for type parameter `T` declared on the function `collect`
  |         |
  |         consider giving this pattern a type
 ::: C:\Users\mibac\IdeaProjects\test-error-mismatch\src\lib.rs:9:19
  |
9 | pub fn collect<T: Trait>() -> T {
  |                   ----- required by this bound in `error_mismatch::collect`
  = note: cannot satisfy `_: error_mismatch::Trait`
help: consider specifying the type argument in the function call
  |
4 |     let _ = collect::<T>();
  |                    ^^^^^

@estebank
Copy link
Contributor

estebank commented May 5, 2020

I think that is correct @mibac138.

@estebank estebank closed this as completed May 5, 2020
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 C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants