From 44d1dee76e15f096da96c24d2a1a754a7fd8643f Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Thu, 2 Jun 2022 13:34:10 -0700 Subject: [PATCH] Fix failing cranelift-object tests: make panic message match more generic. (#4211) Rust 1.61 changed the way `Debug` output looks for strings with null bytes in them, which broke some expected-panic error message matches. This makes the expectations more generic while still capturing the important part ("has a null byte"). --- cranelift/object/tests/basic.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cranelift/object/tests/basic.rs b/cranelift/object/tests/basic.rs index cf5eca5273..9ed9c351a2 100644 --- a/cranelift/object/tests/basic.rs +++ b/cranelift/object/tests/basic.rs @@ -199,9 +199,7 @@ fn libcall_function() { } #[test] -#[should_panic( - expected = "Result::unwrap()` on an `Err` value: Backend(Symbol \"function\\0with\\0nul\\0bytes\" has a null byte, which is disallowed" -)] +#[should_panic(expected = "has a null byte, which is disallowed")] fn reject_nul_byte_symbol_for_func() { let flag_builder = settings::builder(); let isa_builder = cranelift_codegen::isa::lookup_by_name("x86_64-unknown-linux-gnu").unwrap(); @@ -223,9 +221,7 @@ fn reject_nul_byte_symbol_for_func() { } #[test] -#[should_panic( - expected = "Result::unwrap()` on an `Err` value: Backend(Symbol \"data\\0with\\0nul\\0bytes\" has a null byte, which is disallowed" -)] +#[should_panic(expected = "has a null byte, which is disallowed")] fn reject_nul_byte_symbol_for_data() { let flag_builder = settings::builder(); let isa_builder = cranelift_codegen::isa::lookup_by_name("x86_64-unknown-linux-gnu").unwrap();