Skip to content

Commit

Permalink
Use bug! instead of panic!
Browse files Browse the repository at this point in the history
Co-authored-by: varkor <[email protected]>
  • Loading branch information
camelid and varkor authored Jun 1, 2020
1 parent 718d28c commit fd76d23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fd76d23

Please sign in to comment.