mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
dbc9d71b17
Lower `?` to `Try` instead of `Carrier` The easy parts of https://github.com/rust-lang/rfcs/pull/1859, whose FCP completed without further comments. Just the trait and the lowering -- neither the error message improvements nor the insta-stable impl for Option nor exhaustive docs. Based on a [github search](https://github.com/search?l=rust&p=1&q=question_mark_carrier&type=Code&utf8=%E2%9C%93), this will break the following: - https://github.com/pfpacket/rust-9p/blob/00206e34c680198a0ac7c2f066cc2954187d4fac/src/serialize.rs#L38 - https://github.com/peterdelevoryas/bufparse/blob/b1325898f4fc2c67658049196c12da82548af350/src/result.rs#L50 The other results appear to be files from libcore or its tests. I could also leave Carrier around after stage0 and `impl<T:Carrier> Try for T` if that would be better. r? @nikomatsakis Edit: Oh, and it might accidentally improve perf, based on https://github.com/rust-lang/rust/issues/37939#issuecomment-265803670, since `Try::into_result` for `Result` is an obvious no-op, unlike `Carrier::translate`.