Skip to content

Commit

Permalink
we should not be reporting generic error if there is not a segment to…
Browse files Browse the repository at this point in the history
… deny
  • Loading branch information
compiler-errors committed Oct 27, 2024
1 parent 1709a85 commit ba12a99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit ba12a99

Please sign in to comment.