Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit fd76d23

Browse files
camelidvarkor
andauthored
Use bug! instead of panic!
Co-authored-by: varkor <[email protected]>
1 parent 718d28c commit fd76d23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
489489
"lifetime" => ParamKindOrd::Lifetime,
490490
"type" => ParamKindOrd::Type,
491491
"constant" => ParamKindOrd::Const,
492-
_ => panic!(),
492+
// It's more concise to match on the string representation, though it means
493+
// the match is non-exhaustive.
494+
_ => bug!("invalid generic parameter kind"),
493495
};
494496
let arg_ord = match arg {
495497
GenericArg::Lifetime(_) => ParamKindOrd::Lifetime,

0 commit comments

Comments
 (0)