rust/src/test/ui/suggestions/suggest-variants.rs

16 lines
395 B
Rust
Raw Normal View History

2018-11-24 18:23:11 -06:00
#[derive(Debug)]
enum Shape {
Square { size: i32 },
Circle { radius: i32 },
}
struct S {
x: usize,
}
fn main() {
2018-11-27 03:56:36 -06:00
println!("My shape is {:?}", Shape::Squareee { size: 5}); //~ ERROR no variant `Squareee`
println!("My shape is {:?}", Shape::Circl { size: 5}); //~ ERROR no variant `Circl`
println!("My shape is {:?}", Shape::Rombus{ size: 5}); //~ ERROR no variant `Rombus`
2018-11-24 18:23:11 -06:00
}