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. |
||
---|---|---|
.. | ||
assoc-const-AnonConst-ice-108220.rs | ||
assoc-const-no-infer-ice-115806.rs | ||
assoc-const-no-infer-ice-115806.stderr | ||
associated-const-equality.rs | ||
basic.rs | ||
compare-impl-item.rs | ||
compare-impl-item.stderr | ||
const-trait-impl.rs | ||
duplicate-where-clause.rs | ||
duplicate-where-clause.stderr | ||
elided-lifetimes.rs | ||
elided-lifetimes.stderr | ||
evaluatable-bounds.fixed | ||
evaluatable-bounds.rs | ||
evaluatable-bounds.stderr | ||
evaluatable-bounds.unconstrained.stderr | ||
feature-gate-generic_const_items.rs | ||
feature-gate-generic_const_items.stderr | ||
hkl_where_bounds.rs | ||
inference-failure.rs | ||
inference-failure.stderr | ||
misplaced-where-clause.fixed | ||
misplaced-where-clause.rs | ||
misplaced-where-clause.stderr | ||
parameter-defaults.rs | ||
parameter-defaults.stderr | ||
recursive.rs | ||
reference-outlives-referent.rs | ||
reference-outlives-referent.stderr | ||
trivially-unsatisfied-bounds-0.rs | ||
trivially-unsatisfied-bounds-0.stderr | ||
trivially-unsatisfied-bounds-1.rs | ||
trivially-unsatisfied-bounds-1.stderr | ||
unsatisfied-bounds.rs | ||
unsatisfied-bounds.stderr | ||
unsatisfied-evaluatable-bounds.rs | ||
unsatisfied-evaluatable-bounds.stderr | ||
unsatisfied-outlives-bounds.rs | ||
unsatisfied-outlives-bounds.stderr |