mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-01 21:45:15 +00:00
When encountering a `match` or `if` as a tail expression where the different arms do not have the same type *and* the return type of that `fn` is an `impl Trait`, check whether those arms can implement `Trait` and if so, suggest using boxed trait objects.
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.