rust/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
441 B
Rust
Raw Normal View History

struct Foo {
config: String,
}
impl Foo {
fn new(cofig: String) -> Self {
Self { config } //~ Error cannot find value `config` in this scope
}
fn do_something(cofig: String) {
println!("{config}"); //~ Error cannot find value `config` in this scope
}
fn self_is_available(self, cofig: String) {
println!("{config}"); //~ Error cannot find value `config` in this scope
}
}
fn main() {}