diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-06 16:39:02 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-04-16 15:55:24 +1000 |
| commit | b64c5f991c0d9c84f7ca6c61fba561d150d5ac4c (patch) | |
| tree | 033709eaeaca92cabf54c7f42347169bbae46630 | |
| parent | ac174ae8d2c5e663fcada4862baf9f77c0c47c46 (diff) | |
| download | rust-b64c5f991c0d9c84f7ca6c61fba561d150d5ac4c.tar.gz rust-b64c5f991c0d9c84f7ca6c61fba561d150d5ac4c.zip | |
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.
| -rw-r--r-- | clippy_lints/src/non_copy_const.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clippy_lints/src/non_copy_const.rs b/clippy_lints/src/non_copy_const.rs index 73fc34c2450..5ca388d67a1 100644 --- a/clippy_lints/src/non_copy_const.rs +++ b/clippy_lints/src/non_copy_const.rs @@ -18,7 +18,7 @@ use rustc_middle::mir::interpret::{ErrorHandled, EvalToValTreeResult, GlobalId}; use rustc_middle::ty::adjustment::Adjust; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_session::impl_lint_pass; -use rustc_span::{sym, InnerSpan, Span}; +use rustc_span::{sym, DUMMY_SP, InnerSpan, Span}; use rustc_target::abi::VariantIdx; // FIXME: this is a correctness problem but there's no suitable @@ -290,9 +290,7 @@ impl NonCopyConst { promoted: None, }; let param_env = cx.tcx.param_env(def_id).with_reveal_all_normalized(cx.tcx); - let result = cx - .tcx - .const_eval_global_id_for_typeck(param_env, cid, rustc_span::DUMMY_SP); + let result = cx.tcx.const_eval_global_id_for_typeck(param_env, cid, DUMMY_SP); self.is_value_unfrozen_raw(cx, result, ty) } @@ -303,7 +301,7 @@ impl NonCopyConst { cx.tcx, cx.param_env, ty::UnevaluatedConst::new(def_id, args), - rustc_span::DUMMY_SP, + DUMMY_SP, ); self.is_value_unfrozen_raw(cx, result, ty) } |
