about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCamelid <37223377+camelid@users.noreply.github.com>2020-06-01 10:52:07 -0700
committerGitHub <noreply@github.com>2020-06-01 10:52:07 -0700
commitfd76d236e42378d0feaf5df6dbdbd2db89ba0f1f (patch)
tree14755a3a0c130adc7febaf8db4f09d22d980ffd7 /src
parent718d28cf85305411bdad8e3b2a4f932bd9f628c7 (diff)
downloadrust-fd76d236e42378d0feaf5df6dbdbd2db89ba0f1f.tar.gz
rust-fd76d236e42378d0feaf5df6dbdbd2db89ba0f1f.zip
Use `bug!` instead of `panic!`
Co-authored-by: varkor <github@varkor.com>
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,