1
Fork 0

Adjust spacing in suggestion, add a test

This commit is contained in:
Michael Goulet 2022-09-04 22:38:12 +00:00
parent 30e3673d43
commit 48281b003f
9 changed files with 50 additions and 12 deletions

View file

@ -608,13 +608,13 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
// That should be extracted into a helper function.
if constraint.ends_with('>') {
constraint = format!(
"{}, {}={}>",
"{}, {} = {}>",
&constraint[..constraint.len() - 1],
name,
term
);
} else {
constraint.push_str(&format!("<{}={}>", name, term));
constraint.push_str(&format!("<{} = {}>", name, term));
}
}