Closed
Description
We should extend rustc_on_unimplemented
to be able to point at the enclosing scope. With that capability, we could turn the following:
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> src/lib.rs:28:31
|
28 | let end = parse_range_u32(end)?;
| ^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `std::ops::RangeInclusive<u32>`
|
= help: the trait `std::ops::Try` is not implemented for `std::ops::RangeInclusive<u32>`
= note: required by `std::ops::Try::from_error`
into something along the lines of
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> src/lib.rs:28:31
|
24 | .map(|range_spec| {
| -
| ______________|
... |
28 || let end = parse_range_u32(end)?;
|| ^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `std::ops::RangeInclusive<u32>`
... |
48 || })
|| - this function should return `Result` or `Option` to accept `?`
||_________|
|
= help: the trait `std::ops::Try` is not implemented for `std::ops::RangeInclusive<u32>`
= note: required by `std::ops::Try::from_error`