rust/src/test
Esteban Küber 2389830dea Highlight and simplify mismatched types
Shorten mismatched types errors by replacing subtypes that are not
different with `_`, and highlighting only the subtypes that are
different.

Given a file

```rust
struct X<T1, T2> {
    x: T1,
    y: T2,
}

fn foo() -> X<X<String, String>, String> {
    X { x: X {x: "".to_string(), y: 2}, y: "".to_string()}
}

fn bar() -> Option<String> {
    "".to_string()
}
```

provide the following output

```rust
error[E0308]: mismatched types
  --> file.rs:6:5
   |
 6 |     X { x: X {x: "".to_string(), y: 2}, y: "".to_string()}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found {integer}
   |
   = note: expected type `X<X<_, std::string::String>, _>`
                                 ^^^^^^^^^^^^^^^^^^^   // < highlighted
              found type `X<X<_, {integer}>, _>`
                                 ^^^^^^^^^             // < highlighted

error[E0308]: mismatched types
  --> file.rs:6:5
   |
10 |     "".to_string()
   |     ^^^^^^^^^^^^^^ expected struct `std::option::Option`, found `std::string::String`
   |
   = note: expected type `Option<std::string::String>`
                          ^^^^^^^                   ^  // < highlighted
              found type `std::string::String`
```
2017-04-11 15:45:00 -07:00
..
codegen rustc_trans: use ty::layout for ABI computation instead of LLVM types. 2017-04-09 16:06:56 +03:00
codegen-units translate drop glue using MIR 2017-03-18 02:53:08 +02:00
compile-fail Auto merge of #41055 - Archytaus:compile-fail/const-match-pattern-arm, r=arielb1 2017-04-08 14:05:06 +00:00
compile-fail-fulldeps Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00:00
debuginfo update gdbr tests 2017-03-09 22:12:36 +01:00
incremental rustc_typeck: hook up collect and item/body check to on-demand. 2017-02-25 18:35:25 +02:00
mir-opt borrowck::mir::dataflow: ignore unwind edges of empty drops 2017-04-08 22:46:50 +03:00
parse-fail Merge branch 'master' into issue-32540 2017-04-04 08:13:27 -07:00
pretty Update pretty test for derive attributes 2017-02-05 12:22:29 +10:30
run-fail
run-fail-fulldeps Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00:00
run-make Auto merge of #39987 - japaric:used, r=arielb1 2017-04-07 04:56:45 +00:00
run-pass Rollup merge of #41061 - arielb1:parent-lock, r=eddyb 2017-04-07 09:20:06 -04:00
run-pass-fulldeps Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00:00
run-pass-valgrind Removes FIXMEs related to #22405 2017-01-31 21:27:13 -05:00
rustdoc merge with master to pick up pulldown switch 2017-04-09 10:38:38 -05:00
ui Highlight and simplify mismatched types 2017-04-11 15:45:00 -07:00
ui-fulldeps/custom-derive Separate "ui-fulldeps" tests from "ui" tests 2017-03-04 21:38:26 +03:00
COMPILER_TESTS.md Move COMPILER_TESTS.md out of the root directory 2017-02-25 00:13:00 -06:00