Skip to content

Commit 1526f7a

Browse files
committed
Fix lint findings in librustc_typeck
1 parent 02f7de1 commit 1526f7a

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/librustc_typeck/check/method/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use super::{MethodError, NoMatchData, CandidateSource};
2626
use super::probe::Mode;
2727

2828
impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
29-
fn is_fn_ty(&self, ty: &Ty<'tcx>, span: Span) -> bool {
29+
fn is_fn_ty(&self, ty: Ty<'tcx>, span: Span) -> bool {
3030
let tcx = self.tcx;
3131
match ty.sty {
3232
// Not all of these (e.g., unsafe fns) implement `FnOnce`,

src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,10 +1026,10 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for GatherLocalsVisitor<'a, 'gcx, 'tcx> {
10261026
/// points.
10271027
struct GeneratorTypes<'tcx> {
10281028
/// Type of value that is yielded.
1029-
yield_ty: ty::Ty<'tcx>,
1029+
yield_ty: Ty<'tcx>,
10301030

10311031
/// Types that are captured (see `GeneratorInterior` for more).
1032-
interior: ty::Ty<'tcx>,
1032+
interior: Ty<'tcx>,
10331033

10341034
/// Indicates if the generator is movable or static (immovable).
10351035
movability: hir::GeneratorMovability,

src/librustc_typeck/check/writeback.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
405405
c_ty
406406
} else {
407407
span_bug!(
408-
hir_id.to_span(&self.fcx.tcx),
408+
hir_id.to_span(self.fcx.tcx),
409409
"writeback: `{:?}` missing from the global type context",
410410
c_ty
411411
);
@@ -730,7 +730,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
730730
lifted
731731
} else {
732732
span_bug!(
733-
span.to_span(&self.fcx.tcx),
733+
span.to_span(self.fcx.tcx),
734734
"writeback: `{:?}` missing from the global type context",
735735
x
736736
);
@@ -739,24 +739,24 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
739739
}
740740

741741
trait Locatable {
742-
fn to_span(&self, tcx: &TyCtxt<'_, '_, '_>) -> Span;
742+
fn to_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span;
743743
}
744744

745745
impl Locatable for Span {
746-
fn to_span(&self, _: &TyCtxt<'_, '_, '_>) -> Span {
746+
fn to_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
747747
*self
748748
}
749749
}
750750

751751
impl Locatable for DefIndex {
752-
fn to_span(&self, tcx: &TyCtxt<'_, '_, '_>) -> Span {
752+
fn to_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
753753
let hir_id = tcx.hir().def_index_to_hir_id(*self);
754754
tcx.hir().span_by_hir_id(hir_id)
755755
}
756756
}
757757

758758
impl Locatable for hir::HirId {
759-
fn to_span(&self, tcx: &TyCtxt<'_, '_, '_>) -> Span {
759+
fn to_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
760760
tcx.hir().span_by_hir_id(*self)
761761
}
762762
}
@@ -789,7 +789,7 @@ impl<'cx, 'gcx, 'tcx> Resolver<'cx, 'gcx, 'tcx> {
789789
fn report_error(&self, t: Ty<'tcx>) {
790790
if !self.tcx.sess.has_errors() {
791791
self.infcx
792-
.need_type_info_err(Some(self.body.id()), self.span.to_span(&self.tcx), t)
792+
.need_type_info_err(Some(self.body.id()), self.span.to_span(self.tcx), t)
793793
.emit();
794794
}
795795
}

src/librustc_typeck/collect.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,8 +1451,8 @@ pub fn checked_type_of<'a, 'tcx>(
14511451
fn find_existential_constraints<'a, 'tcx>(
14521452
tcx: TyCtxt<'a, 'tcx, 'tcx>,
14531453
def_id: DefId,
1454-
) -> ty::Ty<'tcx> {
1455-
use rustc::hir::*;
1454+
) -> Ty<'tcx> {
1455+
use rustc::hir::{ImplItem, Item, TraitItem};
14561456

14571457
struct ConstraintLocator<'a, 'tcx: 'a> {
14581458
tcx: TyCtxt<'a, 'tcx, 'tcx>,
@@ -1463,7 +1463,7 @@ fn find_existential_constraints<'a, 'tcx>(
14631463
// The mapping is an index for each use site of a generic parameter in the concrete type
14641464
//
14651465
// The indices index into the generic parameters on the existential type.
1466-
found: Option<(Span, ty::Ty<'tcx>, Vec<usize>)>,
1466+
found: Option<(Span, Ty<'tcx>, Vec<usize>)>,
14671467
}
14681468

14691469
impl<'a, 'tcx> ConstraintLocator<'a, 'tcx> {
@@ -1519,7 +1519,7 @@ fn find_existential_constraints<'a, 'tcx>(
15191519
ty::Param(p) => Some(*index_map.get(p).unwrap()),
15201520
_ => None,
15211521
}).collect();
1522-
let is_param = |ty: ty::Ty<'_>| match ty.sty {
1522+
let is_param = |ty: Ty<'_>| match ty.sty {
15231523
ty::Param(_) => true,
15241524
_ => false,
15251525
};

0 commit comments

Comments
 (0)