Skip to content

Commit

Permalink
Rollup merge of #130244 - samueltardieu:qmark-expansion-span-fix, r=j…
Browse files Browse the repository at this point in the history
…ieyouxu

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.
  • Loading branch information
workingjubilee committed Sep 11, 2024
2 parents 1425982 + 6ee87ae commit 8265506
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
Safety::Default,
sym::allow,
sym::unreachable_code,
self.lower_span(span),
try_span,
);
let attrs: AttrVec = thin_vec![attr];

Expand Down

0 comments on commit 8265506

Please sign in to comment.