Skip to content

Commit b745a29

Browse files
committed
Remove an unused span
1 parent 1d93b35 commit b745a29

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

compiler/rustc_hir_typeck/src/autoderef.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
4444
|InferOk { value: method, obligations: o }| {
4545
obligations.extend(o);
4646
if let ty::Ref(region, _, mutbl) = *method.sig.output().kind() {
47-
Some(OverloadedDeref {
48-
region,
49-
mutbl,
50-
span: autoderef.overloaded_span(),
51-
})
47+
Some(OverloadedDeref { region, mutbl, span: autoderef.span() })
5248
} else {
5349
None
5450
}

compiler/rustc_hir_typeck/src/method/confirm.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
151151
) -> Ty<'tcx> {
152152
// Commit the autoderefs by calling `autoderef` again, but this
153153
// time writing the results into the various typeck results.
154-
let mut autoderef =
155-
self.autoderef(self.span, unadjusted_self_ty).with_overloaded_span(self.call_expr.span);
154+
let mut autoderef = self.autoderef(self.call_expr.span, unadjusted_self_ty);
156155
let Some((ty, n)) = autoderef.nth(pick.autoderefs) else {
157156
return self.tcx.ty_error_with_message(
158157
rustc_span::DUMMY_SP,

compiler/rustc_trait_selection/src/autoderef.rs

-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub struct Autoderef<'a, 'tcx> {
2727
// Meta infos:
2828
infcx: &'a InferCtxt<'tcx>,
2929
span: Span,
30-
overloaded_span: Span,
3130
body_id: hir::HirId,
3231
param_env: ty::ParamEnv<'tcx>,
3332

@@ -103,7 +102,6 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
103102
Autoderef {
104103
infcx,
105104
span,
106-
overloaded_span: span,
107105
body_id,
108106
param_env,
109107
state: AutoderefSnapshot {
@@ -118,10 +116,6 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
118116
}
119117
}
120118

121-
pub fn with_overloaded_span(self, overloaded_span: Span) -> Self {
122-
Self { overloaded_span, ..self }
123-
}
124-
125119
fn overloaded_deref_ty(&mut self, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
126120
debug!("overloaded_deref_ty({:?})", ty);
127121

@@ -196,10 +190,6 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
196190
self.span
197191
}
198192

199-
pub fn overloaded_span(&self) -> Span {
200-
self.overloaded_span
201-
}
202-
203193
pub fn reached_recursion_limit(&self) -> bool {
204194
self.state.reached_recursion_limit
205195
}

0 commit comments

Comments
 (0)