mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
19 lines
534 B
Rust
19 lines
534 B
Rust
#[derive(Debug)]
|
|
enum Shape {
|
|
Square { size: i32 },
|
|
Circle { radius: i32 },
|
|
}
|
|
|
|
struct S {
|
|
x: usize,
|
|
}
|
|
|
|
fn main() {
|
|
println!("My shape is {:?}", Shape::Squareee { size: 5}); //~ ERROR no variant named `Squareee`
|
|
println!("My shape is {:?}", Shape::Circl { size: 5}); //~ ERROR no variant named `Circl`
|
|
println!("My shape is {:?}", Shape::Rombus{ size: 5}); //~ ERROR no variant named `Rombus`
|
|
Shape::Squareee; //~ ERROR no variant
|
|
Shape::Circl; //~ ERROR no variant
|
|
Shape::Rombus; //~ ERROR no variant
|
|
}
|