about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-04-26 13:41:10 +0200
committerflip1995 <hello@philkrones.com>2019-04-28 21:19:26 +0200
commit1526f7a4eddcdbb3d8fab0a6ae3ca1caf327df55 (patch)
tree71ad60a07ac3c166b9080f7e8f3e532f8f6ac42a
parent02f7de1be5a1ca385a63b66b8d0af47ff5babf77 (diff)
downloadrust-1526f7a4eddcdbb3d8fab0a6ae3ca1caf327df55.tar.gz
rust-1526f7a4eddcdbb3d8fab0a6ae3ca1caf327df55.zip
Fix lint findings in librustc_typeck
-rw-r--r--src/librustc_typeck/check/method/suggest.rs2
-rw-r--r--src/librustc_typeck/check/mod.rs4
-rw-r--r--src/librustc_typeck/check/writeback.rs14
-rw-r--r--src/librustc_typeck/collect.rs8
4 files changed, 14 insertions, 14 deletions
diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs
index 7121b06e27a..35d4568bd9c 100644
--- a/src/librustc_typeck/check/method/suggest.rs
+++ b/src/librustc_typeck/check/method/suggest.rs
@@ -26,7 +26,7 @@ use super::{MethodError, NoMatchData, CandidateSource};
 use super::probe::Mode;
 
 impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
-    fn is_fn_ty(&self, ty: &Ty<'tcx>, span: Span) -> bool {
+    fn is_fn_ty(&self, ty: Ty<'tcx>, span: Span) -> bool {
         let tcx = self.tcx;
         match ty.sty {
             // Not all of these (e.g., unsafe fns) implement `FnOnce`,
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 250dd90c789..f1163847892 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -1026,10 +1026,10 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for GatherLocalsVisitor<'a, 'gcx, 'tcx> {
 /// points.
 struct GeneratorTypes<'tcx> {
     /// Type of value that is yielded.
-    yield_ty: ty::Ty<'tcx>,
+    yield_ty: Ty<'tcx>,
 
     /// Types that are captured (see `GeneratorInterior` for more).
-    interior: ty::Ty<'tcx>,
+    interior: Ty<'tcx>,
 
     /// Indicates if the generator is movable or static (immovable).
     movability: hir::GeneratorMovability,
diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs
index 193b17af55e..e4f690c6ec0 100644
--- a/src/librustc_typeck/check/writeback.rs
+++ b/src/librustc_typeck/check/writeback.rs
@@ -405,7 +405,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
                 c_ty
             } else {
                 span_bug!(
-                    hir_id.to_span(&self.fcx.tcx),
+                    hir_id.to_span(self.fcx.tcx),
                     "writeback: `{:?}` missing from the global type context",
                     c_ty
                 );
@@ -730,7 +730,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
             lifted
         } else {
             span_bug!(
-                span.to_span(&self.fcx.tcx),
+                span.to_span(self.fcx.tcx),
                 "writeback: `{:?}` missing from the global type context",
                 x
             );
@@ -739,24 +739,24 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
 }
 
 trait Locatable {
-    fn to_span(&self, tcx: &TyCtxt<'_, '_, '_>) -> Span;
+    fn to_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span;
 }
 
 impl Locatable for Span {
-    fn to_span(&self, _: &TyCtxt<'_, '_, '_>) -> Span {
+    fn to_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         *self
     }
 }
 
 impl Locatable for DefIndex {
-    fn to_span(&self, tcx: &TyCtxt<'_, '_, '_>) -> Span {
+    fn to_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         let hir_id = tcx.hir().def_index_to_hir_id(*self);
         tcx.hir().span_by_hir_id(hir_id)
     }
 }
 
 impl Locatable for hir::HirId {
-    fn to_span(&self, tcx: &TyCtxt<'_, '_, '_>) -> Span {
+    fn to_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.hir().span_by_hir_id(*self)
     }
 }
@@ -789,7 +789,7 @@ impl<'cx, 'gcx, 'tcx> Resolver<'cx, 'gcx, 'tcx> {
     fn report_error(&self, t: Ty<'tcx>) {
         if !self.tcx.sess.has_errors() {
             self.infcx
-                .need_type_info_err(Some(self.body.id()), self.span.to_span(&self.tcx), t)
+                .need_type_info_err(Some(self.body.id()), self.span.to_span(self.tcx), t)
                 .emit();
         }
     }
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index afb30af054f..b4f6ae9baae 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -1451,8 +1451,8 @@ pub fn checked_type_of<'a, 'tcx>(
 fn find_existential_constraints<'a, 'tcx>(
     tcx: TyCtxt<'a, 'tcx, 'tcx>,
     def_id: DefId,
-) -> ty::Ty<'tcx> {
-    use rustc::hir::*;
+) -> Ty<'tcx> {
+    use rustc::hir::{ImplItem, Item, TraitItem};
 
     struct ConstraintLocator<'a, 'tcx: 'a> {
         tcx: TyCtxt<'a, 'tcx, 'tcx>,
@@ -1463,7 +1463,7 @@ fn find_existential_constraints<'a, 'tcx>(
         // The mapping is an index for each use site of a generic parameter in the concrete type
         //
         // The indices index into the generic parameters on the existential type.
-        found: Option<(Span, ty::Ty<'tcx>, Vec<usize>)>,
+        found: Option<(Span, Ty<'tcx>, Vec<usize>)>,
     }
 
     impl<'a, 'tcx> ConstraintLocator<'a, 'tcx> {
@@ -1519,7 +1519,7 @@ fn find_existential_constraints<'a, 'tcx>(
                         ty::Param(p) => Some(*index_map.get(p).unwrap()),
                         _ => None,
                     }).collect();
-                let is_param = |ty: ty::Ty<'_>| match ty.sty {
+                let is_param = |ty: Ty<'_>| match ty.sty {
                     ty::Param(_) => true,
                     _ => false,
                 };