fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
390 B19 linesraw
1// run-rustfix
2struct Rectangle {
3    width: i32,
4    height: i32,
5}
6impl Rectangle {
7    fn new(width: i32, height: i32) -> Self {
8        Self { width, height }
9    }
10    fn area(&self) -> i32 {
11        self.height * self.width
12    }
13}
14
15fn main() {
16    let rect = Rectangle::new(3, 4);
17    let _ = rect.area();
18    //~^ ERROR failed to resolve: use of undeclared crate or module `rect`
19}