From fd76d236e42378d0feaf5df6dbdbd2db89ba0f1f Mon Sep 17 00:00:00 2001 From: Camelid <37223377+camelid@users.noreply.github.com> Date: Mon, 1 Jun 2020 10:52:07 -0700 Subject: [PATCH] Use `bug!` instead of `panic!` Co-authored-by: varkor --- src/librustc_typeck/astconv.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 9b47c4c7dde..7173ed3d24e 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,