ValuePairs::PolyTraitRefs should be called 'trait'

This commit is contained in:
Michael Goulet 2022-06-11 16:25:35 -07:00
parent fa68e73e99
commit acab4464f6
10 changed files with 31 additions and 29 deletions

View File

@ -1588,7 +1588,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
Mismatch::Variable(infer::ExpectedFound { expected, found }),
)
}
ValuePairs::TraitRefs(_) => (false, Mismatch::Fixed("trait")),
ValuePairs::TraitRefs(_) | ValuePairs::PolyTraitRefs(_) => {
(false, Mismatch::Fixed("trait"))
}
_ => (false, Mismatch::Fixed("type")),
};
let vals = match self.values_str(values) {

View File

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | test(gen);
| ^^^^^^^^^ one type is more general than the other
|
= note: expected type `for<'a> Generator<&'a mut bool>`
found type `Generator<&mut bool>`
= note: expected trait `for<'a> Generator<&'a mut bool>`
found trait `Generator<&mut bool>`
note: the lifetime requirement is introduced here
--> $DIR/resume-arg-late-bound.rs:8:17
|

View File

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | foo(bar, "string", |s| s.len() == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `for<'r, 's> FnOnce<(&'r &'s str,)>`
found type `for<'r> FnOnce<(&'r &str,)>`
= note: expected trait `for<'r, 's> FnOnce<(&'r &'s str,)>`
found trait `for<'r> FnOnce<(&'r &str,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:45:24
|
@ -23,8 +23,8 @@ error[E0308]: mismatched types
LL | foo(bar, "string", |s| s.len() == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `FnOnce<(&&str,)>`
found type `for<'r> FnOnce<(&'r &str,)>`
= note: expected trait `FnOnce<(&&str,)>`
found trait `for<'r> FnOnce<(&'r &str,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:45:24
|
@ -42,8 +42,8 @@ error[E0308]: mismatched types
LL | foo(baz, "string", |s| s.0.len() == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
= note: expected trait `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
found trait `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:48:24
|
@ -61,8 +61,8 @@ error[E0308]: mismatched types
LL | foo(baz, "string", |s| s.0.len() == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `FnOnce<(&Wrapper<'_>,)>`
found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
= note: expected trait `FnOnce<(&Wrapper<'_>,)>`
found trait `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:48:24
|

View File

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected type `Resources<'_>`
found type `Resources<'a>`
= note: expected trait `Resources<'_>`
found trait `Resources<'a>`
note: the anonymous lifetime defined here...
--> $DIR/issue-27942.rs:5:15
|
@ -23,8 +23,8 @@ error[E0308]: mismatched types
LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected type `Resources<'_>`
found type `Resources<'a>`
= note: expected trait `Resources<'_>`
found trait `Resources<'a>`
note: the lifetime `'a` as defined here...
--> $DIR/issue-27942.rs:3:18
|

View File

@ -31,8 +31,8 @@ error[E0308]: mismatched types
LL | take_foo(|a| a);
| ^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `for<'r> Fn<(&'r i32,)>`
found type `Fn<(&i32,)>`
= note: expected trait `for<'r> Fn<(&'r i32,)>`
found trait `Fn<(&i32,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-79187-2.rs:8:14
|

View File

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | thing(f);
| ^^^^^^^^ one type is more general than the other
|
= note: expected type `for<'r> FnOnce<(&'r u32,)>`
found type `FnOnce<(&u32,)>`
= note: expected trait `for<'r> FnOnce<(&'r u32,)>`
found trait `FnOnce<(&u32,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-79187.rs:4:13
|

View File

@ -15,8 +15,8 @@ error[E0308]: mismatched types
LL | f(data, identity)
| ^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `for<'r> Fn<(&'r T,)>`
found type `Fn<(&T,)>`
= note: expected trait `for<'r> Fn<(&'r T,)>`
found trait `Fn<(&T,)>`
note: the lifetime requirement is introduced here
--> $DIR/issue_74400.rs:8:34
|

View File

@ -13,8 +13,8 @@ error[E0308]: mismatched types
LL | baz(|_| ());
| ^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `for<'r> Fn<(&'r (),)>`
found type `Fn<(&(),)>`
= note: expected trait `for<'r> Fn<(&'r (),)>`
found trait `Fn<(&(),)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/closure-mismatch.rs:8:9
|

View File

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | f: &id,
| ^^^ one type is more general than the other
|
= note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
found type `Fn<(&Foo<'_>,)>`
= note: expected trait `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
found trait `Fn<(&Foo<'_>,)>`
error[E0308]: mismatched types
--> $DIR/rfc1623.rs:28:8
@ -13,8 +13,8 @@ error[E0308]: mismatched types
LL | f: &id,
| ^^^ one type is more general than the other
|
= note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
found type `Fn<(&Foo<'_>,)>`
= note: expected trait `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
found trait `Fn<(&Foo<'_>,)>`
error: implementation of `FnOnce` is not general enough
--> $DIR/rfc1623.rs:28:8

View File

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | |x| x
| ^^^^^ one type is more general than the other
|
= note: expected type `for<'r> Fn<(&'r X,)>`
found type `Fn<(&X,)>`
= note: expected trait `for<'r> Fn<(&'r X,)>`
found trait `Fn<(&X,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-57611-trait-alias.rs:21:9
|