Skip to content

Commit 654a412

Browse files
committed
Fix rebase
1 parent f26b748 commit 654a412

File tree

4 files changed

+28
-22
lines changed

4 files changed

+28
-22
lines changed

src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ error[E0282]: type annotations needed
33
|
44
LL | with_closure(|x: u32, y| {});
55
| ^ consider giving this closure parameter a type
6+
|
7+
help: consider specifying the type arguments in the function call
8+
|
9+
LL | with_closure::<F, A, B>(|x: u32, y| {});
10+
| ^^^^^^^^^^^
611

712
error: aborting due to previous error
813

src/test/ui/issues/issue-23046.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ error[E0282]: type annotations needed for `Expr<'_, VAR>`
33
|
44
LL | let ex = |x| {
55
| ^ consider giving this closure parameter the explicit type `Expr<'_, VAR>`, where the type parameter `VAR` is specified
6+
|
7+
help: consider specifying the type arguments in the function call
8+
|
9+
LL | let_::<VAR, F>(add(x,x), |y| {
10+
| ^^^^^^^^^^
611

712
error: aborting due to previous error
813

src/test/ui/issues/issue-72690.stderr

+6-16
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ error[E0283]: type annotations needed
1111
--> $DIR/issue-72690.rs:11:9
1212
|
1313
LL | |x| String::from("x".as_ref());
14-
| ^^^^^^^^^^^^ cannot infer type for struct `String`
14+
| ^^^^^^^^^^^^ cannot infer type for reference `&_`
1515
|
1616
= note: cannot satisfy `String: From<&_>`
1717
= note: required by `from`
@@ -20,11 +20,13 @@ error[E0283]: type annotations needed for `&T`
2020
--> $DIR/issue-72690.rs:15:17
2121
|
2222
LL | let _ = "x".as_ref();
23-
| - ^^^^^^ cannot infer type for type parameter `T` declared on the trait `AsRef`
24-
| |
25-
| consider giving this pattern the explicit type `&T`, where the type parameter `T` is specified
23+
| ^^^^^^ cannot infer type for type parameter `T` declared on the trait `AsRef`
2624
|
2725
= note: cannot satisfy `str: AsRef<_>`
26+
help: consider giving this binding the explicit type `&T`, where the type parameter `T` is specified
27+
|
28+
LL | let _: str = "x".as_ref();
29+
| ^^^^^
2830

2931
error[E0283]: type annotations needed
3032
--> $DIR/issue-72690.rs:19:5
@@ -61,10 +63,6 @@ LL | String::from("x".as_ref());
6163
|
6264
= note: cannot satisfy `String: From<&_>`
6365
= note: required by `from`
64-
help: consider giving this binding the explicit type `String`
65-
|
66-
LL | let _: String = String::from("x");
67-
| ^^^^^^^^
6866

6967
error[E0283]: type annotations needed
7068
--> $DIR/issue-72690.rs:47:5
@@ -74,10 +72,6 @@ LL | String::from("x".as_ref());
7472
|
7573
= note: cannot satisfy `String: From<&_>`
7674
= note: required by `from`
77-
help: consider giving this binding the explicit type `String`
78-
|
79-
LL | let _: String = String::from("x");
80-
| ^^^^^^^^
8175

8276
error[E0283]: type annotations needed
8377
--> $DIR/issue-72690.rs:55:5
@@ -87,10 +81,6 @@ LL | String::from("x".as_ref());
8781
|
8882
= note: cannot satisfy `String: From<&_>`
8983
= note: required by `from`
90-
help: consider giving this binding the explicit type `String`
91-
|
92-
LL | let _: String = String::from("x");
93-
| ^^^^^^^^
9484

9585
error: aborting due to 9 previous errors
9686

src/test/ui/traits/issue-77982.stderr

+12-6
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,27 @@ error[E0283]: type annotations needed for `Box<T>`
2323
--> $DIR/issue-77982.rs:35:16
2424
|
2525
LL | let _ = ().foo();
26-
| - ^^^ cannot infer type for type parameter `T` declared on the trait `Foo`
27-
| |
28-
| consider giving this pattern the explicit type `Box<T>`, where the type parameter `T` is specified
26+
| ^^^ cannot infer type for type parameter `T` declared on the trait `Foo`
2927
|
3028
= note: cannot satisfy `(): Foo<'_, _>`
29+
help: consider giving this binding the explicit type `Box<T>`, where the type parameter `T` is specified
30+
|
31+
LL | let _: () = ().foo();
32+
| ^^^^
3133

3234
error[E0283]: type annotations needed for `Box<T>`
3335
--> $DIR/issue-77982.rs:39:19
3436
|
3537
LL | let _ = (&()).bar();
36-
| - ^^^ cannot infer type for type parameter `T` declared on the trait `Bar`
37-
| |
38-
| consider giving this pattern the explicit type `Box<T>`, where the type parameter `T` is specified
38+
| ^^^ cannot infer type for type parameter `T` declared on the trait `Bar`
3939
|
4040
= note: cannot satisfy `&(): Bar<'_, _>`
41+
help: consider giving this binding the explicit type `Box<T>`, where the type parameter `T` is specified
42+
|
43+
LL | let _: &'a () = (&()).bar();
44+
| ^^^^^^^^
45+
LL | let _: &'a () = (&()).bar();
46+
| ^^^^^^^^
4147

4248
error: aborting due to 4 previous errors
4349

0 commit comments

Comments
 (0)