From e36a24ec8f21d1fd4da171c223874bc6f4023028 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 30 Dec 2023 17:22:20 +0100 Subject: [PATCH] Fix `` 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. --- compiler/rustc_middle/src/ty/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 0653796ec7fc3..637e47c3c7eb3 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -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"), } } }