os-rust/tests/ui/methods
León Orell Valerian Liehr ae88766286
Rollup merge of #123703 - estebank:diag-changes-2, r=Nadrieril
Use `fn` ptr signature instead of `{closure@..}` in infer error

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! {
   |                ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```

Address #123630 (test missing).
2024-04-11 01:56:26 +02:00
..
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issues Be more lax in .into_iter() suggestion when encountering Iterator methods on non-Iterator 2024-03-03 18:53:36 +00:00
assign-to-method.rs Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
assign-to-method.stderr Remove save-analysis. 2023-02-16 15:14:45 +11:00
call_method_unknown_pointee.rs Use the more informative generic type inference failure error on method calls on raw pointers 2024-03-20 15:53:06 +00:00
call_method_unknown_pointee.stderr Use the more informative generic type inference failure error on method calls on raw pointers 2024-03-20 15:53:06 +00:00
disambiguate-associated-function-first-arg.rs fix broken CI and code review 2023-12-27 15:47:57 +08:00
disambiguate-associated-function-first-arg.stderr fix broken CI and code review 2023-12-27 15:47:57 +08:00
disambiguate-multiple-blanket-impl.rs Unify suggestion wording 2023-10-17 17:33:55 +00:00
disambiguate-multiple-blanket-impl.stderr Rework print_disambiguation_help 2023-11-07 05:23:09 +00:00
disambiguate-multiple-impl.rs Unify suggestion wording 2023-10-17 17:33:55 +00:00
disambiguate-multiple-impl.stderr Rework print_disambiguation_help 2023-11-07 05:23:09 +00:00
disambiguate-multiple-trait-2.rs Unify suggestion wording 2023-10-17 17:33:55 +00:00
disambiguate-multiple-trait-2.stderr Rework print_disambiguation_help 2023-11-07 05:23:09 +00:00
disambiguate-multiple-trait.rs Unify suggestion wording 2023-10-17 17:33:55 +00:00
disambiguate-multiple-trait.stderr Rework print_disambiguation_help 2023-11-07 05:23:09 +00:00
field-method-suggestion-using-return-ty.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
field-method-suggestion-using-return-ty.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
inherent-bound-in-probe.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
inherent-bound-in-probe.stderr write-long-types-to-disk: update tests 2023-07-25 12:08:44 +01:00
issue-3707.rs Move tests 2023-08-28 17:47:37 -03:00
issue-3707.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-7950.rs Move tests 2024-03-03 16:30:48 -03:00
issue-7950.stderr Move tests 2024-03-03 16:30:48 -03:00
issue-19521.rs Move tests 2024-03-03 16:30:48 -03:00
issue-19521.stderr Move tests 2024-03-03 16:30:48 -03:00
method-ambig-one-trait-unknown-int-type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-ambig-one-trait-unknown-int-type.stderr Use fn ptr signature instead of {closure@..} in infer error 2024-04-10 00:41:27 +00:00
method-ambig-two-traits-cross-crate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-ambig-two-traits-cross-crate.stderr Sort method suggestions by DefPath instead of DefId 2024-03-27 14:02:16 +00:00
method-ambig-two-traits-from-bounds.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-ambig-two-traits-from-bounds.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
method-ambig-two-traits-from-impls.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-ambig-two-traits-from-impls.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
method-ambig-two-traits-from-impls2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-ambig-two-traits-from-impls2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
method-ambig-two-traits-with-default-method.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-ambig-two-traits-with-default-method.stderr Sort method suggestions by DefPath instead of DefId 2024-03-27 14:02:16 +00:00
method-ambiguity-no-rcvr.rs Don't expect a rcvr in print_disambiguation_help 2023-11-12 19:59:13 +00:00
method-ambiguity-no-rcvr.stderr fix broken CI and code review 2023-12-27 15:47:57 +08:00
method-argument-inference-associated-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-call-err-msg.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-call-err-msg.stderr Sort a diagnostic by DefPathStr instead of DefId 2024-03-27 14:02:16 +00:00
method-call-lifetime-args-fail.rs diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
method-call-lifetime-args-fail.stderr Error code E0794 for late-bound lifetime parameter error. 2023-03-07 21:26:19 +01:00
method-call-lifetime-args-lint-fail.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-call-lifetime-args-lint-fail.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-call-lifetime-args-lint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-call-lifetime-args-lint.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-call-lifetime-args-subst-index.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-call-lifetime-args-unresolved.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-call-lifetime-args-unresolved.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
method-call-lifetime-args.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-call-lifetime-args.stderr Error code E0794 for late-bound lifetime parameter error. 2023-03-07 21:26:19 +01:00
method-call-type-binding.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-call-type-binding.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
method-deref-to-same-trait-object-with-separate-params.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-deref-to-same-trait-object-with-separate-params.stderr Sort method suggestions by DefPath instead of DefId 2024-03-27 14:02:16 +00:00
method-early-bound-lifetimes-on-self.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-lookup-order.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-macro-backtrace.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-macro-backtrace.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
method-missing-call.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-missing-call.stderr adjust how closure/generator types and rvalues are printed 2023-09-21 22:20:58 +02:00
method-mut-self-modifies-mut-slice-lvalue.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-normalize-bounds-issue-20604.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-not-found-but-doc-alias.rs Consider doc(alias) when providing typo suggestions 2023-01-23 10:07:10 +09:00
method-not-found-but-doc-alias.stderr Deduplicate some logic and reword output 2024-02-22 18:05:28 +00:00
method-not-found-generic-arg-elision.rs Make method-not-found-generic-arg-elision.rs error message not path dependent 2023-04-26 21:48:21 +00:00
method-not-found-generic-arg-elision.stderr Stop sorting DefIds in the compiler 2024-03-27 14:02:17 +00:00
method-on-ambiguous-numeric-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-on-ambiguous-numeric-type.stderr macro_rules: Preserve all metavariable spans in a global side table 2024-02-18 11:19:24 +03:00
method-path-in-pattern.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-path-in-pattern.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-probe-no-guessing-dyn-trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-projection.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-recursive-blanket-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-recursive-blanket-impl.stderr Update tests 2024-02-07 10:42:01 +08:00
method-resolvable-path-in-pattern.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-resolvable-path-in-pattern.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
method-self-arg-1.rs Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
method-self-arg-1.stderr Tweak borrow suggestion 2023-05-08 03:36:30 +00:00
method-self-arg-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-self-arg-2.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
method-self-arg-aux1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-self-arg-aux2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-self-arg-trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-self-arg.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-trait-object-with-hrtb.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-two-trait-defer-resolution-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-two-trait-defer-resolution-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-two-trait-defer-resolution-2.stderr Update tests 2024-02-07 10:42:01 +08:00
method-two-traits-distinguished-via-where-clause.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method-two-traits-distinguished-via-where-clause.stderr Update tests 2024-02-07 10:42:01 +08:00
method-where-clause.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
opaque_param_in_ufc.rs Add regression test 2024-04-04 15:45:50 +00:00
opaque_param_in_ufc.stderr Add regression test 2024-04-04 15:45:50 +00:00
probe-overflow-due-to-sized-predicate-ordering.rs Make sure to insert Sized bound first into clauses list 2024-04-01 21:41:45 -04:00
suggest-method-on-call-with-macro-rcvr.rs Adjust spans correctly for fn -> method suggestion 2023-07-27 16:50:28 +00:00
suggest-method-on-call-with-macro-rcvr.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00