Skip to content

Commit 7b58439

Browse files
committed
rdr-perf: make sure record! macros do not duplicate query invocations
1 parent d4a9c1a commit 7b58439

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,14 @@ impl<'a, 'tcx> TyEncoder<'tcx> for EncodeContext<'a, 'tcx> {
405405
// normally need extra variables to avoid errors about multiple mutable borrows.
406406
macro_rules! record {
407407
($self:ident.$tables:ident.$table:ident[$def_id:expr] <- $value:expr, $hcx:ident) => {{
408-
record!($self.$tables.$table[$def_id] <- $value, $hcx, $value)
408+
{
409+
let value = $value;
410+
record!($self.$tables.$table[$def_id] <- value, $hcx, value)
411+
}
409412
}};
410413
($self:ident.$tables:ident.$table:ident[$def_id:expr] <- $value:expr, $hcx:ident, $hashed_value:expr) => {{
411414
{
412-
let value = $value;
413-
let lazy = $self.lazy(value);
415+
let lazy = $self.lazy($value);
414416
$self.$tables.$table.set_some_hashed(
415417
$def_id.index,
416418
lazy,

0 commit comments

Comments
 (0)