Use bug! instead of panic!

Co-authored-by: varkor <github@varkor.com>
This commit is contained in:
Camelid 2020-06-01 10:52:07 -07:00 committed by GitHub
parent 718d28cf85
commit fd76d236e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,