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:
commit
8265506519
@ -1837,7 +1837,7 @@ fn lower_expr_try(&mut self, span: Span, sub_expr: &Expr) -> hir::ExprKind<'hir>
|
|||||||
Safety::Default,
|
Safety::Default,
|
||||||
sym::allow,
|
sym::allow,
|
||||||
sym::unreachable_code,
|
sym::unreachable_code,
|
||||||
self.lower_span(span),
|
try_span,
|
||||||
);
|
);
|
||||||
let attrs: AttrVec = thin_vec![attr];
|
let attrs: AttrVec = thin_vec![attr];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user