reduce ICE reproducer

This commit is contained in:
Takayuki Maeda
2026-04-08 23:55:26 +09:00
parent dbf8681242
commit 205dd6f50b
2 changed files with 33 additions and 73 deletions
@@ -3,30 +3,16 @@
#![feature(return_type_notation)]
pub trait Foo {
async fn bar();
}
trait Bar {}
impl<T: Foo<bar(..): Send>> Foo for T where T: Bar {}
//~^ ERROR not all trait items implemented, missing: `bar`
fn needs_foo(_: impl Foo) {}
trait Mirror {
type Mirror;
}
impl<T> Mirror for T {
type Mirror = T;
pub trait Trait {
async fn func();
}
fn hello<T>()
where
<T as Mirror>::Mirror: Foo,
{
needs_foo(());
//~^ ERROR the trait bound `(): Foo` is not satisfied
//~| ERROR overflow evaluating the requirement
}
impl<T: Trait<func(..): Send>> Trait for T {}
//~^ ERROR not all trait items implemented, missing: `func`
fn main() {}
fn check(_: impl Trait) {}
fn main() {
check(());
//~^ ERROR overflow evaluating the requirement
}
@@ -1,60 +1,34 @@
error[E0046]: not all trait items implemented, missing: `bar`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:11:1
error[E0046]: not all trait items implemented, missing: `func`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:10:1
|
LL | async fn bar();
| --------------- `bar` from trait
LL | async fn func();
| ---------------- `func` from trait
...
LL | impl<T: Foo<bar(..): Send>> Foo for T where T: Bar {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bar` in implementation
LL | impl<T: Trait<func(..): Send>> Trait for T {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `func` in implementation
error[E0277]: the trait bound `(): Foo` is not satisfied
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:27:15
error[E0275]: overflow evaluating the requirement `impl Future<Output = ()> { <() as Trait>::func(..) } == _`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:16:5
|
LL | needs_foo(());
| --------- ^^ the trait `Bar` is not implemented for `()`
| |
| required by a bound introduced by this call
LL | check(());
| ^^^^^^^^^
|
help: this trait has no implementations, consider adding one
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:9:1
note: required for `()` to implement `Trait`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:10:32
|
LL | trait Bar {}
| ^^^^^^^^^
note: required for `()` to implement `Foo`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:11:29
|
LL | impl<T: Foo<bar(..): Send>> Foo for T where T: Bar {}
| ^^^ ^ --- unsatisfied trait bound introduced here
LL | impl<T: Trait<func(..): Send>> Trait for T {}
| ---- ^^^^^ ^
| |
| unsatisfied trait bound introduced here
= note: 1 redundant requirement hidden
= note: required for `()` to implement `Foo`
note: required by a bound in `needs_foo`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:14:22
= note: required for `()` to implement `Trait`
note: required by a bound in `check`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:13:18
|
LL | fn needs_foo(_: impl Foo) {}
| ^^^ required by this bound in `needs_foo`
LL | fn check(_: impl Trait) {}
| ^^^^^ required by this bound in `check`
error[E0275]: overflow evaluating the requirement `impl Future<Output = ()> { <() as Foo>::bar(..) } == _`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:27:5
|
LL | needs_foo(());
| ^^^^^^^^^^^^^
|
note: required for `()` to implement `Foo`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:11:29
|
LL | impl<T: Foo<bar(..): Send>> Foo for T where T: Bar {}
| ---- ^^^ ^
| |
| unsatisfied trait bound introduced here
= note: 1 redundant requirement hidden
= note: required for `()` to implement `Foo`
note: required by a bound in `needs_foo`
--> $DIR/return-type-notation-where-clause-doesnt-apply.rs:14:22
|
LL | fn needs_foo(_: impl Foo) {}
| ^^^ required by this bound in `needs_foo`
error: aborting due to 2 previous errors
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0046, E0275, E0277.
Some errors have detailed explanations: E0046, E0275.
For more information about an error, try `rustc --explain E0046`.