mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
29 lines
506 B
Rust
29 lines
506 B
Rust
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
|
|
}
|
|
}
|
|
|
|
// 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() {}
|