about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-14 11:39:40 +0200
committerGitHub <noreply@github.com>2025-08-14 11:39:40 +0200
commit707e956946186fc6ebd90b7c29da581d802110ce (patch)
tree456f1784225e75503559a80f1c8a04f4e760be1d /compiler/rustc_resolve/src
parent44d3217c20ab0bdbbc9bd2edfc6810e6e605369e (diff)
parente0cc2beea3d52ce34b16df9730b65a670c68c623 (diff)
downloadrust-707e956946186fc6ebd90b7c29da581d802110ce.tar.gz
rust-707e956946186fc6ebd90b7c29da581d802110ce.zip
Rollup merge of #145361 - xizheyin:145294, r=compiler-errors
Suppress wrapper suggestion when expected and actual ty are the same adt and the variant is unresolved

Fixes rust-lang/rust#145294

I initially tried the desired suggestion in this issue, but since that suggestion occurs in the expected type, it is inappropriate to suggest for expected expressions (see other suggest methods in the same file). I believe that suppressing the incorrect suggestion is the more appropriate choice here.

I opted for a slightly more general approach: when the expected type and actual type are the same ADT (e.g., both are Result in this example), we assume that code tend to compare the internal generic parameters(i.e. `Option<&str>` vs `Option<String>`, instead of `E = _` vs `Result<Option<String>>>`). When `E` is an unresolved infer type in the expected type (`_` in this example), we should not wrapp the actual type.

Two commits show the difference.

r? compiler
Diffstat (limited to 'compiler/rustc_resolve/src')
0 files changed, 0 insertions, 0 deletions