]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0424.stderr
Rollup merge of #75485 - RalfJung:pin, r=nagisa
[rust.git] / src / test / 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 unit struct, unit variant or constant, found module `self`
28   --> $DIR/E0424.rs:16:9
29    |
30 LL | fn main () {
31    |    ---- this function can't have a `self` parameter
32 LL |     let self = "self";
33    |         ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
34
35 error: aborting due to 3 previous errors
36
37 For more information about this error, try `rustc --explain E0424`.