about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-17 20:21:22 +0100
committerGitHub <noreply@github.com>2024-01-17 20:21:22 +0100
commite0aa4df7980126ac6285a4b97d542886dac3e1fb (patch)
tree56d00bb98323c0a744f45f969add08ebedf1d50d
parentcd5eb6a896061b47127e228b0a7e8454cf55d925 (diff)
parente12101c4db03b1cd35fcc288f8e6568f552ee51c (diff)
downloadrust-e0aa4df7980126ac6285a4b97d542886dac3e1fb.tar.gz
rust-e0aa4df7980126ac6285a4b97d542886dac3e1fb.zip
Rollup merge of #120032 - Nadrieril:fix-rustc_abi, r=Nilstrieb
Fix `rustc_abi` build on stable

https://github.com/rust-lang/rust/pull/119446 broke the ability of `rustc_abi` to build on stable, which is required by rust-analyzer. This fixes it.
-rw-r--r--compiler/rustc_abi/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs
index ea194e10def..c45a4a410f9 100644
--- a/compiler/rustc_abi/src/lib.rs
+++ b/compiler/rustc_abi/src/lib.rs
@@ -49,7 +49,14 @@ bitflags! {
                                  | ReprFlags::IS_LINEAR.bits();
     }
 }
-rustc_data_structures::external_bitflags_debug! { ReprFlags }
+
+// This is the same as `rustc_data_structures::external_bitflags_debug` but without the
+// `rustc_data_structures` to make it build on stable.
+impl std::fmt::Debug for ReprFlags {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        bitflags::parser::to_writer(self, f)
+    }
+}
 
 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
 #[cfg_attr(feature = "nightly", derive(Encodable_Generic, Decodable_Generic, HashStable_Generic))]