Skip to content

Commit e36a24e

Browse files
committed
Fix <BoundConstness as Display>
There was infinite recursion, which is not very good. I'm not sure what the best way to implement this is, I just did something that felt right.
1 parent d59f06f commit e36a24e

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+2
-1
lines changed

compiler/rustc_middle/src/ty/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ impl fmt::Display for BoundConstness {
333333
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
334334
match self {
335335
Self::NotConst => f.write_str("normal"),
336-
_ => write!(f, "`{self}`"),
336+
Self::Const => f.write_str("const"),
337+
Self::ConstIfConst => f.write_str("~const"),
337338
}
338339
}
339340
}

0 commit comments

Comments
 (0)