about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-01-29 23:34:58 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-02-03 23:40:46 +0000
commit9c166cb6713e1cbeed1db6efc4f7eb1dfa150294 (patch)
tree1616a876e42426ce32893bf833191a311305b0a3
parent9fc71b45066bb9714dc1a1ab91e989b735f8cdef (diff)
downloadrust-9c166cb6713e1cbeed1db6efc4f7eb1dfa150294.tar.gz
rust-9c166cb6713e1cbeed1db6efc4f7eb1dfa150294.zip
Remove unneeded borrows and slices
-rw-r--r--src/librustc_resolve/build_reduced_graph.rs6
-rw-r--r--src/librustc_resolve/lib.rs10
-rw-r--r--src/librustc_resolve/resolve_imports.rs14
3 files changed, 15 insertions, 15 deletions
diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs
index e84525ca296..6bc73194aa9 100644
--- a/src/librustc_resolve/build_reduced_graph.rs
+++ b/src/librustc_resolve/build_reduced_graph.rs
@@ -297,7 +297,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
                     let external_module = self.new_extern_crate_module(parent_link, def);
                     self.define(parent, name, TypeNS, (external_module, sp));
 
-                    self.build_reduced_graph_for_external_crate(&external_module);
+                    self.build_reduced_graph_for_external_crate(external_module);
                 }
                 parent
             }
@@ -353,7 +353,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
                 for variant in &(*enum_definition).variants {
                     let item_def_id = self.ast_map.local_def_id(item.id);
                     self.build_reduced_graph_for_variant(variant, item_def_id,
-                                                         &module, variant_modifiers);
+                                                         module, variant_modifiers);
                 }
                 parent
             }
@@ -409,7 +409,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
                     };
 
                     let modifiers = DefModifiers::PUBLIC; // NB: not DefModifiers::IMPORTABLE
-                    self.define(&module_parent, item.name, ns, (def, item.span, modifiers));
+                    self.define(module_parent, item.name, ns, (def, item.span, modifiers));
 
                     self.trait_item_map.insert((item.name, def_id), item_def_id);
                 }
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index d2e6273790d..64973bd7916 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -1262,7 +1262,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     let segment_name = name.as_str();
                     let module_name = module_to_string(search_module);
                     let mut span = span;
-                    let msg = if "???" == &module_name[..] {
+                    let msg = if "???" == &module_name {
                         span.hi = span.lo + Pos::from_usize(segment_name.len());
 
                         match search_parent_externals(name, &self.current_module) {
@@ -1568,7 +1568,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                module_to_string(&*module_));
 
         // First, check the direct children of the module.
-        build_reduced_graph::populate_module_if_necessary(self, &module_);
+        build_reduced_graph::populate_module_if_necessary(self, module_);
 
         if let Some(binding) = module_.get_child(name, namespace) {
             debug!("(resolving name in module) found node as child");
@@ -1609,7 +1609,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         }
 
         // Descend into children and anonymous children.
-        build_reduced_graph::populate_module_if_necessary(self, &module_);
+        build_reduced_graph::populate_module_if_necessary(self, module_);
 
         module_.for_each_local_child(|_, _, child_node| {
             match child_node.module() {
@@ -2947,7 +2947,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         let containing_module;
         let last_private;
         match self.resolve_module_path_from_root(root_module,
-                                                 &module_path[..],
+                                                 &module_path,
                                                  0,
                                                  span,
                                                  LastMod(AllPublic)) {
@@ -2956,7 +2956,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     Some((span, msg)) => (span, msg),
                     None => {
                         let msg = format!("Use of undeclared module `::{}`",
-                                          names_to_string(&module_path[..]));
+                                          names_to_string(&module_path));
                         (span, msg)
                     }
                 };
diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs
index 577f346fbe5..3d2300e44c4 100644
--- a/src/librustc_resolve/resolve_imports.rs
+++ b/src/librustc_resolve/resolve_imports.rs
@@ -257,7 +257,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
         errors.extend(self.resolve_imports_for_module(module_));
         self.resolver.current_module = orig_module;
 
-        build_reduced_graph::populate_module_if_necessary(self.resolver, &module_);
+        build_reduced_graph::populate_module_if_necessary(self.resolver, module_);
         module_.for_each_local_child(|_, _, child_node| {
             match child_node.module() {
                 None => {
@@ -345,14 +345,14 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
                 // We found the module that the target is contained
                 // within. Attempt to resolve the import within it.
                 if let SingleImport(target, source) = import_directive.subclass {
-                    self.resolve_single_import(&module_,
+                    self.resolve_single_import(module_,
                                                containing_module,
                                                target,
                                                source,
                                                import_directive,
                                                lp)
                 } else {
-                    self.resolve_glob_import(&module_, containing_module, import_directive, lp)
+                    self.resolve_glob_import(module_, containing_module, import_directive, lp)
                 }
             })
             .and_then(|()| {
@@ -465,9 +465,9 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
 
         // We need to resolve both namespaces for this to succeed.
         let (value_result, value_used_reexport) =
-            self.resolve_name_in_module(&target_module, source, ValueNS, module_);
+            self.resolve_name_in_module(target_module, source, ValueNS, module_);
         let (type_result, type_used_reexport) =
-            self.resolve_name_in_module(&target_module, source, TypeNS, module_);
+            self.resolve_name_in_module(target_module, source, TypeNS, module_);
 
         match (&value_result, &type_result) {
             (&Success((_, ref name_binding)), _) if !value_used_reexport &&
@@ -585,7 +585,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
         if let (&Failed(_), &Failed(_)) = (&value_result, &type_result) {
             let msg = format!("There is no `{}` in `{}`{}",
                               source,
-                              module_to_string(&target_module), lev_suggestion);
+                              module_to_string(target_module), lev_suggestion);
             return Failed(Some((directive.span, msg)));
         }
 
@@ -711,7 +711,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
         }
 
         // Add all children from the containing module.
-        build_reduced_graph::populate_module_if_necessary(self.resolver, &target_module);
+        build_reduced_graph::populate_module_if_necessary(self.resolver, target_module);
 
         target_module.for_each_local_child(|name, ns, name_binding| {
             self.merge_import_resolution(module_,