1
Fork 0

Add a failing rustdoc-ui test for public infinite recursive type

This commit is contained in:
Guillaume Gomez 2023-04-18 11:47:29 +02:00
parent 74864fa496
commit ca882c015d
4 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,9 @@
// check-pass
pub fn f() -> impl Sized {
pub enum E {
V(E),
}
unimplemented!()
}

View file

@ -0,0 +1,14 @@
// normalize-stderr-test: "`.*`" -> "`DEF_ID`"
// normalize-stdout-test: "`.*`" -> "`DEF_ID`"
// edition:2018
pub async fn f() -> impl std::fmt::Debug {
#[derive(Debug)]
enum E { //~ ERROR
This(E),
Unit,
}
E::Unit
}
fn main() {}

View file

@ -0,0 +1,16 @@
error[E0072]: recursive type `DEF_ID` has infinite size
--> $DIR/infinite-recursive-type-impl-trait-return.rs:7:5
|
LL | enum E {
| ^^^^^^
LL | This(E),
| - recursive without indirection
|
help: insert some indirection (e.g., a `DEF_ID`) to break the cycle
|
LL | This(Box<E>),
| ++++ +
error: aborting due to previous error
For more information about this error, try `DEF_ID`.

View file

@ -0,0 +1,9 @@
// check-pass
fn f() -> impl Sized {
enum E {
V(E),
}
unimplemented!()
}