Skip to content

Commit

Permalink
Auto merge of rust-lang#119447 - Nilstrieb:STACKOVERFLOW, r=compiler-…
Browse files Browse the repository at this point in the history
…errors

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.

r? `@fmease`
  • Loading branch information
bors committed Dec 31, 2023
2 parents d868bc2 + e36a24e commit 64d5515
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 64d5515

Please sign in to comment.