Skip to content

new-school type mismatch label can be overly long #34905

Closed
@arielb1

Description

@arielb1

Meta

$ rustc -V
rustc 1.12.0-dev (d5b9850d7 2016-07-16)

STR

fn main() {
    let y = Some(Err(()));
    let x: Option<Option<_>> = y;
}

Result

$ RUST_NEW_ERROR_FORMAT=y rustc fail.rs
error: mismatched types [--explain E0308]
 --> fail.rs:3:32
  |>
3 |>     let x: Option<Option<_>> = y;
  |>                                ^ expected enum `std::option::Option`, found enum `std::result::Result`
note: expected type `std::option::Option<std::option::Option<_>>`
note:    found type `std::option::Option<std::result::Result<_, ()>>`
error: aborting due to previous error

Observe the deeply nested label containing both "expected" and "found".

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.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