1
Fork 0

Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb

Simplify some conditions

r? `@Nilstrieb`

Some things taken out of my `is_none_or` pr.
This commit is contained in:
Matthias Krüger 2023-06-27 22:10:15 +02:00 committed by GitHub
commit d505582ce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 35 additions and 45 deletions

View file

@ -2183,10 +2183,9 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
None => {
debug!(?param.ident, ?param.ident.span);
let deletion_span = deletion_span();
// the give lifetime originates from expanded code so we won't be able to remove it #104432
let lifetime_only_in_expanded_code =
deletion_span.map(|sp| sp.in_derive_expansion()).unwrap_or(true);
if !lifetime_only_in_expanded_code {
// if the lifetime originates from expanded code, we won't be able to remove it #104432
if deletion_span.is_some_and(|sp| !sp.in_derive_expansion()) {
self.r.lint_buffer.buffer_lint_with_diagnostic(
lint::builtin::UNUSED_LIFETIMES,
param.id,