) => self.check_expr_path(qpath, expr, args),
_ => self.check_expr_kind(expr, expected),
});
+ let ty = self.resolve_vars_if_possible(ty);
// Warn for non-block expressions with diverging children.
match expr.kind {
--> $DIR/issue-15783.rs:8:19
|
LL | let x = Some(&[name]);
- | ------------- here the type of `x` is inferred to be `Option<_>`
+ | ------------- here the type of `x` is inferred to be `Option<&[&str; 1]>`
LL | let msg = foo(x);
| --- ^ expected slice `[&str]`, found array `[&str; 1]`
| |
--> $DIR/let-else-ref-bindings.rs:24:34
|
LL | let some = Some(bytes);
- | ----------- here the type of `some` is inferred to be `Option<_>`
-...
-LL | let Some(ref a): Option<&[u8]> = some else { return };
- | ---- here the type of `some` is inferred to be `Option<Vec<u8>>`
+ | ----------- here the type of `some` is inferred to be `Option<Vec<u8>>`
...
LL | let Some(a): Option<&[u8]> = some else { return };
| ------------- ^^^^ expected `&[u8]`, found struct `Vec`
--> $DIR/let-else-ref-bindings.rs:52:38
|
LL | let mut some = Some(bytes);
- | ----------- here the type of `some` is inferred to be `Option<_>`
-...
-LL | let Some(ref mut a): Option<&mut [u8]> = some else { return };
- | ---- here the type of `some` is inferred to be `Option<Vec<u8>>`
+ | ----------- here the type of `some` is inferred to be `Option<Vec<u8>>`
...
LL | let Some(a): Option<&mut [u8]> = some else { return };
| ----------------- ^^^^ expected `&mut [u8]`, found struct `Vec`
LL | | },
LL | | y: 3,
LL | | };
- | |_____- here the type of `x` is inferred to be `X<_, _>`
+ | |_____- here the type of `x` is inferred to be `X<X<String, {integer}>, {integer}>`
LL | x
| ^ expected struct `String`, found integer
|
LL | | },
LL | | y: "".to_string(),
LL | | };
- | |_____- here the type of `x` is inferred to be `X<_, _>`
+ | |_____- here the type of `x` is inferred to be `X<X<String, {integer}>, String>`
LL | x
| ^ expected struct `String`, found integer
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19
|
LL | let opt = Some(1i32);
- | ---------- here the type of `opt` is inferred to be `Option<_>`
-LL |
-LL | let Some(n) = opt else {
- | --- here the type of `opt` is inferred to be `Option<i32>`
+ | ---------- here the type of `opt` is inferred to be `Option<i32>`
...
LL | let Some(n) = opt && n == 1 else {
| ^^^ expected `bool`, found enum `Option`
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
|
LL | let opt = Some(1i32);
- | ---------- here the type of `opt` is inferred to be `Option<_>`
-LL |
-LL | let Some(n) = opt else {
- | --- here the type of `opt` is inferred to be `Option<i32>`
+ | ---------- here the type of `opt` is inferred to be `Option<i32>`
...
LL | let Some(n) = opt && let another = n else {
| ^^^ expected `bool`, found enum `Option`
| --------------
| | |
| | the found closure
- | here the type of `y` is inferred to be `Box<_>`
+ | here the type of `y` is inferred to be `Box<[closure@call-boxed.rs:3:22]>`
LL | x = y;
| ^ expected `i32`, found struct `Box`
|
--> $DIR/wrong_argument_ice-3.rs:9:16
|
LL | let new_group = vec![String::new()];
- | ------------------- here the type of `new_group` is inferred to be `Vec<_, _>`
+ | ------------------- here the type of `new_group` is inferred to be `Vec<String>`
...
LL | groups.push(new_group, vec![process]);
| ^^^^ ------------- argument of type `Vec<&Process>` unexpected
--> $DIR/type-mismatch-same-crate-name.rs:16:20
|
LL | let foo2 = {extern crate crate_a2 as a; a::Foo};
- | ------------------------------------ here the type of `foo2` is inferred to be `_`
+ | ------------------------------------ here the type of `foo2` is inferred to be `Foo`
...
LL | a::try_foo(foo2);
| ---------- ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo`
--> $DIR/type-mismatch-same-crate-name.rs:20:20
|
LL | let bar2 = {extern crate crate_a2 as a; a::bar()};
- | -------------------------------------- here the type of `bar2` is inferred to be `_`
+ | -------------------------------------- here the type of `bar2` is inferred to be `Box<dyn Bar>`
...
LL | a::try_bar(bar2);
| ---------- ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar`