diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-14 14:08:08 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-14 14:08:08 +0000 |
commit | 77db6177658b32f69ad7ebfdef96c1b3b2893fdd (patch) | |
tree | 2a9f0f16b34821dfe4319bef410e177311e87f16 /crates/ra_hir_expand/src/builtin_macro.rs | |
parent | 7238037de42a2fd88434930c521b926d7b0026da (diff) | |
parent | f02fcc16444fcd18ccd51b43fa01bf0233e044fa (diff) |
Merge #2554
2554: Add macros for known names and paths r=matklad a=flodiebold
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand/src/builtin_macro.rs')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_macro.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index be5f3cbe3..d2b3d769e 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs | |||
@@ -34,7 +34,7 @@ macro_rules! register_builtin { | |||
34 | ast_id: AstId<ast::MacroCall>, | 34 | ast_id: AstId<ast::MacroCall>, |
35 | ) -> Option<MacroDefId> { | 35 | ) -> Option<MacroDefId> { |
36 | let kind = match ident { | 36 | let kind = match ident { |
37 | $( id if id == &name::$name => BuiltinFnLikeExpander::$kind, )* | 37 | $( id if id == &name::name![$name] => BuiltinFnLikeExpander::$kind, )* |
38 | _ => return None, | 38 | _ => return None, |
39 | }; | 39 | }; |
40 | 40 | ||
@@ -44,15 +44,15 @@ macro_rules! register_builtin { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | register_builtin! { | 46 | register_builtin! { |
47 | (COLUMN_MACRO, Column) => column_expand, | 47 | (column, Column) => column_expand, |
48 | (COMPILE_ERROR_MACRO, CompileError) => compile_error_expand, | 48 | (compile_error, CompileError) => compile_error_expand, |
49 | (FILE_MACRO, File) => file_expand, | 49 | (file, File) => file_expand, |
50 | (LINE_MACRO, Line) => line_expand, | 50 | (line, Line) => line_expand, |
51 | (STRINGIFY_MACRO, Stringify) => stringify_expand, | 51 | (stringify, Stringify) => stringify_expand, |
52 | (FORMAT_ARGS_MACRO, FormatArgs) => format_args_expand, | 52 | (format_args, FormatArgs) => format_args_expand, |
53 | // format_args_nl only differs in that it adds a newline in the end, | 53 | // format_args_nl only differs in that it adds a newline in the end, |
54 | // so we use the same stub expansion for now | 54 | // so we use the same stub expansion for now |
55 | (FORMAT_ARGS_NL_MACRO, FormatArgsNl) => format_args_expand | 55 | (format_args_nl, FormatArgsNl) => format_args_expand |
56 | } | 56 | } |
57 | 57 | ||
58 | fn to_line_number(db: &dyn AstDatabase, file: HirFileId, pos: TextUnit) -> usize { | 58 | fn to_line_number(db: &dyn AstDatabase, file: HirFileId, pos: TextUnit) -> usize { |