diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 9b47c4c7dde7..7173ed3d24ec 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -489,7 +489,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { "lifetime" => ParamKindOrd::Lifetime, "type" => ParamKindOrd::Type, "constant" => ParamKindOrd::Const, - _ => panic!(), + // It's more concise to match on the string representation, though it means + // the match is non-exhaustive. + _ => bug!("invalid generic parameter kind"), }; let arg_ord = match arg { GenericArg::Lifetime(_) => ParamKindOrd::Lifetime,