b3f75cc872
Tweak E0277 output when a candidate is available *Follow up to #132086.* Go from ``` error[E0277]: the trait bound `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, (), ()>>: CSTParser<'a>` is not satisfied --> src/main.rs:7:50 | 7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> { | ^^^^^^^^^^^^^^^^^^^^^^ the trait `chumsky::private::ParserSealed<'_, &str, (), chumsky::extra::Full<EmptyErr, (), ()>>` is not implemented for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>`, which is required by `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, (), ()>>: CSTParser<'a>` | = 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 `()` = note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>` note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>` --> src/main.rs:5:16 | 5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {} | ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt' = note: consider using `--verbose` to print the full type name to the console = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt' = note: consider using `--verbose` to print the full type name to the console ``` to ``` error[E0277]: the trait bound `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, (), ()>>: CSTParser<'a>` is not satisfied --> src/main.rs:7:50 | 7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> { | ^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound ... 11 | ws.then(parser.map(|_| ())) | --------------------------- return type was inferred to be `Then<Ignored<..., ...>, ..., ..., ..., ...>` here | = help: the trait `ParserSealed<'_, &_, (), Full<_, _, _>>` is not implemented for `Then<Ignored<..., ...>, ..., ..., ..., ...>` but trait `ParserSealed<'_, &'a _, ((), ()), Full<_, _, _>>` is implemented for it = help: for that trait implementation, expected `((), ())`, found `()` = note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>` note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>` --> src/main.rs:5:16 | 5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {} | ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-df9d52be87eada65.long-type-1337037744507305372.txt' = note: consider using `--verbose` to print the full type name to the console ``` * Remove redundant wording * Introduce trait diff highlighting logic and use it * Fix incorrect "long type written to path" logic (can be split off) * Point at tail expression in more cases in E0277 * Avoid long primary span labels in E0277 by moving them to a `help` Fix #132013. There are individual commits that can be their own PR. If the review load is too big, happy to split them off. |
||
---|---|---|
.. | ||
auxiliary | ||
ambiguous-arg.rs | ||
ambiguous-arg.stderr | ||
arg-mismatch.rs | ||
arg-mismatch.stderr | ||
async-fn-mut-for-async-fn.rs | ||
async-fn-once-for-async-fn.rs | ||
await-inference-guidance.rs | ||
body-check-on-non-fnmut.rs | ||
box-deref-in-debuginfo.rs | ||
brand.rs | ||
captures.rs | ||
captures.run.stdout | ||
clone-closure.rs | ||
clone-closure.run.stdout | ||
closure-shim-borrowck-error.rs | ||
closure-shim-borrowck-error.stderr | ||
constrained-but-no-upvars-yet.rs | ||
debuginfo-by-move-body.rs | ||
def-path.rs | ||
def-path.stderr | ||
different-projection-lengths-for-different-upvars.rs | ||
dont-ice-when-body-tainted-by-errors.rs | ||
dont-ice-when-body-tainted-by-errors.stderr | ||
drop.rs | ||
drop.run.stdout | ||
fn-exception-target-features.rs | ||
fn-exception-target-features.stderr | ||
fn-exception.rs | ||
fn-exception.stderr | ||
force-move-due-to-actually-fnonce.rs | ||
force-move-due-to-inferred-kind.rs | ||
foreign.rs | ||
higher-ranked-return.rs | ||
higher-ranked-return.stderr | ||
higher-ranked.rs | ||
implements-fnmut.rs | ||
inline-body.rs | ||
is-fn.rs | ||
is-not-fn.rs | ||
is-not-fn.stderr | ||
lint-closure-returning-async-block.rs | ||
lint-closure-returning-async-block.stderr | ||
mac-body.rs | ||
mangle.rs | ||
moro-example.rs | ||
move-consuming-capture.rs | ||
move-consuming-capture.stderr | ||
move-is-async-fn.rs | ||
move-out-of-ref.rs | ||
move-out-of-ref.stderr | ||
mut-ref-reborrow.rs | ||
mutate.rs | ||
no-borrow-from-env.rs | ||
non-copy-arg-does-not-force-inner-move.rs | ||
not-clone-closure.rs | ||
not-clone-closure.stderr | ||
not-fn.rs | ||
not-fn.stderr | ||
not-lending.rs | ||
not-lending.stderr | ||
once.rs | ||
overlapping-projs.rs | ||
overlapping-projs.run.stdout | ||
precise-captures.call_once.run.stdout | ||
precise-captures.call.run.stdout | ||
precise-captures.force_once.run.stdout | ||
precise-captures.rs | ||
refd.rs | ||
return-type-mismatch.rs | ||
return-type-mismatch.stderr | ||
sig-from-bare-fn.rs | ||
signature-deduction.rs | ||
signature-inference-from-two-part-bound.rs | ||
tainted-body-2.rs | ||
tainted-body-2.stderr | ||
tainted-body.rs | ||
tainted-body.stderr | ||
truncated-fields-when-imm.rs | ||
validate-synthetic-body.rs | ||
without-precise-captures-we-are-powerless.rs | ||
without-precise-captures-we-are-powerless.stderr | ||
wrong-fn-kind.rs | ||
wrong-fn-kind.stderr |