Bug
In compiler/rustc_middle/src/ty/util.rs, struct_tail_raw (line 299) handles ty::Pat(inner, _) by peeling through to the inner type, but struct_lockstep_tails_raw (line 341) does not. This function is used for unsizing coercions. When both source and target are pattern types wrapping different inner types, the lockstep walk stops prematurely at the Pat layer instead of peeling through to compare inner types.
Impact
Unsizing coercions through pattern types fail or produce wrong tail types.
Pattern types are unstable (feature(pattern_types)), limiting impact to nightly users.
Fix
PR #475
Bug
In
compiler/rustc_middle/src/ty/util.rs,struct_tail_raw(line 299) handlesty::Pat(inner, _)by peeling through to the inner type, butstruct_lockstep_tails_raw(line 341) does not. This function is used for unsizing coercions. When both source and target are pattern types wrapping different inner types, the lockstep walk stops prematurely at thePatlayer instead of peeling through to compare inner types.Impact
Unsizing coercions through pattern types fail or produce wrong tail types.
Pattern types are unstable (
feature(pattern_types)), limiting impact to nightly users.Fix
PR #475