Rollup merge of #130244 - samueltardieu:qmark-expansion-span-fix, r=jieyouxu

Use the same span for attributes and Try expansion of ?

This is needed for Clippy to know that the `#[allow(unused)]` attributes added by the expansion of `?` are part of the desugaring, and that they do not come from the user code.

rust-lang/rust-clippy#13380 exhibits a manifestation of this problem and will be fixed by this change.
This commit is contained in:
Jubilee 2024-09-11 15:53:24 -07:00 committed by GitHub
commit 8265506519
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1837,7 +1837,7 @@ fn lower_expr_try(&mut self, span: Span, sub_expr: &Expr) -> hir::ExprKind<'hir>
Safety::Default,
sym::allow,
sym::unreachable_code,
self.lower_span(span),
try_span,
);
let attrs: AttrVec = thin_vec![attr];