about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/errors.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-06-19 01:51:41 +0100
committerGitHub <noreply@github.com>2024-06-19 01:51:41 +0100
commitbf841c47738a5a67dd21df7e0c8018a687fb2d1b (patch)
tree65edb741ab6566af753930ef16f351aed17e1835 /compiler/rustc_interface/src/errors.rs
parent3c61378c5a1c22a5636cab29a6059bfd4a41c7d9 (diff)
parent939026c8fba0d6b9edc2e2cdfbbf6dd6fb575662 (diff)
downloadrust-bf841c47738a5a67dd21df7e0c8018a687fb2d1b.tar.gz
rust-bf841c47738a5a67dd21df7e0c8018a687fb2d1b.zip
Rollup merge of #126558 - jieyouxu:caller-chooses-ty, r=fmease
hir_typeck: be more conservative in making "note caller chooses ty param" note

In https://github.com/rust-lang/rust/pull/122195 I added a "caller chooses ty for type param" note for when the return expression type a.k.a. found type does not match the expected return type.

#126547 found that this note was confusing when the found return type *contains* the expected type, e.g.

```rs
fn f<T>(t: &T) -> T {
    t
}
```

because the found return type `&T` will *always* be different from the expected return type `T`, so the note was needlessly redundant and confusing.

This PR addresses that by not making the note if the found return type contains the expected return type.

r? ``@fmease`` (since you reviewed the original PR)

Fixes https://github.com/rust-lang/rust/issues/126547
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions