Skip to content

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

Closed
@Cerber-Ursi

Description

@Cerber-Ursi

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions