Skip to content

struct_lockstep_tails_raw missing ty::Pat arm, breaks unsizing coercions for pattern types #472

@SebTardif

Description

@SebTardif

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemType systemI-wrongWrong result or data corruptionP-lowLow impact: edge case or niche scenariobugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions