]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/coherence/mod.rs
Various minor/cosmetic improvements to code
[rust.git] / src / librustc_typeck / coherence / mod.rs
index 9b17654d4690c7f24add30b5ac58919e8e7240b3..0360617be3c491776b5f3d94245367e74ff6108d 100644 (file)
@@ -29,7 +29,7 @@
 mod unsafety;
 
 fn check_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) {
-    let impl_def_id = tcx.hir.local_def_id(node_id);
+    let impl_def_id = tcx.hir().local_def_id(node_id);
 
     // If there are no traits, then this implementation must have a
     // base type.
@@ -40,7 +40,7 @@ fn check_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) {
                tcx.item_path_str(impl_def_id));
 
         // Skip impls where one of the self type is an error type.
-        // This occurs with e.g. resolve failures (#30589).
+        // This occurs with e.g., resolve failures (#30589).
         if trait_ref.references_error() {
             return;
         }
@@ -135,7 +135,7 @@ pub fn provide(providers: &mut Providers) {
 }
 
 fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {
-    let impls = tcx.hir.trait_impls(def_id);
+    let impls = tcx.hir().trait_impls(def_id);
     for &impl_id in impls {
         check_impl(tcx, impl_id);
     }
@@ -146,7 +146,7 @@ fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {
 }
 
 pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
-    for &trait_def_id in tcx.hir.krate().trait_impls.keys() {
+    for &trait_def_id in tcx.hir().krate().trait_impls.keys() {
         ty::query::queries::coherent_trait::ensure(tcx, trait_def_id);
     }
 
@@ -162,7 +162,7 @@ pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
 /// same type. Likewise, no two inherent impls for a given type
 /// constructor provide a method with the same name.
 fn check_impl_overlap<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) {
-    let impl_def_id = tcx.hir.local_def_id(node_id);
+    let impl_def_id = tcx.hir().local_def_id(node_id);
     let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
     let trait_def_id = trait_ref.def_id;