提交 642ee709 编写于 作者: Y Yuki Okushi

Add test for issue-43623

上级 2d1a551e
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() {}
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`.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册