Skip to content

Commit b64c5f9

Browse files
committed
Avoid unnecessary rustc_span::DUMMY_SP usage.
In some cases `DUMMY_SP` is already imported. In other cases this commit adds the necessary import, in files where `DUMMY_SP` is used more than once.
1 parent ac174ae commit b64c5f9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clippy_lints/src/non_copy_const.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_middle::mir::interpret::{ErrorHandled, EvalToValTreeResult, GlobalId};
1818
use rustc_middle::ty::adjustment::Adjust;
1919
use rustc_middle::ty::{self, Ty, TyCtxt};
2020
use rustc_session::impl_lint_pass;
21-
use rustc_span::{sym, InnerSpan, Span};
21+
use rustc_span::{sym, DUMMY_SP, InnerSpan, Span};
2222
use rustc_target::abi::VariantIdx;
2323

2424
// FIXME: this is a correctness problem but there's no suitable
@@ -290,9 +290,7 @@ impl NonCopyConst {
290290
promoted: None,
291291
};
292292
let param_env = cx.tcx.param_env(def_id).with_reveal_all_normalized(cx.tcx);
293-
let result = cx
294-
.tcx
295-
.const_eval_global_id_for_typeck(param_env, cid, rustc_span::DUMMY_SP);
293+
let result = cx.tcx.const_eval_global_id_for_typeck(param_env, cid, DUMMY_SP);
296294
self.is_value_unfrozen_raw(cx, result, ty)
297295
}
298296

@@ -303,7 +301,7 @@ impl NonCopyConst {
303301
cx.tcx,
304302
cx.param_env,
305303
ty::UnevaluatedConst::new(def_id, args),
306-
rustc_span::DUMMY_SP,
304+
DUMMY_SP,
307305
);
308306
self.is_value_unfrozen_raw(cx, result, ty)
309307
}

0 commit comments

Comments
 (0)