mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
Add a regression test for #57271
This commit is contained in:
parent
85b7aa2cfb
commit
c99074490b
3 changed files with 60 additions and 0 deletions
11
src/test/ui/issues/auxiliary/issue-57271-lib.rs
Normal file
11
src/test/ui/issues/auxiliary/issue-57271-lib.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
||||
pub enum BaseType {
|
||||
Byte,
|
||||
Char,
|
||||
Double,
|
||||
Float,
|
||||
Int,
|
||||
Long,
|
||||
Short,
|
||||
Boolean,
|
||||
}
|
24
src/test/ui/issues/issue-57271.rs
Normal file
24
src/test/ui/issues/issue-57271.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
// aux-build:issue-57271-lib.rs
|
||||
|
||||
extern crate issue_57271_lib;
|
||||
|
||||
use issue_57271_lib::BaseType;
|
||||
|
||||
pub enum ObjectType { //~ ERROR recursive type `ObjectType` has infinite size
|
||||
Class(ClassTypeSignature),
|
||||
Array(TypeSignature),
|
||||
TypeVariable(()),
|
||||
}
|
||||
|
||||
pub struct ClassTypeSignature {
|
||||
pub package: (),
|
||||
pub class: (),
|
||||
pub inner: (),
|
||||
}
|
||||
|
||||
pub enum TypeSignature { //~ ERROR recursive type `TypeSignature` has infinite size
|
||||
Base(BaseType),
|
||||
Object(ObjectType),
|
||||
}
|
||||
|
||||
fn main() {}
|
25
src/test/ui/issues/issue-57271.stderr
Normal file
25
src/test/ui/issues/issue-57271.stderr
Normal file
|
@ -0,0 +1,25 @@
|
|||
error[E0072]: recursive type `ObjectType` has infinite size
|
||||
--> $DIR/issue-57271.rs:7:1
|
||||
|
|
||||
LL | pub enum ObjectType {
|
||||
| ^^^^^^^^^^^^^^^^^^^ recursive type has infinite size
|
||||
LL | Class(ClassTypeSignature),
|
||||
LL | Array(TypeSignature),
|
||||
| ------------- recursive without indirection
|
||||
|
|
||||
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ObjectType` representable
|
||||
|
||||
error[E0072]: recursive type `TypeSignature` has infinite size
|
||||
--> $DIR/issue-57271.rs:19:1
|
||||
|
|
||||
LL | pub enum TypeSignature {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ recursive type has infinite size
|
||||
LL | Base(BaseType),
|
||||
LL | Object(ObjectType),
|
||||
| ---------- recursive without indirection
|
||||
|
|
||||
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `TypeSignature` representable
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0072`.
|
Loading…
Reference in a new issue