mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
194d52cc18
Refine error span for trait error into borrowed expression Extends the error span refinement in #106477 to drill into borrowed expressions just like tuples/struct/enum literals. For example, ```rs trait Fancy {} trait Good {} impl <'a, T> Fancy for &'a T where T: Good {} impl <S> Good for Option<S> where S: Iterator {} fn want_fancy<F>(f: F) where F: Fancy {} fn example() { want_fancy(&Some(5)); // (BEFORE) ^^^^^^^^ `{integer}` is not an iterator // (AFTER) ^ `{integer}` is not an iterator } ``` Existing heuristics try to find the right part of the expression to "point at"; current heuristics look at e.g. struct constructors and tuples. This PR adds a new check for borrowed expressions when looking into a borrowed type. |
||
---|---|---|
.. | ||
assembly | ||
auxiliary | ||
codegen | ||
codegen-units | ||
debuginfo | ||
incremental | ||
mir-opt | ||
pretty | ||
run-make | ||
run-make-fulldeps | ||
run-pass-valgrind | ||
rustdoc | ||
rustdoc-gui | ||
rustdoc-js | ||
rustdoc-js-std | ||
rustdoc-json | ||
rustdoc-ui | ||
ui | ||
ui-fulldeps | ||
COMPILER_TESTS.md |