1
Fork 0

Accept less invalid Rust in rustdoc

This commit is contained in:
Oli Scherer 2023-10-31 13:58:03 +00:00
parent 22b27120b9
commit 4512f211ae
35 changed files with 428 additions and 127 deletions

View file

@ -1,7 +1,6 @@
// check-pass
pub fn f() -> impl Sized {
pub enum E {
//~^ ERROR: recursive type
V(E),
}

View file

@ -0,0 +1,17 @@
error[E0072]: recursive type `f::E` has infinite size
--> $DIR/infinite-recursive-type-2.rs:2:5
|
LL | pub enum E {
| ^^^^^^^^^^
LL |
LL | V(E),
| - recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | V(Box<E>),
| ++++ +
error: aborting due to previous error
For more information about this error, try `rustc --explain E0072`.

View file

@ -1,7 +1,6 @@
// check-pass
fn f() -> impl Sized {
enum E {
//~^ ERROR: recursive type
V(E),
}

View file

@ -0,0 +1,17 @@
error[E0072]: recursive type `f::E` has infinite size
--> $DIR/infinite-recursive-type.rs:2:5
|
LL | enum E {
| ^^^^^^
LL |
LL | V(E),
| - recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | V(Box<E>),
| ++++ +
error: aborting due to previous error
For more information about this error, try `rustc --explain E0072`.