mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-31 00:53:48 +00:00
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
This commit is contained in:
commit
2155386f31
@ -670,7 +670,7 @@ impl SyntaxContext {
|
||||
}
|
||||
|
||||
pub fn edition(self) -> Edition {
|
||||
self.outer_expn_data().edition
|
||||
HygieneData::with(|data| data.expn_data(data.outer_expn(self)).edition)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user