You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
2
+
--> $DIR/class-implements-bad-trait.rs:4:21
3
3
|
4
-
LL | class cat : nonexistent {
5
-
| ^^^ expected one of `!` or `::`
4
+
LL | new(in_x : usize) { self.meows = in_x; }
5
+
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
6
6
7
-
error: aborting due to previous error
7
+
error: statements cannot reside in modules
8
+
--> $DIR/class-implements-bad-trait.rs:2:1
9
+
|
10
+
LL | class cat : nonexistent {
11
+
| _^^^^^___________________^
12
+
LL | | let meows: usize;
13
+
LL | | new(in_x : usize) { self.meows = in_x; }
14
+
LL | | }
15
+
| |_^
16
+
|
17
+
= note: the program entry point starts in `fn main() { ... }`, defined in `main.rs`
18
+
= note: for more on functions and how to structure your program, see https://doc.rust-lang.org/book/ch03-03-how-functions-work.html
19
+
help: consider moving the statements into a function
20
+
|
21
+
LL | fn my_function() -> _ {
22
+
LL | class;
23
+
LL | cat: nonexistent;
24
+
LL | { let meows: usize; (/*ERROR*/) }
25
+
LL | }
26
+
|
27
+
28
+
error[E0425]: cannot find function `cat` in this scope
29
+
--> $DIR/class-implements-bad-trait.rs:8:14
30
+
|
31
+
LL | let nyan = cat(0);
32
+
| ^^^ not found in this scope
33
+
34
+
error: aborting due to 3 previous errors
8
35
36
+
For more information about this error, try `rustc --explain E0425`.
0 commit comments