Skip to content

Commit

Permalink
Fix <BoundConstness as Display>
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Noratrieb committed Dec 30, 2023
1 parent d59f06f commit e36a24e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
}
Expand Down

0 comments on commit e36a24e

Please sign in to comment.