1
Fork 0

Remove overloaded_span argument from new, where it is usually redundant with the main span

This commit is contained in:
Oli Scherer 2022-11-08 15:49:29 +00:00
parent a7a40ddc79
commit 1d93b35855
6 changed files with 11 additions and 22 deletions

View file

@ -99,12 +99,11 @@ 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,
overloaded_span: span,
body_id,
param_env,
state: AutoderefSnapshot {
@ -119,6 +118,10 @@ 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);