Skip to content

Commit acd7444

Browse files
try comment
1 parent 01decf3 commit acd7444

16 files changed

+39
-77
lines changed

compiler/rustc_infer/src/infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
10131013
let r_b = self.shallow_resolve(predicate.skip_binder().b);
10141014
match (r_a.kind(), r_b.kind()) {
10151015
(&ty::Infer(ty::TyVar(a_vid)), &ty::Infer(ty::TyVar(b_vid))) => {
1016-
self.inner.borrow_mut().type_variables().sub(a_vid, b_vid);
1016+
//self.inner.borrow_mut().type_variables().sub(a_vid, b_vid);
10171017
return None;
10181018
}
10191019
_ => {}

src/test/ui/const-generics/occurs-check/unused-substs-5.stderr

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
error[E0308]: mismatched types
2-
--> $DIR/unused-substs-5.rs:15:9
2+
--> $DIR/unused-substs-5.rs:15:19
33
|
44
LL | x = q::<_, N>(x);
5-
| ^^^^^^^^^^^^- help: try using a conversion method: `.to_vec()`
6-
| |
7-
| cyclic type of infinite size
5+
| ^ cyclic type of infinite size
86

97
error: aborting due to previous error
108

src/test/ui/inference/cannot-infer-closure-circular.stderr

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
error[E0282]: type annotations needed for `Result<(), E>`
2-
--> $DIR/cannot-infer-closure-circular.rs:7:14
1+
error[E0282]: type annotations needed for the closure `fn(Result<(), _>) -> Result<(), _>`
2+
--> $DIR/cannot-infer-closure-circular.rs:10:9
33
|
4-
LL | let x = |r| {
5-
| ^ consider giving this closure parameter the explicit type `Result<(), E>`, where the type parameter `E` is specified
4+
LL | Ok(v)
5+
| ^^ cannot infer type for type parameter `E` declared on the enum `Result`
6+
|
7+
help: give this closure an explicit return type without `_` placeholders
8+
|
9+
LL | let x = |r| -> Result<(), _> {
10+
| ++++++++++++++++
611

712
error: aborting due to previous error
813

src/test/ui/inference/issue-71732.stderr

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ error[E0283]: type annotations needed
22
--> $DIR/issue-71732.rs:18:10
33
|
44
LL | .get(&"key".into())
5-
| ^^^ ------------ this method call resolves to `T`
6-
| |
7-
| cannot infer type for type parameter `Q` declared on the associated function `get`
5+
| ^^^ cannot infer type for type parameter `Q` declared on the associated function `get`
86
|
97
= note: cannot satisfy `String: Borrow<_>`
108

src/test/ui/inference/issue-72616.stderr

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ error[E0283]: type annotations needed
22
--> $DIR/issue-72616.rs:20:30
33
|
44
LL | if String::from("a") == "a".try_into().unwrap() {}
5-
| ^^ -------------- this method call resolves to `Result<T, <Self as TryInto<T>>::Error>`
6-
| |
7-
| cannot infer type
5+
| ^^ cannot infer type
86
|
97
= note: cannot satisfy `String: PartialEq<_>`
108

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
22
--> $DIR/issue-51116.rs:6:13
33
|
44
LL | for tile in row {
5-
| --- the element type for this iterator is not specified
5+
| ---- consider giving `tile` a type
66
LL |
77
LL | *tile = 0;
88
| ^^^^^ cannot infer type

src/test/ui/issues/issue-57843.nll.stderr

-11
This file was deleted.

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

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
error[E0277]: expected a `Fn<(_,)>` closure, found `impl Fn<(((_, _), _),)>`
2-
--> $DIR/issue-59494.rs:21:22
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-59494.rs:20:40
33
|
4-
LL | let t8 = t8n(t7, t7p(f, g));
5-
| ^^^^^^^^^ expected an `Fn<(_,)>` closure, found `impl Fn<(((_, _), _),)>`
6-
|
7-
= help: the trait `Fn<(_,)>` is not implemented for `impl Fn<(((_, _), _),)>`
8-
note: required by a bound in `t8n`
9-
--> $DIR/issue-59494.rs:5:45
10-
|
11-
LL | fn t8n<A, B, C>(f: impl Fn(A) -> B, g: impl Fn(A) -> C) -> impl Fn(A) -> (B, C)
12-
| ^^^^^^^^^^ required by this bound in `t8n`
4+
LL | let t7 = |env| |a| |b| t7p(f, g)(((env, a), b));
5+
| ^^^ cyclic type of infinite size
136

147
error: aborting due to previous error
158

16-
For more information about this error, try `rustc --explain E0277`.
9+
For more information about this error, try `rustc --explain E0308`.

src/test/ui/occurs-check-2.stderr

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
error[E0308]: mismatched types
2-
--> $DIR/occurs-check-2.rs:7:9
2+
--> $DIR/occurs-check-2.rs:6:9
33
|
4-
LL | f = box g;
5-
| ^^^^^ cyclic type of infinite size
6-
|
7-
help: try using a conversion method
8-
|
9-
LL | f = (box g).to_string();
10-
| + +++++++++++++
4+
LL | g = f;
5+
| ^ cyclic type of infinite size
116

127
error: aborting due to previous error
138

src/test/ui/occurs-check-3.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0308]: mismatched types
2-
--> $DIR/occurs-check-3.rs:4:24
2+
--> $DIR/occurs-check-3.rs:4:32
33
|
44
LL | fn main() { let c; c = Clam::A(c); match c { Clam::A::<isize>(_) => { } } }
5-
| ^^^^^^^^^^ cyclic type of infinite size
5+
| ^ cyclic type of infinite size
66

77
error: aborting due to previous error
88

src/test/ui/pattern/pat-tuple-bad-type.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
error[E0282]: type annotations needed
22
--> $DIR/pat-tuple-bad-type.rs:5:9
33
|
4-
LL | let x;
5-
| - consider giving `x` a type
6-
...
74
LL | (..) => {}
85
| ^^^^ cannot infer type
96
|

src/test/ui/question-mark-type-infer.stderr

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
error[E0284]: type annotations needed
2-
--> $DIR/question-mark-type-infer.rs:12:21
2+
--> $DIR/question-mark-type-infer.rs:12:5
33
|
44
LL | l.iter().map(f).collect()?
5-
| ^^^^^^^ cannot infer type
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
66
|
77
= note: cannot satisfy `<_ as Try>::Residual == _`
8-
help: consider specifying the type argument in the method call
9-
|
10-
LL | l.iter().map(f).collect::<B>()?
11-
| +++++
128

139
error: aborting due to previous error
1410

src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
error[E0282]: type annotations needed for `Option<_>`
1+
error[E0282]: type annotations needed
22
--> $DIR/issue-42234-unknown-receiver-type.rs:10:7
33
|
4-
LL | let x: Option<_> = None;
5-
| - consider giving `x` the explicit type `Option<_>`, where the type parameter `T` is specified
64
LL | x.unwrap().method_that_could_exist_on_some_type();
7-
| ^^^^^^ cannot infer type for type parameter `T`
5+
| --^^^^^^--
6+
| | |
7+
| | cannot infer type for type parameter `T`
8+
| this method call resolves to `T`
89
|
910
= note: type must be known at this point
1011

src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
error[E0282]: type annotations needed for `Option<_>`
1+
error[E0282]: type annotations needed
22
--> $DIR/issue-42234-unknown-receiver-type.rs:10:7
33
|
4-
LL | let x: Option<_> = None;
5-
| - consider giving `x` the explicit type `Option<_>`, where the type parameter `T` is specified
64
LL | x.unwrap().method_that_could_exist_on_some_type();
7-
| ^^^^^^ cannot infer type for type parameter `T`
5+
| --^^^^^^--
6+
| | |
7+
| | cannot infer type for type parameter `T`
8+
| this method call resolves to `T`
89
|
910
= note: type must be known at this point
1011

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@ error[E0283]: type annotations needed
22
--> $DIR/issue-77982.rs:8:10
33
|
44
LL | opts.get(opt.as_ref());
5-
| ^^^ ------------ this method call resolves to `&T`
6-
| |
7-
| cannot infer type for type parameter `Q` declared on the associated function `get`
5+
| ^^^ cannot infer type for type parameter `Q` declared on the associated function `get`
86
|
97
= note: cannot satisfy `String: Borrow<_>`
108

119
error[E0283]: type annotations needed
1210
--> $DIR/issue-77982.rs:12:44
1311
|
1412
LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
15-
| ^^^^^^^^^ ----------- this method call resolves to `T`
16-
| |
17-
| cannot infer type for type parameter `T` declared on the trait `From`
13+
| ^^^^^^^^^ cannot infer type for type parameter `T` declared on the trait `From`
1814
|
1915
= note: cannot satisfy `u32: From<_>`
2016
note: required by `from`

src/test/ui/type-inference/sort_by_key.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ error[E0282]: type annotations needed
33
|
44
LL | lst.sort_by_key(|&(v, _)| v.iter().sum());
55
| ^^^^^^^^^^^ cannot infer type for type parameter `K` declared on the associated function `sort_by_key`
6-
|
7-
help: consider specifying the type argument in the method call
8-
|
9-
LL | lst.sort_by_key(|&(v, _)| v.iter().sum::<S>());
10-
| +++++
116

127
error: aborting due to previous error
138

0 commit comments

Comments
 (0)