]> git.proxmox.com Git - rustc.git/blob - tests/ui/error-codes/E0424.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / error-codes / E0424.stderr
1 error[E0424]: expected value, found module `self`
2 --> $DIR/E0424.rs:7:9
3 |
4 LL | fn foo() {
5 | --- this function doesn't have a `self` parameter
6 LL | self.bar();
7 | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
8 |
9 help: add a `self` receiver parameter to make the associated `fn` a method
10 |
11 LL | fn foo(&self) {
12 | +++++
13
14 error[E0424]: expected value, found module `self`
15 --> $DIR/E0424.rs:11:9
16 |
17 LL | fn baz(_: i32) {
18 | --- this function doesn't have a `self` parameter
19 LL | self.bar();
20 | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
21 |
22 help: add a `self` receiver parameter to make the associated `fn` a method
23 |
24 LL | fn baz(&self, _: i32) {
25 | ++++++
26
27 error[E0424]: expected value, found module `self`
28 --> $DIR/E0424.rs:15:20
29 |
30 LL | fn qux() {
31 | --- this function doesn't have a `self` parameter
32 LL | let _ = || self.bar();
33 | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
34 |
35 help: add a `self` receiver parameter to make the associated `fn` a method
36 |
37 LL | fn qux(&self) {
38 | +++++
39
40 error[E0424]: expected unit struct, unit variant or constant, found module `self`
41 --> $DIR/E0424.rs:20:9
42 |
43 LL | fn main () {
44 | ---- this function can't have a `self` parameter
45 LL | let self = "self";
46 | ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
47
48 error: aborting due to 4 previous errors
49
50 For more information about this error, try `rustc --explain E0424`.