Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
45bb409
Only show methods that appear in the impl block for types in the Impl…
ebarnard Jun 3, 2019
5fa8b52
move stray run-pass const tests into const/ folder
RalfJung Jun 9, 2019
ea1bec3
Turn down the myriad-closures test
alexcrichton Jun 14, 2019
007aaba
Remove unnecessary lift calls
Zoxc Jun 14, 2019
56e30e1
Tweak transparent enums and unions diagnostic spans
estebank Jun 11, 2019
f06b761
review comments: move diagnostic code out of happy path
estebank Jun 12, 2019
961ba8f
syntax: Factor out common fields from `SyntaxExtension` variants
petrochenkov Jun 16, 2019
679000c
allow_internal_unstable: Avoid some more allocations
petrochenkov Jun 16, 2019
085a8d0
syntax: Remove `DummyResolver`
petrochenkov Jun 17, 2019
68e1141
resolve: Avoid creating fresh syntax extensions for all non-macro att…
petrochenkov Jun 17, 2019
8ec502e
syntax: Introduce `default`/`with_unstable` constructors for `ExpnInfo`
petrochenkov Jun 17, 2019
2de2278
syntax: Move `default_transparency` into `ExpnInfo`
petrochenkov Jun 17, 2019
1ff3bce
hygiene: Avoid some unnecessary `ExpnInfo` clones
petrochenkov Jun 17, 2019
e152554
resolve/expand: Move expansion info setting to a single earlier point
petrochenkov Jun 18, 2019
0f9dc6c
Make MaybeUninit #[repr(transparent)]
mjbshaw Jun 12, 2019
dedf2ed
rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.
eddyb Jun 16, 2019
831ddf7
ci: Add a script for generating CPU usage graphs
alexcrichton Jun 14, 2019
d8eea92
create an issue for miri even in status test-fail
RalfJung Jun 18, 2019
d67db00
Preserve generator and yield source for error messages
cramertj Jun 18, 2019
9a7016d
Rollup merge of #61505 - ebarnard:doc-shrink, r=GuillaumeGomez
Centril Jun 18, 2019
65da792
Rollup merge of #61701 - RalfJung:const-tests, r=cramertj
Centril Jun 18, 2019
06d2a89
Rollup merge of #61748 - estebank:transparent-span, r=Centril
Centril Jun 18, 2019
e416932
Rollup merge of #61802 - mjbshaw:maybe-uninit-transparent, r=cramertj
Centril Jun 18, 2019
404c854
Rollup merge of #61839 - alexcrichton:pr-and-master-builds, r=pietroa…
Centril Jun 18, 2019
de8066f
Rollup merge of #61842 - Zoxc:trim-lift, r=eddyb
Centril Jun 18, 2019
4f24715
Rollup merge of #61843 - alexcrichton:disable-myriad-closures, r=piet…
Centril Jun 18, 2019
dcd5b20
Rollup merge of #61896 - eddyb:correct-self-ctor, r=petrochenkov
Centril Jun 18, 2019
d51002c
Rollup merge of #61898 - petrochenkov:sekind, r=eddyb
Centril Jun 18, 2019
9b7b47c
Rollup merge of #61938 - RalfJung:miri-toolstate, r=kennytm
Centril Jun 18, 2019
fde341a
Rollup merge of #61941 - cramertj:no-more-yield-errors, r=centril
Centril Jun 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hygiene: Avoid some unnecessary ExpnInfo clones
  • Loading branch information
petrochenkov committed Jun 18, 2019
commit 1ff3bce5bbcf3f23ad90266f8f3de1ac13d23623
10 changes: 5 additions & 5 deletions src/libsyntax_pos/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Mark {

#[inline]
pub fn expn_info(self) -> Option<ExpnInfo> {
HygieneData::with(|data| data.expn_info(self))
HygieneData::with(|data| data.expn_info(self).cloned())
}

#[inline]
Expand Down Expand Up @@ -204,8 +204,8 @@ impl HygieneData {
GLOBALS.with(|globals| f(&mut *globals.hygiene_data.borrow_mut()))
}

fn expn_info(&self, mark: Mark) -> Option<ExpnInfo> {
self.marks[mark.0 as usize].expn_info.clone()
fn expn_info(&self, mark: Mark) -> Option<&ExpnInfo> {
self.marks[mark.0 as usize].expn_info.as_ref()
}

fn is_descendant_of(&self, mut mark: Mark, ancestor: Mark) -> bool {
Expand Down Expand Up @@ -598,7 +598,7 @@ impl SyntaxContext {
/// `ctxt.outer().expn_info()`.
#[inline]
pub fn outer_expn_info(self) -> Option<ExpnInfo> {
HygieneData::with(|data| data.expn_info(data.outer(self)))
HygieneData::with(|data| data.expn_info(data.outer(self)).cloned())
}

/// `ctxt.outer_and_expn_info()` is equivalent to but faster than
Expand All @@ -607,7 +607,7 @@ impl SyntaxContext {
pub fn outer_and_expn_info(self) -> (Mark, Option<ExpnInfo>) {
HygieneData::with(|data| {
let outer = data.outer(self);
(outer, data.expn_info(outer))
(outer, data.expn_info(outer).cloned())
})
}

Expand Down