about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/astconv.rs4
1 files changed, 3 insertions, 1 deletions
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,