Skip to content

Commit

Permalink
Fix ICE
Browse files Browse the repository at this point in the history
  • Loading branch information
sjwang05 committed Nov 30, 2023
1 parent 2a2c08b commit 89080c1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,10 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
steps -= 1;
}
if steps == 0 {
msg = msg.trim_end_matches(" and dereferencing instead");
return (
msg.trim_end_matches(" and dereferencing instead"),
vec![(prefix_span, String::new())],
);
}
let derefs = "*".repeat(steps);
let needs_parens = steps > 0
Expand All @@ -933,7 +936,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
format!("{derefs}"),
)]
};
suggestion.push((prefix_span, "".to_string()));
suggestion.push((prefix_span, String::new()));
(msg, suggestion)
};

Expand Down

0 comments on commit 89080c1

Please sign in to comment.