use slice::contains
where applicable
This commit is contained in:
parent
e77a8f439c
commit
9ef35ddc0c
7 changed files with 16 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue