add test for ICE: failed to resolve instance for <fn() -> impl ...> #123145
Fixes https://github.com/rust-lang/rust/issues/123145
This commit is contained in:
parent
7836909402
commit
7c43bc0378
20
tests/ui/impl-trait/failed-to-resolve-instance-ice-123145.rs
Normal file
20
tests/ui/impl-trait/failed-to-resolve-instance-ice-123145.rs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// ICE failed to resolve instance for ...
|
||||||
|
// issue: rust-lang/rust#123145
|
||||||
|
//@ build-fail
|
||||||
|
//~^^^ ERROR overflow evaluating the requirement `(fn() -> impl Handler
|
||||||
|
|
||||||
|
trait Handler {
|
||||||
|
fn handle(&self) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<H: Handler, F: Fn() -> H> Handler for F {}
|
||||||
|
|
||||||
|
impl<L: Handler> Handler for (L,) {}
|
||||||
|
|
||||||
|
fn one() -> impl Handler {
|
||||||
|
(one,)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
one.handle();
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
error[E0275]: overflow evaluating the requirement `(fn() -> impl Handler {one},): Handler`
|
||||||
|
|
|
||||||
|
note: required for `fn() -> impl Handler {one}` to implement `Handler`
|
||||||
|
--> $DIR/failed-to-resolve-instance-ice-123145.rs:10:32
|
||||||
|
|
|
||||||
|
LL | impl<H: Handler, F: Fn() -> H> Handler for F {}
|
||||||
|
| ------- ^^^^^^^ ^
|
||||||
|
| |
|
||||||
|
| unsatisfied trait bound introduced here
|
||||||
|
= note: 2 redundant requirements hidden
|
||||||
|
= note: required for `fn() -> impl Handler {one}` to implement `Handler`
|
||||||
|
|
||||||
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0275`.
|
Loading…
Reference in New Issue
Block a user