diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-27 03:58:26 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-27 03:58:26 +0100 |
commit | 2b69c84396cf376b496e7de3c954400e51b5fc24 (patch) | |
tree | 385a5a3cb167877096534bad2a7c3efdee3c9c1d /crates/ra_hir/src/code_model | |
parent | fc218ec0d04577e33db509e956a044293c12ea67 (diff) | |
parent | edadeb95be16a69175e94a0e211ae9bb74267abb (diff) |
Merge #1815
1815: Support correct `$crate` expansion in macros r=uHOOCCOOHu a=uHOOCCOOHu
This PR makes normal use cases of `$crate` from macros work as expected.
It makes more macros from `std` work. Type inference works well with `panic`, `unimplemented`, `format`, and maybe more.
Sadly that `vec![1, 2, 3]` still not works, but it is not longer an issue about macro.
Screenshot:

Co-authored-by: uHOOCCOOHu <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/code_model')
-rw-r--r-- | crates/ra_hir/src/code_model/src.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index c0cb27b47..dc964e156 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -119,7 +119,7 @@ impl HasSource for TypeAlias { | |||
119 | impl HasSource for MacroDef { | 119 | impl HasSource for MacroDef { |
120 | type Ast = ast::MacroCall; | 120 | type Ast = ast::MacroCall; |
121 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::MacroCall> { | 121 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::MacroCall> { |
122 | Source { file_id: self.id.0.file_id(), ast: self.id.0.to_node(db) } | 122 | Source { file_id: self.id.ast_id.file_id(), ast: self.id.ast_id.to_node(db) } |
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||