]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/method-access-to-range-literal-typo.stderr
Rollup merge of #106805 - madsravn:master, r=compiler-errors
[rust.git] / tests / ui / suggestions / method-access-to-range-literal-typo.stderr
1 error[E0425]: cannot find function `foo` in this scope
2   --> $DIR/method-access-to-range-literal-typo.rs:26:22
3    |
4 LL |         self.option..foo().get(0)
5    |                      ^^^ not found in this scope
6    |
7 help: you might have meant to write `.` instead of `..`
8    |
9 LL -         self.option..foo().get(0)
10 LL +         self.option.foo().get(0)
11    |
12
13 error[E0308]: mismatched types
14   --> $DIR/method-access-to-range-literal-typo.rs:22:9
15    |
16 LL |     fn method(&self) -> Option<&Vec<u8>> {
17    |                         ---------------- expected `Option<&Vec<u8>>` because of return type
18 LL |         self.option..as_ref().map(|x| x)
19    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&Vec<u8>>`, found `Range<Option<Vec<u8>>>`
20    |
21    = note: expected enum `Option<&Vec<u8>>`
22             found struct `std::ops::Range<Option<Vec<u8>>>`
23 help: you likely meant to write a method call instead of a range
24    |
25 LL -         self.option..as_ref().map(|x| x)
26 LL +         self.option.as_ref().map(|x| x)
27    |
28
29 error[E0308]: mismatched types
30   --> $DIR/method-access-to-range-literal-typo.rs:26:9
31    |
32 LL |     fn method2(&self) -> Option<&u8> {
33    |                          ----------- expected `Option<&u8>` because of return type
34 LL |         self.option..foo().get(0)
35    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&u8>`, found `Range<Option<Vec<u8>>>`
36    |
37    = note: expected enum `Option<&u8>`
38             found struct `std::ops::Range<Option<Vec<u8>>>`
39 help: you likely meant to write a method call instead of a range
40    |
41 LL -         self.option..foo().get(0)
42 LL +         self.option.foo().get(0)
43    |
44
45 error: aborting due to 3 previous errors
46
47 Some errors have detailed explanations: E0308, E0425.
48 For more information about an error, try `rustc --explain E0308`.