mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Introduce more appropriate assertion mechanism
rust-analyzer is a long-running program, so we *should* handle assertion failures. See also https://www.sqlite.org/assert.html.
This commit is contained in:
parent
865e05b5b4
commit
8dc68ecdfc
8 changed files with 72 additions and 7 deletions
|
@ -80,7 +80,7 @@ pub fn macro_label(node: &ast::Macro) -> String {
|
|||
let name = node.name().map(|name| name.syntax().text().to_string()).unwrap_or_default();
|
||||
match node {
|
||||
ast::Macro::MacroRules(node) => {
|
||||
let vis = if node.has_atom_attr("macro_export") { "#[macro_export]\n" } else { "" };
|
||||
let vis = if node.has_atom_attr("macro_export") { "#[macro_export] " } else { "" };
|
||||
format!("{}macro_rules! {}", vis, name)
|
||||
}
|
||||
ast::Macro::MacroDef(node) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue