about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-10-03 08:58:48 +0200
committerGitHub <noreply@github.com>2023-10-03 08:58:48 +0200
commit634e5c9ba2ddc155ae95b91d21f511a8a22e9206 (patch)
tree98e4bc3a513f35863df6704a09df7b5c5f68e486 /tests/rustdoc-js-std/parser-errors.js
parentff3b15e2bf19d39b2c8463afda183c387d993569 (diff)
parentac5aa8c1a4370b34674d18ef20b642645d2172e0 (diff)
downloadrust-634e5c9ba2ddc155ae95b91d21f511a8a22e9206.tar.gz
rust-634e5c9ba2ddc155ae95b91d21f511a8a22e9206.zip
Rollup merge of #116158 - compiler-errors:unconstrained-type-var-sugg, r=wesleywiser
Don't suggest nonsense suggestions for unconstrained type vars in `note_source_of_type_mismatch_constraint`

The way we do type inference for suggestions in `note_source_of_type_mismatch_constraint` is a bit strange. We compute the "ideal" method signature, which takes the receiver that we *want* and uses it to compute the types of the arguments that would have given us that receiver via type inference, and use *that* to suggest how to change an argument to make sure our receiver type is inferred correctly.

The problem is that sometimes we have totally unconstrained arguments (well, they're constrained by things outside of the type checker per se, like associated types), and therefore type suggestions are happy to coerce anything to that unconstrained argument. This leads to bogus suggestions, like #116155. This is partly due to above, and partly due to the fact that `emit_type_mismatch_suggestions` doesn't double check that its suggestions are actually compatible with the program other than trying to satisfy the type mismatch.

This adds a hack to make sure that at least the types are fully constrained, but I guess I could also rip out this logic altogether. There would be some sad diagnostics regressions though, such as `tests/ui/type/type-check/point-at-inference-4.rs`.

Fixes #116155
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions