From a0bdb4b498d44d2f0bdd6ac341d15954cc6d9358 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 1 Dec 2022 09:48:33 +0000 Subject: [PATCH] Don't allow feeding a query cache entry twice --- compiler/rustc_middle/src/ty/query.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_middle/src/ty/query.rs b/compiler/rustc_middle/src/ty/query.rs index 47c1379b308..a7fd1754960 100644 --- a/compiler/rustc_middle/src/ty/query.rs +++ b/compiler/rustc_middle/src/ty/query.rs @@ -344,12 +344,10 @@ pub fn $name(self, value: $V) -> query_stored::$name<'tcx> { match cached { Ok(old) => { - assert_eq!( - value, old, - "Trying to feed an already recorded value for query {} key={key:?}", + bug!( + "Trying to feed an already recorded value for query {} key={key:?}:\nold value: {old:?}\nnew value: {value:?}", stringify!($name), ); - return old; } Err(()) => (), }