diff options
| author | Caio <c410.f3r@gmail.com> | 2022-11-20 20:08:14 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2022-11-20 20:08:14 -0300 |
| commit | 70db20e5030173ae767036f92d7d60a59683f592 (patch) | |
| tree | 1523648e1ef9f32592faca8382bdffc623b82cf9 /src/test/ui/resolve | |
| parent | a28f3c88e50a77bc2a91889241248c4543854e61 (diff) | |
| download | rust-70db20e5030173ae767036f92d7d60a59683f592.tar.gz rust-70db20e5030173ae767036f92d7d60a59683f592.zip | |
Move tests
Diffstat (limited to 'src/test/ui/resolve')
| -rw-r--r-- | src/test/ui/resolve/issue-60057.rs | 19 | ||||
| -rw-r--r-- | src/test/ui/resolve/issue-60057.stderr | 15 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/test/ui/resolve/issue-60057.rs b/src/test/ui/resolve/issue-60057.rs new file mode 100644 index 00000000000..b52343adaee --- /dev/null +++ b/src/test/ui/resolve/issue-60057.rs @@ -0,0 +1,19 @@ +struct A { + banana: u8, +} + +impl A { + fn new(peach: u8) -> A { + A { + banana: banana //~ ERROR cannot find value `banana` in this scope + } + } + + fn foo(&self, peach: u8) -> A { + A { + banana: banana //~ ERROR cannot find value `banana` in this scope + } + } +} + +fn main() {} diff --git a/src/test/ui/resolve/issue-60057.stderr b/src/test/ui/resolve/issue-60057.stderr new file mode 100644 index 00000000000..4d915fcd9fe --- /dev/null +++ b/src/test/ui/resolve/issue-60057.stderr @@ -0,0 +1,15 @@ +error[E0425]: cannot find value `banana` in this scope + --> $DIR/issue-60057.rs:8:21 + | +LL | banana: banana + | ^^^^^^ a field by this name exists in `Self` + +error[E0425]: cannot find value `banana` in this scope + --> $DIR/issue-60057.rs:14:21 + | +LL | banana: banana + | ^^^^^^ help: you might have meant to use the available field: `self.banana` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0425`. |
