Skip to content

Commit 89080c1

Browse files
committed
Fix ICE
1 parent 2a2c08b commit 89080c1

File tree

1 file changed

+5
-2
lines changed
  • compiler/rustc_trait_selection/src/traits/error_reporting

1 file changed

+5
-2
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,10 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
910910
steps -= 1;
911911
}
912912
if steps == 0 {
913-
msg = msg.trim_end_matches(" and dereferencing instead");
913+
return (
914+
msg.trim_end_matches(" and dereferencing instead"),
915+
vec![(prefix_span, String::new())],
916+
);
914917
}
915918
let derefs = "*".repeat(steps);
916919
let needs_parens = steps > 0
@@ -933,7 +936,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
933936
format!("{derefs}"),
934937
)]
935938
};
936-
suggestion.push((prefix_span, "".to_string()));
939+
suggestion.push((prefix_span, String::new()));
937940
(msg, suggestion)
938941
};
939942

0 commit comments

Comments
 (0)