Skip to content

Commit a16de49

Browse files
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
2 parents fcb7668 + a5460b5 commit a16de49

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)