From ad81122fcfe27d6d399080d44387743f3c25bd95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 24 May 2023 13:24:14 +0000 Subject: [PATCH] style: More gracefully deal with broken calls into selector matching If this happens again, it might be worth not matching rather than potentially crashing. Though I guess crashing is a very good way getting it reported soon... Differential Revision: https://phabricator.services.mozilla.com/D178921 --- components/selectors/matching.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/selectors/matching.rs b/components/selectors/matching.rs index 908fc55a548..3bc60bf2c26 100644 --- a/components/selectors/matching.rs +++ b/components/selectors/matching.rs @@ -319,12 +319,14 @@ where } } }, - _ => { + ref other => { debug_assert!( false, "Used MatchingMode::ForStatelessPseudoElement \ - in a non-pseudo selector" + in a non-pseudo selector {:?}", + other ); + return false; }, }