Add a failing rustdoc-ui test for public infinite recursive type
This commit is contained in:
parent
74864fa496
commit
ca882c015d
4 changed files with 9 additions and 0 deletions
|
@ -0,0 +1,9 @@
|
|||
// check-pass
|
||||
|
||||
pub fn f() -> impl Sized {
|
||||
pub enum E {
|
||||
V(E),
|
||||
}
|
||||
|
||||
unimplemented!()
|
||||
}
|
|
@ -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() {}
|
|
@ -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`.
|
|
@ -0,0 +1,9 @@
|
|||
// check-pass
|
||||
|
||||
fn f() -> impl Sized {
|
||||
enum E {
|
||||
V(E),
|
||||
}
|
||||
|
||||
unimplemented!()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue