rust/src/test/ui/methods
Dylan DPC dee9aed07d
Rollup merge of #97542 - compiler-errors:arg-mismatch, r=jackh726
Use typed indices in argument mismatch algorithm

I kinda went overboard with the renames, but in general, "arg" is renamed to "expected", and "input" is renamed to "provided", and we use new typed indices to make sure we're indexing into the right sized array.

Other drive-by changes:
1. Factor this logic into a new function, so we don't need to `break 'label` to escape it.
1. Factored out dependence on `final_arg_types`, which is never populated for arguments greater than the number of expected args. Instead, we just grab the final coerced expression type from `in_progress_typeck_results`.
1. Adjust the criteria we use to print (provided) type names, before we didn't suggest anything that had infer vars, but now we suggest thing that have infer vars but aren't `_`.

~Also, sorry in advance, I kinda want to backport this but I know I have folded in a lot of unnecessary drive-by changes that might discourage that. I would be open to brainstorming how to get some of these changes on beta at least.~ edit: Minimized the ICE-fixing changes to #97557

cc `@jackh726` as author of #92364, and `@estebank` as reviewer of the PR.
fixes #97484
2022-06-29 10:28:19 +05:30
..
auxiliary Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
issues diagnostics: regression test for <usize as Iterator>::rev 2022-04-24 11:14:13 -04:00
assign-to-method.rs
assign-to-method.stderr Add span label to primary error span 2020-03-22 11:18:06 -07:00
method-ambig-one-trait-unknown-int-type.rs Point at overlapping impls when type annotations are needed 2021-10-24 18:33:04 +00:00
method-ambig-one-trait-unknown-int-type.stderr add new emit_inference_failure_err 2022-06-02 10:19:15 +02:00
method-ambig-two-traits-cross-crate.rs
method-ambig-two-traits-cross-crate.stderr manually implement Hash for DefId 2021-12-10 00:40:41 +01:00
method-ambig-two-traits-from-bounds.rs
method-ambig-two-traits-from-bounds.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
method-ambig-two-traits-from-impls.rs
method-ambig-two-traits-from-impls.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
method-ambig-two-traits-from-impls2.rs
method-ambig-two-traits-from-impls2.stderr Fix incorrect disambiguation suggestion for associated items 2021-09-25 21:47:33 +02:00
method-ambig-two-traits-with-default-method.rs
method-ambig-two-traits-with-default-method.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
method-argument-inference-associated-type.rs
method-call-err-msg.rs diagnostics: use rustc_on_unimplemented to recommend [].iter() 2022-03-09 09:52:55 -07:00
method-call-err-msg.stderr Use typed indices in argument mismatch algorithm 2022-06-27 21:53:03 -07:00
method-call-lifetime-args-fail.rs improve diagnosts for GATs 2021-05-11 14:09:46 +02:00
method-call-lifetime-args-fail.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
method-call-lifetime-args-lint-fail.rs
method-call-lifetime-args-lint-fail.stderr
method-call-lifetime-args-lint.rs
method-call-lifetime-args-lint.stderr
method-call-lifetime-args-subst-index.rs
method-call-lifetime-args-unresolved.rs Bless tests. 2022-04-17 11:03:34 +02:00
method-call-lifetime-args-unresolved.stderr Bless tests. 2022-04-17 11:03:34 +02:00
method-call-lifetime-args.rs
method-call-lifetime-args.stderr
method-call-type-binding.rs
method-call-type-binding.stderr
method-deref-to-same-trait-object-with-separate-params.rs Make tidy happy 2020-10-27 14:45:34 -03:00
method-deref-to-same-trait-object-with-separate-params.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
method-early-bound-lifetimes-on-self.rs
method-lookup-order.rs Test exploring the interactions between all of the different kinds of method collisions I could imagine. 2021-02-01 17:08:37 -05:00
method-macro-backtrace.rs
method-macro-backtrace.stderr Bless ui tests. 2022-06-24 17:57:27 +02:00
method-missing-call.rs
method-missing-call.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
method-mut-self-modifies-mut-slice-lvalue.rs
method-normalize-bounds-issue-20604.rs
method-not-found-generic-arg-elision.rs change from review and show full type if it can be deref 2021-05-22 12:38:48 +02:00
method-not-found-generic-arg-elision.stderr point to type param definition when not finding variant, method and assoc type 2022-06-22 13:40:20 +09:00
method-on-ambiguous-numeric-type.rs
method-on-ambiguous-numeric-type.stderr Mention filename in suggestion when it differs from primary span 2022-06-01 09:52:03 -07:00
method-path-in-pattern.rs update tests 2020-03-12 15:47:36 -05:00
method-path-in-pattern.stderr rustc_typeck: remove rustc_hir_pretty usage 2020-03-24 08:38:32 +01:00
method-probe-no-guessing-dyn-trait.rs
method-projection.rs
method-recursive-blanket-impl.rs
method-resolvable-path-in-pattern.rs update tests 2020-03-12 15:47:36 -05:00
method-resolvable-path-in-pattern.stderr update tests 2020-03-12 15:47:36 -05:00
method-self-arg-1.rs
method-self-arg-1.stderr Implementation for 65853 2022-04-16 02:26:56 -04:00
method-self-arg-2.rs
method-self-arg-2.stderr Use larger span for adjustments on method calls 2021-09-25 10:00:41 -05:00
method-self-arg-aux1.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
method-self-arg-aux2.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
method-self-arg-trait.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
method-self-arg.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
method-trait-object-with-hrtb.rs
method-two-trait-defer-resolution-1.rs
method-two-trait-defer-resolution-2.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
method-two-traits-distinguished-via-where-clause.rs
method-where-clause.rs