Skip to content

A large match arm exceeds max width #2021

Closed
@topecongiro

Description

@topecongiro

E.g. from librustc_trans/mir/constant.rs:

impl<'tcx> Const<'tcx> {
    pub fn from_constval<'a>() -> Const<'tcx> {
        let val =
            match *cv {
                ConstVal::Variant(_) | ConstVal::Aggregate(..) | ConstVal::Unevaluated(..) => bug!("MIR must not use `{:?}` (aggregates are expanded to MIR rvalues)", cv),
            };
    }
}

Ideally, this should look like

impl<'tcx> Const<'tcx> {
    pub fn from_constval<'a>() -> Const<'tcx> {
        let val = match *cv {
            ConstVal::Variant(_) | ConstVal::Aggregate(..) | ConstVal::Unevaluated(..) => {
                bug!("MIR must not use `{:?}` (aggregates are expanded to MIR rvalues)", cv)
            }
        };
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions