From 957fb1879905dc3496992de2241d0847c253e508 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 3 Dec 2020 19:07:37 +0100 Subject: Make `compile_error!` message match upstream rustc It only consists of the argument passed to it --- crates/hir_expand/src/builtin_macro.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/hir_expand/src/builtin_macro.rs') diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs index 16c3c4d69..44a5556b6 100644 --- a/crates/hir_expand/src/builtin_macro.rs +++ b/crates/hir_expand/src/builtin_macro.rs @@ -271,10 +271,7 @@ fn compile_error_expand( let text = it.text.as_str(); if text.starts_with('"') && text.ends_with('"') { // FIXME: does not handle raw strings - mbe::ExpandError::Other(format!( - "`compile_error!` called: {}", - &text[1..text.len() - 1] - )) + mbe::ExpandError::Other(text[1..text.len() - 1].to_string()) } else { mbe::ExpandError::BindingError("`compile_error!` argument must be a string".into()) } -- cgit v1.2.3