From dbf82233b81b0c3e3aedcb0a26f6c51e66df0797 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 12 Mar 2024 12:46:36 -0700 Subject: [PATCH] Gate f-string struct size test for Rustc < 1.76 (#10371) Closes https://github.com/astral-sh/ruff/issues/10319. Signed-off-by: Eli Schwartz --- crates/ruff_python_ast/src/nodes.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ruff_python_ast/src/nodes.rs b/crates/ruff_python_ast/src/nodes.rs index 32a3435e7..53cf5b8d8 100644 --- a/crates/ruff_python_ast/src/nodes.rs +++ b/crates/ruff_python_ast/src/nodes.rs @@ -4148,7 +4148,8 @@ mod tests { assert_eq!(std::mem::size_of::(), 56); assert_eq!(std::mem::size_of::(), 48); assert_eq!(std::mem::size_of::(), 8); - assert_eq!(std::mem::size_of::(), 48); + // 56 for Rustc < 1.76 + assert!(matches!(std::mem::size_of::(), 48 | 56)); assert_eq!(std::mem::size_of::(), 48); assert_eq!(std::mem::size_of::(), 32); assert_eq!(std::mem::size_of::(), 32); -- 2.43.2