summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/method-access-to-range-literal-typo.stderr
blob: 54a16b8efa748b8c1fd96201e88527820c38f496 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
error[E0425]: cannot find function `foo` in this scope
  --> $DIR/method-access-to-range-literal-typo.rs:26:22
   |
LL |         self.option..foo().get(0)
   |                      ^^^ not found in this scope
   |
help: you might have meant to write `.` instead of `..`
   |
LL -         self.option..foo().get(0)
LL +         self.option.foo().get(0)
   |

error[E0308]: mismatched types
  --> $DIR/method-access-to-range-literal-typo.rs:22:9
   |
LL |     fn method(&self) -> Option<&Vec<u8>> {
   |                         ---------------- expected `Option<&Vec<u8>>` because of return type
LL |         self.option..as_ref().map(|x| x)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&Vec<u8>>`, found `Range<Option<Vec<u8>>>`
   |
   = note: expected enum `Option<&Vec<u8>>`
            found struct `std::ops::Range<Option<Vec<u8>>>`
help: you likely meant to write a method call instead of a range
   |
LL -         self.option..as_ref().map(|x| x)
LL +         self.option.as_ref().map(|x| x)
   |

error[E0308]: mismatched types
  --> $DIR/method-access-to-range-literal-typo.rs:26:9
   |
LL |     fn method2(&self) -> Option<&u8> {
   |                          ----------- expected `Option<&u8>` because of return type
LL |         self.option..foo().get(0)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&u8>`, found `Range<Option<Vec<u8>>>`
   |
   = note: expected enum `Option<&u8>`
            found struct `std::ops::Range<Option<Vec<u8>>>`
help: you likely meant to write a method call instead of a range
   |
LL -         self.option..foo().get(0)
LL +         self.option.foo().get(0)
   |

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0308, E0425.
For more information about an error, try `rustc --explain E0308`.