Skip to content

Commit

Permalink
Avoid unnecessary rustc_span::DUMMY_SP usage.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nnethercote committed Apr 16, 2024
1 parent ac174ae commit b64c5f9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions clippy_lints/src/non_copy_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

Expand All @@ -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)
}
Expand Down

0 comments on commit b64c5f9

Please sign in to comment.