mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
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 | ||
alias-bounds-when-not-wf.rs | ||
alias-bounds-when-not-wf.stderr | ||
anonymize-binders-for-refine.rs | ||
assumed-wf-bounds-in-impl.rs | ||
async-and-ret-ref.rs | ||
async-and-ret-ref.stderr | ||
bad-item-bound-within-rpitit-2.rs | ||
bad-item-bound-within-rpitit-2.stderr | ||
bad-item-bound-within-rpitit.rs | ||
bad-item-bound-within-rpitit.stderr | ||
bad-projection-from-opaque.rs | ||
bad-projection-from-opaque.stderr | ||
box-coerce-span-in-default.rs | ||
cannot-capture-intersection.rs | ||
cannot-capture-intersection.stderr | ||
check-wf-on-non-defaulted-rpitit.rs | ||
check-wf-on-non-defaulted-rpitit.stderr | ||
cycle-effective-visibilities-during-dyn-compatibility-check.rs | ||
cycle-effective-visibilities-during-dyn-compatibility-check.stderr | ||
deep-match-works.rs | ||
deep-match.rs | ||
deep-match.stderr | ||
default-body-type-err-2.rs | ||
default-body-type-err-2.stderr | ||
default-body-type-err.rs | ||
default-body-type-err.stderr | ||
default-body-with-rpit.rs | ||
default-body.rs | ||
default-method-binder-shifting.rs | ||
default-method-constraint.rs | ||
doesnt-satisfy.rs | ||
doesnt-satisfy.stderr | ||
dont-project-to-rpitit-with-no-value.rs | ||
dont-project-to-rpitit-with-no-value.stderr | ||
dyn-compatibility-sized.rs | ||
dyn-compatibility.rs | ||
dyn-compatibility.stderr | ||
early.rs | ||
encode.rs | ||
ensure-rpitits-are-created-before-freezing.rs | ||
ensure-rpitits-are-created-before-freezing.stderr | ||
expeced-refree-to-map-to-reearlybound-ice-108580.rs | ||
expeced-refree-to-map-to-reearlybound-ice-108580.stderr | ||
false-positive-predicate-entailment-error.current.stderr | ||
false-positive-predicate-entailment-error.rs | ||
foreign-dyn-error.rs | ||
foreign-dyn-error.stderr | ||
foreign.rs | ||
foreign.stderr | ||
gat-outlives.rs | ||
gat-outlives.stderr | ||
generics-mismatch.rs | ||
generics-mismatch.stderr | ||
issue-102140.rs | ||
issue-102140.stderr | ||
issue-102301.rs | ||
issue-102571.rs | ||
issue-102571.stderr | ||
late-bound-in-object-assocty.rs | ||
lifetime-in-associated-trait-bound.rs | ||
method-signature-matches.lt.stderr | ||
method-signature-matches.mismatch_async.stderr | ||
method-signature-matches.mismatch.stderr | ||
method-signature-matches.rs | ||
method-signature-matches.too_few.stderr | ||
method-signature-matches.too_many.stderr | ||
missing-lt-outlives-in-rpitit-114274.rs | ||
missing-lt-outlives-in-rpitit-114274.stderr | ||
missing-static-bound-from-impl.rs | ||
missing-static-bound-from-impl.stderr | ||
nested-rpitit-bounds.rs | ||
nested-rpitit.rs | ||
opaque-and-lifetime-mismatch.rs | ||
opaque-and-lifetime-mismatch.stderr | ||
opaque-in-impl-is-opaque.rs | ||
opaque-in-impl-is-opaque.stderr | ||
opaque-in-impl.rs | ||
opaque-variances.rs | ||
outlives-in-nested-rpit.rs | ||
placeholder-implied-bounds.rs | ||
refine-err.rs | ||
refine-err.stderr | ||
refine-normalize.rs | ||
refine-resolution-errors.rs | ||
refine-resolution-errors.stderr | ||
refine.rs | ||
refine.stderr | ||
return-dont-satisfy-bounds.rs | ||
return-dont-satisfy-bounds.stderr | ||
return-type-notation.rs | ||
return-type-notation.stderr | ||
reveal.rs | ||
rpitit-cycle-in-generics-of.rs | ||
rpitit-hidden-types-self-implied-wf-via-param.rs | ||
rpitit-hidden-types-self-implied-wf-via-param.stderr | ||
rpitit-hidden-types-self-implied-wf.rs | ||
rpitit-hidden-types-self-implied-wf.stderr | ||
rpitit-shadowed-by-missing-adt.rs | ||
rpitit-shadowed-by-missing-adt.stderr | ||
shorthand-projection-in-rpitit-bound.rs | ||
sibling-function-constraint.rs | ||
sibling-function-constraint.stderr | ||
signature-mismatch.failure.stderr | ||
signature-mismatch.rs | ||
span-bug-issue-121457.rs | ||
span-bug-issue-121457.stderr | ||
specialization-broken.rs | ||
specialization-broken.stderr | ||
specialization-substs-remap.rs | ||
success.rs | ||
suggest-missing-item.fixed | ||
suggest-missing-item.rs | ||
suggest-missing-item.stderr | ||
synthetic-hir-has-parent.rs | ||
synthetic-hir-has-parent.stderr | ||
trait-more-generics-than-impl.rs | ||
trait-more-generics-than-impl.stderr | ||
unconstrained-lt.rs | ||
unconstrained-lt.stderr | ||
variance.rs | ||
variance.stderr | ||
variances-of-gat.rs | ||
wf-bounds.rs | ||
wf-bounds.stderr | ||
where-clause.rs |