Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #33303 - Aatch:mir-coercion-cast, r=arielb1
[MIR] Handle coercion casts properly when building the MIR Coercion casts (`expr as T` where the type of `expr` can be coerced to `T`) are essentially no-ops, as the actual work is done by a coercion. Previously a check for type equality was used to avoid emitting the redundant cast in the MIR, but this failed for coercion casts of function items that had lifetime parameters. The MIR trans code doesn't handle `FnPtr -> FnPtr` casts and produced an error. Also fixes a bug with type ascription expressions not having any adjustments applied. Fixes #33295 /cc @eddyb
- Loading branch information