mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 20:23:59 +00:00
796be88062
When suggesting a type on inference error, do not use `{closure@..}`. Instead, replace with an appropriate `fn` ptr. On the error message, use `short_ty_string` and write long types to disk. ``` error[E0284]: type annotations needed for `Select<{closure@lib.rs:2782:13}, _, Expression<'_>, _>` --> crates/lang/src/parser.rs:41:13 | 41 | let lit = select! { | ^^^ 42 | Token::Int(i) = e => Expression::new(Expr::Lit(ast::Lit::Int(i.parse().unwrap())), e.span()), | ---- type must be known at this point | = note: the full type name has been written to '/home/gh-estebank/iowo/target/debug/deps/lang-e2d6e25819442273.long-type-4587393693885174369.txt' = note: cannot satisfy `<_ as chumsky::input::Input<'_>>::Span == SimpleSpan` help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified | 41 | let lit: Select<for<'a, 'b> fn(tokens::Token<'_>, &'a mut MapExtra<'_, 'b, _, _>) -> Option<Expression<'_>>, _, Expression<'_>, _> = select! { | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ``` instead of ``` error[E0284]: type annotations needed for `Select<{closure@/home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chumsky-1.0.0-alpha.6/src/lib.rs:2782:13: 2782:28}, _, Expression<'_>, _>` --> crates/lang/src/parser.rs:41:13 | 41 | let lit = select! { | ^^^ 42 | Token::Int(i) = e => Expression::new(Expr::Lit(ast::Lit::Int(i.parse().unwrap())), e.span()), | ---- type must be known at this point | = note: cannot satisfy `<_ as chumsky::input::Input<'_>>::Span == SimpleSpan` help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified | 41 | let lit: Select<{closure@/home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chumsky-1.0.0-alpha.6/src/lib.rs:2782:13: 2782:28}, _, Expression<'_>, _> = select! { | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ``` Fix #123630. |
||
---|---|---|
.. | ||
auxiliary | ||
complex-generic-default-expr.min.stderr | ||
complex-generic-default-expr.rs | ||
complex-unord-param.rs | ||
const-default.rs | ||
const-param-as-default-value.rs | ||
const-param-in-ty-defaults.rs | ||
default-annotation.rs | ||
default-const-param-cannot-reference-self.rs | ||
default-const-param-cannot-reference-self.stderr | ||
default-on-impl.rs | ||
default-on-impl.stderr | ||
default-param-wf-concrete.next.stderr | ||
default-param-wf-concrete.old.stderr | ||
default-param-wf-concrete.rs | ||
doesnt_infer.rs | ||
doesnt_infer.stderr | ||
external.rs | ||
forward-declared.rs | ||
forward-declared.stderr | ||
generic-expr-default-concrete.rs | ||
generic-expr-default-concrete.stderr | ||
generic-expr-default-mismatched-types.rs | ||
generic-expr-default-mismatched-types.stderr | ||
generic-expr-default.rs | ||
generic-expr-default.stderr | ||
intermixed-lifetime.rs | ||
intermixed-lifetime.stderr | ||
mismatch.rs | ||
mismatch.stderr | ||
mismatched_ty_const_in_trait_impl.rs | ||
mismatched_ty_const_in_trait_impl.stderr | ||
param-order-err-pretty-prints-default.rs | ||
param-order-err-pretty-prints-default.stderr | ||
pretty-printing-ast.rs | ||
pretty-printing-ast.stdout | ||
repr-c-issue-82792.rs | ||
rp_impl_trait_fail.rs | ||
rp_impl_trait_fail.stderr | ||
rp_impl_trait.rs | ||
self-referential.rs | ||
self-referential.stderr | ||
simple-defaults.rs | ||
trait_object_lt_defaults.rs | ||
trait_objects_fail.rs | ||
trait_objects_fail.stderr | ||
trait_objects.rs | ||
type-default-const-param-name.rs | ||
wfness.rs | ||
wfness.stderr | ||
wrong-order.rs | ||
wrong-order.stderr |