summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-10-26 23:57:36 +0000
committerMichael Goulet <michael@errs.io>2024-11-20 18:57:02 +0000
commitb33a0d329236833ecafcd84978f51d6ccb0dd5ad (patch)
treeb037ca62e1b0ee96e6f7a73885e61c968916dda6 /compiler
parent19b528b8a0770d55ba3c7b3cc5b91d6466e6ff2d (diff)
downloadrust-b33a0d329236833ecafcd84978f51d6ccb0dd5ad.tar.gz
rust-b33a0d329236833ecafcd84978f51d6ccb0dd5ad.zip
we should not be reporting generic error if there is not a segment to deny
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs
index dd0f250a8e2..4e5a8271e9e 100644
--- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs
+++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs
@@ -1106,7 +1106,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
                     .collect::<String>()
             ),
             [(only, _)] => only.to_string(),
-            [] => "this type".to_string(),
+            [] => bug!("expected one segment to deny"),
         };
 
         let arg_spans: Vec<Span> = segments
@@ -1136,7 +1136,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
                 "s",
             ),
             [only] => (only.to_string(), ""),
-            [] => unreachable!("expected at least one generic to prohibit"),
+            [] => bug!("expected at least one generic to prohibit"),
         };
         let last_span = *arg_spans.last().unwrap();
         let span: MultiSpan = arg_spans.into();