6713: Make `compile_error!` message match upstream rustc r=jonas-schievink a=jonas-schievink

It only consists of the argument passed to it.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot] 2020-12-03 18:08:17 +00:00 committed by GitHub
commit 070ecef249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -107,7 +107,7 @@ fn f() {
//^^^^^^^^^^^^^^^ `OUT_DIR` not set, enable "load out dirs from check" to fix
compile_error!("compile_error works");
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `compile_error!` called: compile_error works
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ compile_error works
// Lazy:

View File

@ -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())
}