1
Fork 0

we should not be reporting generic error if there is not a segment to deny

This commit is contained in:
Michael Goulet 2024-10-26 23:57:36 +00:00
parent 19b528b8a0
commit b33a0d3292

View file

@ -1106,7 +1106,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
.collect::<String>() .collect::<String>()
), ),
[(only, _)] => only.to_string(), [(only, _)] => only.to_string(),
[] => "this type".to_string(), [] => bug!("expected one segment to deny"),
}; };
let arg_spans: Vec<Span> = segments let arg_spans: Vec<Span> = segments
@ -1136,7 +1136,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
"s", "s",
), ),
[only] => (only.to_string(), ""), [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 last_span = *arg_spans.last().unwrap();
let span: MultiSpan = arg_spans.into(); let span: MultiSpan = arg_spans.into();