use slice::contains where applicable

This commit is contained in:
Yotam Ofek 2025-03-28 12:21:21 +00:00
parent e77a8f439c
commit 9ef35ddc0c
7 changed files with 16 additions and 15 deletions

View file

@ -74,11 +74,11 @@ pub(crate) fn use_panic_2021(mut span: Span) -> bool {
// (To avoid using the edition of e.g. the assert!() or debug_assert!() definition.)
loop {
let expn = span.ctxt().outer_expn_data();
if let Some(features) = expn.allow_internal_unstable {
if features.iter().any(|&f| f == sym::edition_panic) {
span = expn.call_site;
continue;
}
if let Some(features) = expn.allow_internal_unstable
&& features.contains(&sym::edition_panic)
{
span = expn.call_site;
continue;
}
break expn.edition >= Edition::Edition2021;
}