diff options
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_derive.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/builtin_macro.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/db.rs | 14 |
3 files changed, 15 insertions, 5 deletions
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs index 87224481c..a5b50a832 100644 --- a/crates/ra_hir_expand/src/builtin_derive.rs +++ b/crates/ra_hir_expand/src/builtin_derive.rs | |||
@@ -266,7 +266,7 @@ mod tests { | |||
266 | BuiltinDeriveExpander::Copy, | 266 | BuiltinDeriveExpander::Copy, |
267 | ); | 267 | ); |
268 | 268 | ||
269 | assert_eq!(expanded, "impl <>std::marker::CopyforFoo <>{}"); | 269 | assert_eq!(expanded, "impl< >std::marker::CopyforFoo< >{}"); |
270 | } | 270 | } |
271 | 271 | ||
272 | #[test] | 272 | #[test] |
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 1f380b571..b2c8a911f 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs | |||
@@ -367,7 +367,7 @@ mod tests { | |||
367 | "#, | 367 | "#, |
368 | ); | 368 | ); |
369 | 369 | ||
370 | assert_eq!(expanded, "std::option::Option::None:: <&str>"); | 370 | assert_eq!(expanded, "std::option::Option::None:: < &str>"); |
371 | } | 371 | } |
372 | 372 | ||
373 | #[test] | 373 | #[test] |
@@ -414,7 +414,7 @@ mod tests { | |||
414 | 414 | ||
415 | assert_eq!( | 415 | assert_eq!( |
416 | expanded, | 416 | expanded, |
417 | r#"std::fmt::Arguments::new_v1(&[] ,&[std::fmt::ArgumentV1::new(&(arg1(a,b,c)),std::fmt::Display::fmt),std::fmt::ArgumentV1::new(&(arg2),std::fmt::Display::fmt),])"# | 417 | r#"std::fmt::Arguments::new_v1(&[], &[std::fmt::ArgumentV1::new(&(arg1(a,b,c)),std::fmt::Display::fmt),std::fmt::ArgumentV1::new(&(arg2),std::fmt::Display::fmt),])"# |
418 | ); | 418 | ); |
419 | } | 419 | } |
420 | } | 420 | } |
diff --git a/crates/ra_hir_expand/src/db.rs b/crates/ra_hir_expand/src/db.rs index 32e0d5ced..f3a84cacc 100644 --- a/crates/ra_hir_expand/src/db.rs +++ b/crates/ra_hir_expand/src/db.rs | |||
@@ -176,10 +176,20 @@ pub(crate) fn parse_macro( | |||
176 | MacroCallId::LazyMacro(id) => { | 176 | MacroCallId::LazyMacro(id) => { |
177 | let loc: MacroCallLoc = db.lookup_intern_macro(id); | 177 | let loc: MacroCallLoc = db.lookup_intern_macro(id); |
178 | let node = loc.kind.node(db); | 178 | let node = loc.kind.node(db); |
179 | |||
180 | // collect parent information for warning log | ||
181 | let parents = std::iter::successors(loc.kind.file_id().call_node(db), |it| { | ||
182 | it.file_id.call_node(db) | ||
183 | }) | ||
184 | .map(|n| format!("{:#}", n.value)) | ||
185 | .collect::<Vec<_>>() | ||
186 | .join("\n"); | ||
187 | |||
179 | log::warn!( | 188 | log::warn!( |
180 | "fail on macro_parse: (reason: {} macro_call: {:#})", | 189 | "fail on macro_parse: (reason: {} macro_call: {:#}) parents: {}", |
181 | err, | 190 | err, |
182 | node.value | 191 | node.value, |
192 | parents | ||
183 | ); | 193 | ); |
184 | } | 194 | } |
185 | _ => { | 195 | _ => { |