mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco
Don't mark for loop iter expression as desugared We typically don't mark spans of lowered things as desugared. This helps Clippy rightly discern when code is (not) from expansion. This was discovered by ``@flip1995`` at https://github.com/rust-lang/rust-clippy/pull/7789#issuecomment-939289501.
This commit is contained in:
commit
efef16f6ed
1 changed files with 1 additions and 7 deletions
|
@ -63,13 +63,7 @@ impl<'tcx> LateLintPass<'tcx> for UselessVec {
|
|||
if is_copy(cx, vec_type(cx.typeck_results().expr_ty_adjusted(arg)));
|
||||
then {
|
||||
// report the error around the `vec!` not inside `<std macros>:`
|
||||
let span = arg.span
|
||||
.ctxt()
|
||||
.outer_expn_data()
|
||||
.call_site
|
||||
.ctxt()
|
||||
.outer_expn_data()
|
||||
.call_site;
|
||||
let span = arg.span.ctxt().outer_expn_data().call_site;
|
||||
self.check_vec_macro(cx, &vec_args, Mutability::Not, span);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue