Skip to content

Commit 0f8573e

Browse files
committed
Pass ExpnData by reference.
1 parent a51b131 commit 0f8573e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: compiler/rustc_middle/src/ty/query/on_disk_cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl<'sess> OnDiskCache<'sess> {
372372
|encoder, expn_id, data, hash| -> FileEncodeResult {
373373
if expn_id.krate == LOCAL_CRATE {
374374
let pos = AbsoluteBytePos::new(encoder.position());
375-
encoder.encode_tagged(TAG_EXPN_DATA, &data)?;
375+
encoder.encode_tagged(TAG_EXPN_DATA, data)?;
376376
expn_data.insert(hash, pos);
377377
} else {
378378
foreign_expn_data.insert(hash, expn_id.local_id.as_u32());

Diff for: compiler/rustc_span/src/hygiene.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ impl HygieneEncodeContext {
11421142
&self,
11431143
encoder: &mut T,
11441144
mut encode_ctxt: impl FnMut(&mut T, u32, &SyntaxContextData) -> Result<(), R>,
1145-
mut encode_expn: impl FnMut(&mut T, ExpnId, ExpnData, ExpnHash) -> Result<(), R>,
1145+
mut encode_expn: impl FnMut(&mut T, ExpnId, &ExpnData, ExpnHash) -> Result<(), R>,
11461146
) -> Result<(), R> {
11471147
// When we serialize a `SyntaxContextData`, we may end up serializing
11481148
// a `SyntaxContext` that we haven't seen before
@@ -1344,15 +1344,15 @@ fn for_all_ctxts_in<E, F: FnMut(u32, SyntaxContext, &SyntaxContextData) -> Resul
13441344

13451345
fn for_all_expns_in<E>(
13461346
expns: impl Iterator<Item = ExpnId>,
1347-
mut f: impl FnMut(ExpnId, ExpnData, ExpnHash) -> Result<(), E>,
1347+
mut f: impl FnMut(ExpnId, &ExpnData, ExpnHash) -> Result<(), E>,
13481348
) -> Result<(), E> {
13491349
let all_data: Vec<_> = HygieneData::with(|data| {
13501350
expns
13511351
.map(|expn| (expn, data.expn_data(expn).clone(), data.expn_hash(expn).clone()))
13521352
.collect()
13531353
});
13541354
for (expn, data, hash) in all_data.into_iter() {
1355-
f(expn, data, hash)?;
1355+
f(expn, &data, hash)?;
13561356
}
13571357
Ok(())
13581358
}

0 commit comments

Comments
 (0)