diff options
| author | Camelid <37223377+camelid@users.noreply.github.com> | 2020-06-01 10:52:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-01 10:52:07 -0700 |
| commit | fd76d236e42378d0feaf5df6dbdbd2db89ba0f1f (patch) | |
| tree | 14755a3a0c130adc7febaf8db4f09d22d980ffd7 /src | |
| parent | 718d28cf85305411bdad8e3b2a4f932bd9f628c7 (diff) | |
| download | rust-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.rs | 4 |
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, |
