Skip to content

Commit

Permalink
Remove an unused span
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Nov 8, 2022
1 parent 1d93b35 commit b745a29
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
6 changes: 1 addition & 5 deletions compiler/rustc_hir_typeck/src/autoderef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|InferOk { value: method, obligations: o }| {
obligations.extend(o);
if let ty::Ref(region, _, mutbl) = *method.sig.output().kind() {
Some(OverloadedDeref {
region,
mutbl,
span: autoderef.overloaded_span(),
})
Some(OverloadedDeref { region, mutbl, span: autoderef.span() })
} else {
None
}
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_hir_typeck/src/method/confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
) -> Ty<'tcx> {
// Commit the autoderefs by calling `autoderef` again, but this
// time writing the results into the various typeck results.
let mut autoderef =
self.autoderef(self.span, unadjusted_self_ty).with_overloaded_span(self.call_expr.span);
let mut autoderef = self.autoderef(self.call_expr.span, unadjusted_self_ty);
let Some((ty, n)) = autoderef.nth(pick.autoderefs) else {
return self.tcx.ty_error_with_message(
rustc_span::DUMMY_SP,
Expand Down
10 changes: 0 additions & 10 deletions compiler/rustc_trait_selection/src/autoderef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub struct Autoderef<'a, 'tcx> {
// Meta infos:
infcx: &'a InferCtxt<'tcx>,
span: Span,
overloaded_span: Span,
body_id: hir::HirId,
param_env: ty::ParamEnv<'tcx>,

Expand Down Expand Up @@ -103,7 +102,6 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
Autoderef {
infcx,
span,
overloaded_span: span,
body_id,
param_env,
state: AutoderefSnapshot {
Expand All @@ -118,10 +116,6 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
}
}

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>> {
debug!("overloaded_deref_ty({:?})", ty);

Expand Down Expand Up @@ -196,10 +190,6 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
self.span
}

pub fn overloaded_span(&self) -> Span {
self.overloaded_span
}

pub fn reached_recursion_limit(&self) -> bool {
self.state.reached_recursion_limit
}
Expand Down

0 comments on commit b745a29

Please sign in to comment.