Rollup merge of #97398 - JohnTitor:issue-82830, r=compiler-errors
Add regression test for #82830 Closes #82830 r? `@compiler-errors`
This commit is contained in:
commit
5d43ae8ece
2 changed files with 31 additions and 0 deletions
16
src/test/ui/traits/issue-82830.rs
Normal file
16
src/test/ui/traits/issue-82830.rs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
trait A<Y, N> {
|
||||||
|
type B;
|
||||||
|
}
|
||||||
|
|
||||||
|
type MaybeBox<T> = <T as A<T, Box<T>>>::B;
|
||||||
|
struct P {
|
||||||
|
t: MaybeBox<P>, //~ ERROR: overflow evaluating the requirement `P: Sized`
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<Y, N> A<Y, N> for P {
|
||||||
|
type B = N;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let t: MaybeBox<P>;
|
||||||
|
}
|
15
src/test/ui/traits/issue-82830.stderr
Normal file
15
src/test/ui/traits/issue-82830.stderr
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
error[E0275]: overflow evaluating the requirement `P: Sized`
|
||||||
|
--> $DIR/issue-82830.rs:7:8
|
||||||
|
|
|
||||||
|
LL | t: MaybeBox<P>,
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
note: required because of the requirements on the impl of `A<P, Box<P>>` for `P`
|
||||||
|
--> $DIR/issue-82830.rs:10:12
|
||||||
|
|
|
||||||
|
LL | impl<Y, N> A<Y, N> for P {
|
||||||
|
| ^^^^^^^ ^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0275`.
|
Loading…
Add table
Add a link
Reference in a new issue