-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #60644 - estebank:abolish-ice, r=varkor
Use `delay_span_bug` for "Failed to unify obligation" Fix #60283.
- Loading branch information
Showing
3 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
pub trait Trait<'a> { | ||
type Item; | ||
} | ||
|
||
impl<'a> Trait<'a> for () { | ||
type Item = (); | ||
} | ||
|
||
pub fn foo<T, F>(_: T, _: F) | ||
where T: for<'a> Trait<'a>, | ||
F: for<'a> FnMut(<T as Trait<'a>>::Item) {} | ||
|
||
fn main() { | ||
foo((), drop) | ||
//~^ ERROR type mismatch in function arguments | ||
//~| ERROR type mismatch resolving | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
error[E0631]: type mismatch in function arguments | ||
--> $DIR/issue-60283.rs:14:5 | ||
| | ||
LL | foo((), drop) | ||
| ^^^ | ||
| | | ||
| expected signature of `for<'a> fn(<() as Trait<'a>>::Item) -> _` | ||
| found signature of `fn(_) -> _` | ||
| | ||
note: required by `foo` | ||
--> $DIR/issue-60283.rs:9:1 | ||
| | ||
LL | / pub fn foo<T, F>(_: T, _: F) | ||
LL | | where T: for<'a> Trait<'a>, | ||
LL | | F: for<'a> FnMut(<T as Trait<'a>>::Item) {} | ||
| |_________________________________________________^ | ||
|
||
error[E0271]: type mismatch resolving `for<'a> <fn(_) {std::mem::drop::<_>} as std::ops::FnOnce<(<() as Trait<'a>>::Item,)>>::Output == ()` | ||
--> $DIR/issue-60283.rs:14:5 | ||
| | ||
LL | foo((), drop) | ||
| ^^^ expected bound lifetime parameter 'a, found concrete lifetime | ||
| | ||
note: required by `foo` | ||
--> $DIR/issue-60283.rs:9:1 | ||
| | ||
LL | / pub fn foo<T, F>(_: T, _: F) | ||
LL | | where T: for<'a> Trait<'a>, | ||
LL | | F: for<'a> FnMut(<T as Trait<'a>>::Item) {} | ||
| |_________________________________________________^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0271`. |