mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Make compile_error!
message match upstream rustc
It only consists of the argument passed to it
This commit is contained in:
parent
ec2bdd3c16
commit
957fb18799
2 changed files with 2 additions and 5 deletions
|
@ -107,7 +107,7 @@ fn f() {
|
||||||
//^^^^^^^^^^^^^^^ `OUT_DIR` not set, enable "load out dirs from check" to fix
|
//^^^^^^^^^^^^^^^ `OUT_DIR` not set, enable "load out dirs from check" to fix
|
||||||
|
|
||||||
compile_error!("compile_error works");
|
compile_error!("compile_error works");
|
||||||
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `compile_error!` called: compile_error works
|
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ compile_error works
|
||||||
|
|
||||||
// Lazy:
|
// Lazy:
|
||||||
|
|
||||||
|
|
|
@ -271,10 +271,7 @@ fn compile_error_expand(
|
||||||
let text = it.text.as_str();
|
let text = it.text.as_str();
|
||||||
if text.starts_with('"') && text.ends_with('"') {
|
if text.starts_with('"') && text.ends_with('"') {
|
||||||
// FIXME: does not handle raw strings
|
// FIXME: does not handle raw strings
|
||||||
mbe::ExpandError::Other(format!(
|
mbe::ExpandError::Other(text[1..text.len() - 1].to_string())
|
||||||
"`compile_error!` called: {}",
|
|
||||||
&text[1..text.len() - 1]
|
|
||||||
))
|
|
||||||
} else {
|
} else {
|
||||||
mbe::ExpandError::BindingError("`compile_error!` argument must be a string".into())
|
mbe::ExpandError::BindingError("`compile_error!` argument must be a string".into())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue