Skip to content

Commit 8265506

Browse files
Rollup merge of rust-lang#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.
2 parents 1425982 + 6ee87ae commit 8265506

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+1
-1
lines changed

Diff for: compiler/rustc_ast_lowering/src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
18371837
Safety::Default,
18381838
sym::allow,
18391839
sym::unreachable_code,
1840-
self.lower_span(span),
1840+
try_span,
18411841
);
18421842
let attrs: AttrVec = thin_vec![attr];
18431843

0 commit comments

Comments
 (0)