2018-11-25 00:23:11 +00:00
|
|
|
#[derive(Debug)]
|
|
|
|
enum Shape {
|
|
|
|
Square { size: i32 },
|
|
|
|
Circle { radius: i32 },
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
x: usize,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-01-08 16:05:31 +00:00
|
|
|
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`
|
2019-04-08 21:58:18 +00:00
|
|
|
Shape::Squareee; //~ ERROR no variant
|
|
|
|
Shape::Circl; //~ ERROR no variant
|
|
|
|
Shape::Rombus; //~ ERROR no variant
|
2018-11-25 00:23:11 +00:00
|
|
|
}
|