mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Add test for issue-43623
This commit is contained in:
parent
2d1a551e14
commit
642ee70942
19
src/test/ui/issues/issue-43623.rs
Normal file
19
src/test/ui/issues/issue-43623.rs
Normal file
@ -0,0 +1,19 @@
|
||||
pub trait Trait<'a> {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
pub struct Type;
|
||||
|
||||
impl<'a> Trait<'a> for Type {
|
||||
type Assoc = ();
|
||||
}
|
||||
|
||||
pub fn break_me<T, F>(f: F)
|
||||
where T: for<'b> Trait<'b>,
|
||||
F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
|
||||
break_me::<Type, fn(_)>;
|
||||
//~^ ERROR: type mismatch in function arguments
|
||||
//~| ERROR: type mismatch resolving
|
||||
}
|
||||
|
||||
fn main() {}
|
42
src/test/ui/issues/issue-43623.stderr
Normal file
42
src/test/ui/issues/issue-43623.stderr
Normal file
@ -0,0 +1,42 @@
|
||||
error[E0631]: type mismatch in function arguments
|
||||
--> $DIR/issue-43623.rs:14:5
|
||||
|
|
||||
LL | break_me::<Type, fn(_)>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| expected signature of `for<'b> fn(<Type as Trait<'b>>::Assoc) -> _`
|
||||
| found signature of `fn(_) -> _`
|
||||
|
|
||||
note: required by `break_me`
|
||||
--> $DIR/issue-43623.rs:11:1
|
||||
|
|
||||
LL | / pub fn break_me<T, F>(f: F)
|
||||
LL | | where T: for<'b> Trait<'b>,
|
||||
LL | | F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
|
||||
LL | | break_me::<Type, fn(_)>;
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
error[E0271]: type mismatch resolving `for<'b> <fn(_) as std::ops::FnOnce<(<Type as Trait<'b>>::Assoc,)>>::Output == ()`
|
||||
--> $DIR/issue-43623.rs:14:5
|
||||
|
|
||||
LL | break_me::<Type, fn(_)>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'b, found concrete lifetime
|
||||
|
|
||||
note: required by `break_me`
|
||||
--> $DIR/issue-43623.rs:11:1
|
||||
|
|
||||
LL | / pub fn break_me<T, F>(f: F)
|
||||
LL | | where T: for<'b> Trait<'b>,
|
||||
LL | | F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
|
||||
LL | | break_me::<Type, fn(_)>;
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0271`.
|
Loading…
Reference in New Issue
Block a user