{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreia3pdrzq2crmv3bz2lmcxdqpann6kanjkoiv7bjsqky3a2o2mvj2u",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mm7xrmp4bjf2"
},
"path": "/t/pre-rfc-improved-ergonomics-for/24336#post_12",
"publishedAt": "2026-05-19T16:43:53.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "I'd expect the mapping to be `!` to `T` for an arbitrary `T`. `()` is only mentioned as current convention is generally to use `()` for situations where `!` would be appropriate.\n\nThe problem with a trait is that the `map_try` would need to apply (iteratively) to the outer wrapper(s). `impl<T,U> MapTry for T<U> where U: ...` isn't valid.\n\nAs for why it avoids the mapping problem: The introduction of `!` allows for this to happen. Right now moving from an `Option<Result<(), E>>` to an `Option<Result<T, E>>` requires you to define some default value to `T` via nested maps etc. It's clear why that _must_ be the case for `()`, but `!` is clear - this never occurs, so you're only ever going to get `None` or `Some(Err(_))`",
"title": "Pre-RFC improved ergonomics for `!`"
}