2022-12-15 18:24:42 -06:00
|
|
|
error[E0425]: cannot find function `foo` in this scope
|
2023-01-08 16:31:47 -06:00
|
|
|
--> $DIR/method-access-to-range-literal-typo.rs:26:22
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
2022-12-27 11:25:00 -06:00
|
|
|
LL | self.option..foo().get(0)
|
2022-12-15 18:24:42 -06:00
|
|
|
| ^^^ not found in this scope
|
|
|
|
|
|
2022-12-27 14:16:25 -06:00
|
|
|
help: you might have meant to write `.` instead of `..`
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
2022-12-27 11:25:00 -06:00
|
|
|
LL - self.option..foo().get(0)
|
|
|
|
LL + self.option.foo().get(0)
|
|
|
|
|
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2023-01-08 16:31:47 -06:00
|
|
|
--> $DIR/method-access-to-range-literal-typo.rs:22:9
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
2023-01-08 16:31:47 -06:00
|
|
|
LL | fn method(&self) -> Option<&Vec<u8>> {
|
|
|
|
| ---------------- expected `Option<&Vec<u8>>` because of return type
|
2022-12-15 18:24:42 -06:00
|
|
|
LL | self.option..as_ref().map(|x| x)
|
2023-01-02 20:00:33 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&Vec<u8>>`, found `Range<Option<Vec<u8>>>`
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
2023-01-08 16:31:47 -06:00
|
|
|
= note: expected enum `Option<&Vec<u8>>`
|
|
|
|
found struct `std::ops::Range<Option<Vec<u8>>>`
|
2022-12-27 11:25:00 -06:00
|
|
|
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)
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2023-01-08 16:31:47 -06:00
|
|
|
--> $DIR/method-access-to-range-literal-typo.rs:26:9
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
2023-01-08 16:31:47 -06:00
|
|
|
LL | fn method2(&self) -> Option<&u8> {
|
|
|
|
| ----------- expected `Option<&u8>` because of return type
|
2022-12-27 11:25:00 -06:00
|
|
|
LL | self.option..foo().get(0)
|
2023-01-02 20:00:33 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&u8>`, found `Range<Option<Vec<u8>>>`
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
2023-01-08 16:31:47 -06:00
|
|
|
= note: expected enum `Option<&u8>`
|
|
|
|
found struct `std::ops::Range<Option<Vec<u8>>>`
|
2022-12-27 11:25:00 -06:00
|
|
|
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)
|
2022-12-15 18:24:42 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0308, E0425.
|
|
|
|
For more information about an error, try `rustc --explain E0308`.
|