Skip to content

Commit 2155386

Browse files
committed
Auto merge of #87106 - Mark-Simulacrum:edition-no-clone, r=petrochenkov
Avoid cloning ExpnData to access Span edition ExpnData is a fairly hefty structure to clone; cloning it may not be cheap. In some cases this may get optimized out, but it's not clear that will always be the case. Try to avoid that cost. r? `@ghost` -- opening for a perf run to start with
2 parents c7d6bcc + 7d373c9 commit 2155386

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_span/src/hygiene.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ impl SyntaxContext {
670670
}
671671

672672
pub fn edition(self) -> Edition {
673-
self.outer_expn_data().edition
673+
HygieneData::with(|data| data.expn_data(data.outer_expn(self)).edition)
674674
}
675675
}
676676

0 commit comments

Comments
 (0)