Commit aa82fd6
committed
Tweak highlighting when trait is available for different type
When printing
```
= help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>`
= help: for that trait implementation, expected `((), ())`, found `()`
```
Highlight only the `expected` and `found` types, instead of the full type in the first `help`.1 parent 24ac777 commit aa82fd6
File tree
2 files changed
+16
-7
lines changed- compiler/rustc_trait_selection/src/error_reporting/traits
- tests/ui/impl-trait/diagnostics
2 files changed
+16
-7
lines changedLines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1835 | 1835 | | |
1836 | 1836 | | |
1837 | 1837 | | |
| 1838 | + | |
1838 | 1839 | | |
1839 | 1840 | | |
1840 | 1841 | | |
1841 | 1842 | | |
1842 | 1843 | | |
1843 | 1844 | | |
1844 | 1845 | | |
1845 | | - | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
1846 | 1851 | | |
1847 | 1852 | | |
1848 | 1853 | | |
1849 | 1854 | | |
1850 | 1855 | | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
1855 | 1864 | | |
1856 | 1865 | | |
1857 | 1866 | | |
| |||
Lines changed: 2 additions & 2 deletions
Loading
0 commit comments