Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/confuse-field-and-method/issue-32128.rs

16 lines
253 B
Rust
Raw Normal View History

Remove NOTE/HELP annotations from UI tests
2017-12-10 23:29:24 +03:00
struct Example {
Update ui test suite to use dyn
2019-05-28 14:46:13 -04:00
example: Box<dyn Fn(i32) -> i32>
Autoderef when suggesting to call `(self.field)` Fixes #32128
2016-04-03 22:58:44 +02:00
}
fn main() {
let demo = Example {
example: Box::new(|x| {
x + 1
})
};
Clarify suggetion for field used as method Instead of ``` error: no method named `src_addr` found for type `&wire::ipv4::Repr` in the current scope --> src/wire/ipv4.rs:409:34 | 409 | packet.set_src_addr(self.src_addr()); | ^^^^^^^^ | note: did you mean to write `self.src_addr`? --> src/wire/ipv4.rs:409:34 | 409 | packet.set_src_addr(self.src_addr()); | ^^^^^^^^ ``` present ``` error: no method named `src_addr` found for type `&wire::ipv4::Repr` in the current scope --> src/wire/ipv4.rs:409:34 | 409 | packet.set_src_addr(self.src_addr()); | ^^^^^^^^ `src_addr` is a field, not a method | = help: did you mean to write `self.src_addr` instead of `self.src_addr(...)`? ```
2017-03-24 23:40:24 -07:00
demo.example(1);
//~^ ERROR no method named `example`
Autoderef when suggesting to call `(self.field)` Fixes #32128
2016-04-03 22:58:44 +02:00
// (demo.example)(1);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2487ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API