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.
This commit is contained in:
Nicholas Nethercote 2024-03-06 16:39:02 +11:00
parent ac174ae8d2
commit b64c5f991c

View file

@ -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)
}