Skip to content

Commit 0bf3d11

Browse files
committed
add self-referential param-env normalization regression
1 parent c7b206b commit 0bf3d11

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//~ ERROR overflow evaluating the requirement `Self: StreamingIterator<'_>` [E0275]
2+
// Regression test for <https://github.com/rust-lang/rust/issues/153354>.
3+
4+
trait StreamingIterator<'a> {
5+
type Item: 'a;
6+
}
7+
8+
impl<'b, I, T> StreamingIterator<'b> for I
9+
//~^ ERROR the type parameter `T` is not constrained by the impl trait, self type, or predicates [E0207]
10+
where
11+
I: IntoIterator,
12+
T: FnMut(Self::Item, I::Item),
13+
{
14+
type Item = T;
15+
//~^ ERROR overflow evaluating the requirement `I: IntoIterator` [E0275]
16+
}
17+
18+
fn main() {}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
error[E0275]: overflow evaluating the requirement `Self: StreamingIterator<'_>`
2+
|
3+
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`self_referential_param_env_normalization`)
4+
note: required for `Self` to implement `StreamingIterator<'_>`
5+
--> $DIR/self-referential-param-env-normalization.rs:8:16
6+
|
7+
LL | impl<'b, I, T> StreamingIterator<'b> for I
8+
| ^^^^^^^^^^^^^^^^^^^^^ ^
9+
...
10+
LL | T: FnMut(Self::Item, I::Item),
11+
| -------------------------- unsatisfied trait bound introduced here
12+
= note: 127 redundant requirements hidden
13+
= note: required for `Self` to implement `StreamingIterator<'a>`
14+
15+
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
16+
--> $DIR/self-referential-param-env-normalization.rs:8:13
17+
|
18+
LL | impl<'b, I, T> StreamingIterator<'b> for I
19+
| ^ unconstrained type parameter
20+
21+
error[E0275]: overflow evaluating the requirement `I: IntoIterator`
22+
--> $DIR/self-referential-param-env-normalization.rs:14:17
23+
|
24+
LL | type Item = T;
25+
| ^
26+
|
27+
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`self_referential_param_env_normalization`)
28+
note: required for `I` to implement `StreamingIterator<'_>`
29+
--> $DIR/self-referential-param-env-normalization.rs:8:16
30+
|
31+
LL | impl<'b, I, T> StreamingIterator<'b> for I
32+
| ^^^^^^^^^^^^^^^^^^^^^ ^
33+
...
34+
LL | T: FnMut(Self::Item, I::Item),
35+
| -------------------------- unsatisfied trait bound introduced here
36+
= note: 127 redundant requirements hidden
37+
= note: required for `I` to implement `StreamingIterator<'b>`
38+
39+
error: aborting due to 3 previous errors
40+
41+
Some errors have detailed explanations: E0207, E0275.
42+
For more information about an error, try `rustc --explain E0207`.

0 commit comments

Comments
 (0)