Files
rust/src/test/ui/suggestions/method-access-to-range-literal-typo.rs

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

23 lines
413 B
Rust
Raw Normal View History

fn as_ref() -> Option<Vec<u8>> {
None
}
struct Type {
option: Option<Vec<u8>>
}
impl Type {
fn method(&self) -> Option<Vec<u8>> {
self.option..as_ref().map(|x| x)
//~^ ERROR E0308
}
fn method2(&self) -> Option<Vec<u8>> {
self.option..foo().map(|x| x)
//~^ ERROR E0425
//~| ERROR E0308
}
}
fn main() {
let _ = Type { option: None }.method();
}