Skip to content

Commit 47d266f

Browse files
committed
add comment to use of invocation_parent
1 parent 99c6d26 commit 47d266f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_expand/src/expand.rs

+6
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,12 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
608608
if self.cx.sess.opts.incremental.is_some() {
609609
for (invoc, _) in invocations.iter_mut() {
610610
let expn_id = invoc.expansion_data.id;
611+
// When lowering anon-consts, we may end up with spans whose
612+
// parent is the containing item instead of the anon-const itself.
613+
// See `DefCollector::handle_lazy_anon_const_def` for more details.
614+
//
615+
// FIXME(lcnr): I believe that this shouldn't cause any issues wrt to
616+
// incremental compilation, but am not 100% confident.
611617
let parent_def = self.cx.resolver.invocation_parent(expn_id);
612618
let span = invoc.span_mut();
613619
*span = span.with_parent(Some(parent_def));

0 commit comments

Comments
 (0)