rust/tests/ui/resolve/issue-103474.rs

29 lines
506 B
Rust
Raw Normal View History

struct S {}
impl S {
fn first(&self) {}
fn second(&self) {
first()
//~^ ERROR cannot find function `first` in this scope
}
fn third(&self) {
no_method_err()
//~^ ERROR cannot find function `no_method_err` in this scope
}
}
2022-10-25 16:32:19 -05:00
// https://github.com/rust-lang/rust/pull/103531#discussion_r1004728080
struct Foo {
i: i32,
}
impl Foo {
fn needs_self() {
this.i
//~^ ERROR cannot find value `this` in this scope
}
}
fn main() {}