Remove an unused span

This commit is contained in:
Oli Scherer 2022-11-08 16:03:48 +00:00
parent 1d93b35855
commit b745a29fa5
3 changed files with 2 additions and 17 deletions

View File

@ -44,11 +44,7 @@ pub fn adjust_steps_as_infer_ok(
|InferOk { value: method, obligations: o }| { |InferOk { value: method, obligations: o }| {
obligations.extend(o); obligations.extend(o);
if let ty::Ref(region, _, mutbl) = *method.sig.output().kind() { if let ty::Ref(region, _, mutbl) = *method.sig.output().kind() {
Some(OverloadedDeref { Some(OverloadedDeref { region, mutbl, span: autoderef.span() })
region,
mutbl,
span: autoderef.overloaded_span(),
})
} else { } else {
None None
} }

View File

@ -151,8 +151,7 @@ fn adjust_self_ty(
) -> Ty<'tcx> { ) -> Ty<'tcx> {
// Commit the autoderefs by calling `autoderef` again, but this // Commit the autoderefs by calling `autoderef` again, but this
// time writing the results into the various typeck results. // time writing the results into the various typeck results.
let mut autoderef = let mut autoderef = self.autoderef(self.call_expr.span, unadjusted_self_ty);
self.autoderef(self.span, unadjusted_self_ty).with_overloaded_span(self.call_expr.span);
let Some((ty, n)) = autoderef.nth(pick.autoderefs) else { let Some((ty, n)) = autoderef.nth(pick.autoderefs) else {
return self.tcx.ty_error_with_message( return self.tcx.ty_error_with_message(
rustc_span::DUMMY_SP, rustc_span::DUMMY_SP,

View File

@ -27,7 +27,6 @@ pub struct Autoderef<'a, 'tcx> {
// Meta infos: // Meta infos:
infcx: &'a InferCtxt<'tcx>, infcx: &'a InferCtxt<'tcx>,
span: Span, span: Span,
overloaded_span: Span,
body_id: hir::HirId, body_id: hir::HirId,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
@ -103,7 +102,6 @@ pub fn new(
Autoderef { Autoderef {
infcx, infcx,
span, span,
overloaded_span: span,
body_id, body_id,
param_env, param_env,
state: AutoderefSnapshot { state: AutoderefSnapshot {
@ -118,10 +116,6 @@ pub fn new(
} }
} }
pub fn with_overloaded_span(self, overloaded_span: Span) -> Self {
Self { overloaded_span, ..self }
}
fn overloaded_deref_ty(&mut self, ty: Ty<'tcx>) -> Option<Ty<'tcx>> { fn overloaded_deref_ty(&mut self, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
debug!("overloaded_deref_ty({:?})", ty); debug!("overloaded_deref_ty({:?})", ty);
@ -196,10 +190,6 @@ pub fn span(&self) -> Span {
self.span self.span
} }
pub fn overloaded_span(&self) -> Span {
self.overloaded_span
}
pub fn reached_recursion_limit(&self) -> bool { pub fn reached_recursion_limit(&self) -> bool {
self.state.reached_recursion_limit self.state.reached_recursion_limit
} }