ValuePairs::PolyTraitRefs should be called 'trait'
This commit is contained in:
parent
fa68e73e99
commit
acab4464f6
@ -1588,7 +1588,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||||||
Mismatch::Variable(infer::ExpectedFound { expected, found }),
|
Mismatch::Variable(infer::ExpectedFound { expected, found }),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
ValuePairs::TraitRefs(_) => (false, Mismatch::Fixed("trait")),
|
ValuePairs::TraitRefs(_) | ValuePairs::PolyTraitRefs(_) => {
|
||||||
|
(false, Mismatch::Fixed("trait"))
|
||||||
|
}
|
||||||
_ => (false, Mismatch::Fixed("type")),
|
_ => (false, Mismatch::Fixed("type")),
|
||||||
};
|
};
|
||||||
let vals = match self.values_str(values) {
|
let vals = match self.values_str(values) {
|
||||||
|
@ -4,8 +4,8 @@ error[E0308]: mismatched types
|
|||||||
LL | test(gen);
|
LL | test(gen);
|
||||||
| ^^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'a> Generator<&'a mut bool>`
|
= note: expected trait `for<'a> Generator<&'a mut bool>`
|
||||||
found type `Generator<&mut bool>`
|
found trait `Generator<&mut bool>`
|
||||||
note: the lifetime requirement is introduced here
|
note: the lifetime requirement is introduced here
|
||||||
--> $DIR/resume-arg-late-bound.rs:8:17
|
--> $DIR/resume-arg-late-bound.rs:8:17
|
||||||
|
|
|
|
||||||
|
@ -4,8 +4,8 @@ error[E0308]: mismatched types
|
|||||||
LL | foo(bar, "string", |s| s.len() == 5);
|
LL | foo(bar, "string", |s| s.len() == 5);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'r, 's> FnOnce<(&'r &'s str,)>`
|
= note: expected trait `for<'r, 's> FnOnce<(&'r &'s str,)>`
|
||||||
found type `for<'r> FnOnce<(&'r &str,)>`
|
found trait `for<'r> FnOnce<(&'r &str,)>`
|
||||||
note: this closure does not fulfill the lifetime requirements
|
note: this closure does not fulfill the lifetime requirements
|
||||||
--> $DIR/issue-71955.rs:45:24
|
--> $DIR/issue-71955.rs:45:24
|
||||||
|
|
|
|
||||||
@ -23,8 +23,8 @@ error[E0308]: mismatched types
|
|||||||
LL | foo(bar, "string", |s| s.len() == 5);
|
LL | foo(bar, "string", |s| s.len() == 5);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `FnOnce<(&&str,)>`
|
= note: expected trait `FnOnce<(&&str,)>`
|
||||||
found type `for<'r> FnOnce<(&'r &str,)>`
|
found trait `for<'r> FnOnce<(&'r &str,)>`
|
||||||
note: this closure does not fulfill the lifetime requirements
|
note: this closure does not fulfill the lifetime requirements
|
||||||
--> $DIR/issue-71955.rs:45:24
|
--> $DIR/issue-71955.rs:45:24
|
||||||
|
|
|
|
||||||
@ -42,8 +42,8 @@ error[E0308]: mismatched types
|
|||||||
LL | foo(baz, "string", |s| s.0.len() == 5);
|
LL | foo(baz, "string", |s| s.0.len() == 5);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
|
= note: expected trait `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
|
||||||
found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
|
found trait `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
|
||||||
note: this closure does not fulfill the lifetime requirements
|
note: this closure does not fulfill the lifetime requirements
|
||||||
--> $DIR/issue-71955.rs:48:24
|
--> $DIR/issue-71955.rs:48:24
|
||||||
|
|
|
|
||||||
@ -61,8 +61,8 @@ error[E0308]: mismatched types
|
|||||||
LL | foo(baz, "string", |s| s.0.len() == 5);
|
LL | foo(baz, "string", |s| s.0.len() == 5);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `FnOnce<(&Wrapper<'_>,)>`
|
= note: expected trait `FnOnce<(&Wrapper<'_>,)>`
|
||||||
found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
|
found trait `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
|
||||||
note: this closure does not fulfill the lifetime requirements
|
note: this closure does not fulfill the lifetime requirements
|
||||||
--> $DIR/issue-71955.rs:48:24
|
--> $DIR/issue-71955.rs:48:24
|
||||||
|
|
|
|
||||||
|
@ -4,8 +4,8 @@ error[E0308]: mismatched types
|
|||||||
LL | fn select(&self) -> BufferViewHandle<R>;
|
LL | fn select(&self) -> BufferViewHandle<R>;
|
||||||
| ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
| ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
||||||
|
|
|
|
||||||
= note: expected type `Resources<'_>`
|
= note: expected trait `Resources<'_>`
|
||||||
found type `Resources<'a>`
|
found trait `Resources<'a>`
|
||||||
note: the anonymous lifetime defined here...
|
note: the anonymous lifetime defined here...
|
||||||
--> $DIR/issue-27942.rs:5:15
|
--> $DIR/issue-27942.rs:5:15
|
||||||
|
|
|
|
||||||
@ -23,8 +23,8 @@ error[E0308]: mismatched types
|
|||||||
LL | fn select(&self) -> BufferViewHandle<R>;
|
LL | fn select(&self) -> BufferViewHandle<R>;
|
||||||
| ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
| ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
||||||
|
|
|
|
||||||
= note: expected type `Resources<'_>`
|
= note: expected trait `Resources<'_>`
|
||||||
found type `Resources<'a>`
|
found trait `Resources<'a>`
|
||||||
note: the lifetime `'a` as defined here...
|
note: the lifetime `'a` as defined here...
|
||||||
--> $DIR/issue-27942.rs:3:18
|
--> $DIR/issue-27942.rs:3:18
|
||||||
|
|
|
|
||||||
|
@ -31,8 +31,8 @@ error[E0308]: mismatched types
|
|||||||
LL | take_foo(|a| a);
|
LL | take_foo(|a| a);
|
||||||
| ^^^^^^^^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'r> Fn<(&'r i32,)>`
|
= note: expected trait `for<'r> Fn<(&'r i32,)>`
|
||||||
found type `Fn<(&i32,)>`
|
found trait `Fn<(&i32,)>`
|
||||||
note: this closure does not fulfill the lifetime requirements
|
note: this closure does not fulfill the lifetime requirements
|
||||||
--> $DIR/issue-79187-2.rs:8:14
|
--> $DIR/issue-79187-2.rs:8:14
|
||||||
|
|
|
|
||||||
|
@ -4,8 +4,8 @@ error[E0308]: mismatched types
|
|||||||
LL | thing(f);
|
LL | thing(f);
|
||||||
| ^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'r> FnOnce<(&'r u32,)>`
|
= note: expected trait `for<'r> FnOnce<(&'r u32,)>`
|
||||||
found type `FnOnce<(&u32,)>`
|
found trait `FnOnce<(&u32,)>`
|
||||||
note: this closure does not fulfill the lifetime requirements
|
note: this closure does not fulfill the lifetime requirements
|
||||||
--> $DIR/issue-79187.rs:4:13
|
--> $DIR/issue-79187.rs:4:13
|
||||||
|
|
|
|
||||||
|
@ -15,8 +15,8 @@ error[E0308]: mismatched types
|
|||||||
LL | f(data, identity)
|
LL | f(data, identity)
|
||||||
| ^^^^^^^^^^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'r> Fn<(&'r T,)>`
|
= note: expected trait `for<'r> Fn<(&'r T,)>`
|
||||||
found type `Fn<(&T,)>`
|
found trait `Fn<(&T,)>`
|
||||||
note: the lifetime requirement is introduced here
|
note: the lifetime requirement is introduced here
|
||||||
--> $DIR/issue_74400.rs:8:34
|
--> $DIR/issue_74400.rs:8:34
|
||||||
|
|
|
|
||||||
|
@ -13,8 +13,8 @@ error[E0308]: mismatched types
|
|||||||
LL | baz(|_| ());
|
LL | baz(|_| ());
|
||||||
| ^^^^^^^^^^^ one type is more general than the other
|
| ^^^^^^^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'r> Fn<(&'r (),)>`
|
= note: expected trait `for<'r> Fn<(&'r (),)>`
|
||||||
found type `Fn<(&(),)>`
|
found trait `Fn<(&(),)>`
|
||||||
note: this closure does not fulfill the lifetime requirements
|
note: this closure does not fulfill the lifetime requirements
|
||||||
--> $DIR/closure-mismatch.rs:8:9
|
--> $DIR/closure-mismatch.rs:8:9
|
||||||
|
|
|
|
||||||
|
@ -4,8 +4,8 @@ error[E0308]: mismatched types
|
|||||||
LL | f: &id,
|
LL | f: &id,
|
||||||
| ^^^ one type is more general than the other
|
| ^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
|
= note: expected trait `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
|
||||||
found type `Fn<(&Foo<'_>,)>`
|
found trait `Fn<(&Foo<'_>,)>`
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/rfc1623.rs:28:8
|
--> $DIR/rfc1623.rs:28:8
|
||||||
@ -13,8 +13,8 @@ error[E0308]: mismatched types
|
|||||||
LL | f: &id,
|
LL | f: &id,
|
||||||
| ^^^ one type is more general than the other
|
| ^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
|
= note: expected trait `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
|
||||||
found type `Fn<(&Foo<'_>,)>`
|
found trait `Fn<(&Foo<'_>,)>`
|
||||||
|
|
||||||
error: implementation of `FnOnce` is not general enough
|
error: implementation of `FnOnce` is not general enough
|
||||||
--> $DIR/rfc1623.rs:28:8
|
--> $DIR/rfc1623.rs:28:8
|
||||||
|
@ -4,8 +4,8 @@ error[E0308]: mismatched types
|
|||||||
LL | |x| x
|
LL | |x| x
|
||||||
| ^^^^^ one type is more general than the other
|
| ^^^^^ one type is more general than the other
|
||||||
|
|
|
|
||||||
= note: expected type `for<'r> Fn<(&'r X,)>`
|
= note: expected trait `for<'r> Fn<(&'r X,)>`
|
||||||
found type `Fn<(&X,)>`
|
found trait `Fn<(&X,)>`
|
||||||
note: this closure does not fulfill the lifetime requirements
|
note: this closure does not fulfill the lifetime requirements
|
||||||
--> $DIR/issue-57611-trait-alias.rs:21:9
|
--> $DIR/issue-57611-trait-alias.rs:21:9
|
||||||
|
|
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user