diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-16 21:52:56 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-16 21:52:56 +0100 |
commit | 200955647277c31a3254a1041b7b7bb5f2a79ed8 (patch) | |
tree | 806a0de6951d509f5a4f8ccada6b189789cdf544 /crates/hir_def/src/body | |
parent | 5274eb12dd87f0d790f2871d63f8e3c6f69d3ae9 (diff) | |
parent | ff858376aa4a974cda33a269b4c2d34cbda21bed (diff) |
Merge #8542
8542: Include path in `unresolved-macro-call` diagnostic r=matklad a=jonas-schievink
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/body')
-rw-r--r-- | crates/hir_def/src/body/lower.rs | 8 | ||||
-rw-r--r-- | crates/hir_def/src/body/tests.rs | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index ed07d6928..c0b0b7841 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs | |||
@@ -568,9 +568,13 @@ impl ExprCollector<'_> { | |||
568 | 568 | ||
569 | let res = match res { | 569 | let res = match res { |
570 | Ok(res) => res, | 570 | Ok(res) => res, |
571 | Err(UnresolvedMacro) => { | 571 | Err(UnresolvedMacro { path }) => { |
572 | self.source_map.diagnostics.push(BodyDiagnostic::UnresolvedMacroCall( | 572 | self.source_map.diagnostics.push(BodyDiagnostic::UnresolvedMacroCall( |
573 | UnresolvedMacroCall { file: outer_file, node: syntax_ptr.cast().unwrap() }, | 573 | UnresolvedMacroCall { |
574 | file: outer_file, | ||
575 | node: syntax_ptr.cast().unwrap(), | ||
576 | path, | ||
577 | }, | ||
574 | )); | 578 | )); |
575 | collector(self, None); | 579 | collector(self, None); |
576 | return; | 580 | return; |
diff --git a/crates/hir_def/src/body/tests.rs b/crates/hir_def/src/body/tests.rs index c1d3e998f..63f5fe88d 100644 --- a/crates/hir_def/src/body/tests.rs +++ b/crates/hir_def/src/body/tests.rs | |||
@@ -180,7 +180,7 @@ fn unresolved_macro_diag() { | |||
180 | r#" | 180 | r#" |
181 | fn f() { | 181 | fn f() { |
182 | m!(); | 182 | m!(); |
183 | //^^^^ unresolved macro call | 183 | //^^^^ unresolved macro `m!` |
184 | } | 184 | } |
185 | "#, | 185 | "#, |
186 | ); | 186 | ); |