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.
This commit is contained in:
Nilstrieb 2023-12-30 17:22:20 +01:00
parent d59f06fc64
commit e36a24ec8f

View File

@ -333,7 +333,8 @@ impl fmt::Display for BoundConstness {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::NotConst => f.write_str("normal"),
_ => write!(f, "`{self}`"),
Self::Const => f.write_str("const"),
Self::ConstIfConst => f.write_str("~const"),
}
}
}