From ad3c4207bacd43d95b6a11bbfaad96ea0fbd53ef Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Thu, 16 Jul 2020 21:11:56 -0400 Subject: [PATCH] Expand on some comments --- compiler/mono/src/expr.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/mono/src/expr.rs b/compiler/mono/src/expr.rs index ed39b0d121..cbcc638e61 100644 --- a/compiler/mono/src/expr.rs +++ b/compiler/mono/src/expr.rs @@ -116,6 +116,9 @@ impl<'a> Procs<'a> { .unwrap_or_else(|err| panic!("TODO turn fn_var into a RuntimeError {:?}", err)); // if we've already specialized this one, no further work is needed. + // + // NOTE: this #[allow(clippy::map_entry)] here is for correctness! + // Changing it to use .entry() would necessarily make it incorrect. #[allow(clippy::map_entry)] if !self.specialized.contains_key(&(symbol, layout.clone())) { let pending = PendingSpecialization { @@ -1531,6 +1534,9 @@ pub fn specialize_all<'a>( for (layout, pending) in by_layout.drain() { // If we've already seen this (Symbol, Layout) combination before, // don't try to specialize it again. If we do, we'll loop forever! + // + // NOTE: this #[allow(clippy::map_entry)] here is for correctness! + // Changing it to use .entry() would necessarily make it incorrect. #[allow(clippy::map_entry)] if !procs.specialized.contains_key(&(name, layout.clone())) { // TODO should pending_procs hold a Rc?