aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/render/macro_.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-15 14:45:09 +0000
committerGitHub <[email protected]>2020-12-15 14:45:09 +0000
commitbd4c352831662762ee7a66da77ec9adf623b0a0a (patch)
tree725dfad20b95344ad363b35860cf7e57067bb5e5 /crates/completion/src/render/macro_.rs
parent39aae835fd70d06092c1be1add6eef3984439529 (diff)
parent479babf8740a4d3cf6fc03a5f4a2fca00d387501 (diff)
Merge #6893
6893: Move to upstream `macro_rules!` model r=matklad a=jonas-schievink This changes `macro_rules!` from being treated as a macro invocation to being a first-class item. It also disallows using an additional ident argument for regular macros, so `m! ident(...);` now fails to parse. This matches upstream Rust, and makes the code somewhat simpler by removing repeated "is this a `macro_rules!` call" checks. It will also simplify allowing visibilities on macros, which is currently being proposed in https://github.com/rust-lang/rust/pull/78166. Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/completion/src/render/macro_.rs')
-rw-r--r--crates/completion/src/render/macro_.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/completion/src/render/macro_.rs b/crates/completion/src/render/macro_.rs
index eb3209bee..6cfbd6c9b 100644
--- a/crates/completion/src/render/macro_.rs
+++ b/crates/completion/src/render/macro_.rs
@@ -144,7 +144,7 @@ mod tests {
144use foo::<|>; 144use foo::<|>;
145//- /foo/lib.rs crate:foo 145//- /foo/lib.rs crate:foo
146#[macro_export] 146#[macro_export]
147macro_rules frobnicate { () => () } 147macro_rules! frobnicate { () => () }
148"#, 148"#,
149 r#" 149 r#"
150use foo::frobnicate; 150use foo::frobnicate;
@@ -154,11 +154,11 @@ use foo::frobnicate;
154 check_edit( 154 check_edit(
155 "frobnicate!", 155 "frobnicate!",
156 r#" 156 r#"
157macro_rules frobnicate { () => () } 157macro_rules! frobnicate { () => () }
158fn main() { frob<|>!(); } 158fn main() { frob<|>!(); }
159"#, 159"#,
160 r#" 160 r#"
161macro_rules frobnicate { () => () } 161macro_rules! frobnicate { () => () }
162fn main() { frobnicate!(); } 162fn main() { frobnicate!(); }
163"#, 163"#,
164 ); 164 );