From 04cb8df02c1e324a3742b6b92a6d5cb904a03c9e Mon Sep 17 00:00:00 2001 From: Samir Rashid Date: Wed, 4 Sep 2024 13:18:50 +0000 Subject: [PATCH] fmt: make `panic!` error messages greppable Keep the error text contiguous in error messages so that they are easy to locate. Fixes #4141 by making the dependency on unstable cargo for build explicit. --- arch/rv32i/src/pmp.rs | 3 +-- boards/build.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/rv32i/src/pmp.rs b/arch/rv32i/src/pmp.rs index 606d4a055b..1b7426c932 100644 --- a/arch/rv32i/src/pmp.rs +++ b/arch/rv32i/src/pmp.rs @@ -1070,8 +1070,7 @@ pub mod test { } None => { panic!( - "Failed to allocate region that does not overlap and \ - should meet alignment constraints: {:?}", + "Failed to allocate region that does not overlap and should meet alignment constraints: {:?}", region ); } diff --git a/boards/build.rs b/boards/build.rs index 8529ed0b4f..0a29ee2a54 100644 --- a/boards/build.rs +++ b/boards/build.rs @@ -45,8 +45,7 @@ fn main() { .any(|f| f.contains("cfg_tock_buildflagssentinel")) { panic!( - "Incorrect build configuration. \ - Verify you have not unintentionally set the RUSTFLAGS environment variable." + "Incorrect build configuration. Verify you are using unstable cargo and have not unintentionally set the RUSTFLAGS environment variable." ); } }