Rollup merge of #104156 - oli-obk:autoderef, r=estebank
Cleanups in autoderef impl Just something I noticed. Turns out the `overloaded_span` is not actually used separately from the main span, so I merged them.
This commit is contained in:
commit
a709cc1f32
7 changed files with 8 additions and 35 deletions
|
@ -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>,
|
||||
|
||||
|
@ -99,12 +98,10 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
|
|||
body_id: hir::HirId,
|
||||
span: Span,
|
||||
base_ty: Ty<'tcx>,
|
||||
overloaded_span: Span,
|
||||
) -> Autoderef<'a, 'tcx> {
|
||||
Autoderef {
|
||||
infcx,
|
||||
span,
|
||||
overloaded_span,
|
||||
body_id,
|
||||
param_env,
|
||||
state: AutoderefSnapshot {
|
||||
|
@ -193,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
|
||||
}
|
||||
|
|
|
@ -714,7 +714,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
obligation.cause.body_id,
|
||||
span,
|
||||
base_ty,
|
||||
span,
|
||||
);
|
||||
if let Some(steps) = autoderef.find_map(|(ty, steps)| {
|
||||
// Re-add the `&`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue