]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Wed, 16 Aug 2017 04:00:24 +0000 (04:00 +0000)
committerbors <bors@rust-lang.org>
Wed, 16 Aug 2017 04:00:24 +0000 (04:00 +0000)
use field init shorthand EVERYWHERE

Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_.

r? @Mark-Simulacrum

281 files changed:
src/bootstrap/builder.rs
src/bootstrap/check.rs
src/bootstrap/compile.rs
src/bootstrap/doc.rs
src/bootstrap/flags.rs
src/bootstrap/lib.rs
src/bootstrap/metadata.rs
src/liballoc/arc.rs
src/liballoc/binary_heap.rs
src/liballoc/boxed.rs
src/liballoc/btree/map.rs
src/liballoc/btree/node.rs
src/liballoc/linked_list.rs
src/liballoc/raw_vec.rs
src/liballoc/rc.rs
src/liballoc/slice.rs
src/liballoc/string.rs
src/liballoc/vec.rs
src/liballoc/vec_deque.rs
src/libcore/fmt/builders.rs
src/libcore/fmt/mod.rs
src/libcore/iter/mod.rs
src/libcore/iter/traits.rs
src/libcore/num/diy_float.rs
src/libcore/num/flt2dec/mod.rs
src/libcore/slice/mod.rs
src/libcore/str/mod.rs
src/libcore/str/pattern.rs
src/libcore/tests/iter.rs
src/libcore/tests/option.rs
src/libfmt_macros/lib.rs
src/libgetopts/lib.rs
src/libgraphviz/lib.rs
src/libpanic_unwind/gcc.rs
src/librand/distributions/gamma.rs
src/librand/distributions/mod.rs
src/librand/distributions/normal.rs
src/librand/distributions/range.rs
src/librand/lib.rs
src/librand/reseeding.rs
src/librustc/middle/dead.rs
src/librustc/ty/context.rs
src/librustc/ty/relate.rs
src/librustc/ty/structural_impls.rs
src/librustc/ty/sty.rs
src/librustc_allocator/expand.rs
src/librustc_back/target/apple_ios_base.rs
src/librustc_back/target/l4re_base.rs
src/librustc_back/target/le32_unknown_nacl.rs
src/librustc_back/target/wasm32_experimental_emscripten.rs
src/librustc_back/target/wasm32_unknown_emscripten.rs
src/librustc_back/target/windows_base.rs
src/librustc_borrowck/borrowck/check_loans.rs
src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs
src/librustc_borrowck/borrowck/gather_loans/lifetime.rs
src/librustc_borrowck/borrowck/gather_loans/mod.rs
src/librustc_borrowck/borrowck/gather_loans/move_error.rs
src/librustc_borrowck/borrowck/gather_loans/restrictions.rs
src/librustc_borrowck/borrowck/mod.rs
src/librustc_borrowck/borrowck/move_data.rs
src/librustc_const_eval/_match.rs
src/librustc_const_eval/check_match.rs
src/librustc_const_eval/eval.rs
src/librustc_const_eval/pattern.rs
src/librustc_data_structures/array_vec.rs
src/librustc_data_structures/bitvec.rs
src/librustc_data_structures/control_flow_graph/dominators/mod.rs
src/librustc_data_structures/control_flow_graph/test.rs
src/librustc_data_structures/control_flow_graph/transpose.rs
src/librustc_data_structures/graph/mod.rs
src/librustc_data_structures/obligation_forest/mod.rs
src/librustc_data_structures/unify/mod.rs
src/librustc_driver/driver.rs
src/librustc_driver/lib.rs
src/librustc_driver/pretty.rs
src/librustc_errors/diagnostic.rs
src/librustc_errors/diagnostic_builder.rs
src/librustc_errors/emitter.rs
src/librustc_errors/lib.rs
src/librustc_incremental/assert_dep_graph.rs
src/librustc_incremental/persist/dirty_clean.rs
src/librustc_incremental/persist/hash.rs
src/librustc_incremental/persist/preds/compress/classify/mod.rs
src/librustc_incremental/persist/preds/mod.rs
src/librustc_incremental/persist/work_product.rs
src/librustc_llvm/archive_ro.rs
src/librustc_llvm/diagnostic.rs
src/librustc_metadata/astencode.rs
src/librustc_metadata/creader.rs
src/librustc_metadata/cstore.rs
src/librustc_metadata/cstore_impl.rs
src/librustc_metadata/decoder.rs
src/librustc_metadata/encoder.rs
src/librustc_metadata/index_builder.rs
src/librustc_metadata/isolated_encoder.rs
src/librustc_metadata/locator.rs
src/librustc_metadata/schema.rs
src/librustc_mir/build/cfg.rs
src/librustc_mir/build/expr/as_rvalue.rs
src/librustc_mir/build/expr/as_temp.rs
src/librustc_mir/build/expr/into.rs
src/librustc_mir/build/expr/stmt.rs
src/librustc_mir/build/matches/mod.rs
src/librustc_mir/build/matches/simplify.rs
src/librustc_mir/build/matches/test.rs
src/librustc_mir/build/matches/util.rs
src/librustc_mir/build/misc.rs
src/librustc_mir/build/mod.rs
src/librustc_mir/build/scope.rs
src/librustc_mir/dataflow/drop_flag_effects.rs
src/librustc_mir/dataflow/mod.rs
src/librustc_mir/dataflow/move_paths/abs_domain.rs
src/librustc_mir/dataflow/move_paths/mod.rs
src/librustc_mir/hair/cx/block.rs
src/librustc_mir/hair/cx/expr.rs
src/librustc_mir/shim.rs
src/librustc_mir/transform/add_call_guards.rs
src/librustc_mir/transform/copy_prop.rs
src/librustc_mir/transform/elaborate_drops.rs
src/librustc_mir/transform/erase_regions.rs
src/librustc_mir/transform/inline.rs
src/librustc_mir/transform/instcombine.rs
src/librustc_mir/transform/mod.rs
src/librustc_mir/transform/nll.rs
src/librustc_mir/transform/promote_consts.rs
src/librustc_mir/transform/qualify_consts.rs
src/librustc_mir/transform/simplify.rs
src/librustc_mir/transform/type_check.rs
src/librustc_mir/util/def_use.rs
src/librustc_mir/util/elaborate_drops.rs
src/librustc_mir/util/patch.rs
src/librustc_passes/consts.rs
src/librustc_passes/loops.rs
src/librustc_passes/static_recursion.rs
src/librustc_plugin/load.rs
src/librustc_plugin/registry.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/check_unused.rs
src/librustc_resolve/lib.rs
src/librustc_resolve/macros.rs
src/librustc_resolve/resolve_imports.rs
src/librustc_save_analysis/dump_visitor.rs
src/librustc_save_analysis/lib.rs
src/librustc_save_analysis/sig.rs
src/librustc_save_analysis/span_utils.rs
src/librustc_trans/abi.rs
src/librustc_trans/back/archive.rs
src/librustc_trans/back/link.rs
src/librustc_trans/back/linker.rs
src/librustc_trans/back/write.rs
src/librustc_trans/base.rs
src/librustc_trans/builder.rs
src/librustc_trans/collector.rs
src/librustc_trans/common.rs
src/librustc_trans/context.rs
src/librustc_trans/debuginfo/create_scope_map.rs
src/librustc_trans/debuginfo/metadata.rs
src/librustc_trans/debuginfo/mod.rs
src/librustc_trans/debuginfo/source_loc.rs
src/librustc_trans/mir/block.rs
src/librustc_trans/mir/constant.rs
src/librustc_trans/mir/lvalue.rs
src/librustc_trans/mir/mod.rs
src/librustc_trans/mir/operand.rs
src/librustc_trans/mir/rvalue.rs
src/librustc_trans/trans_item.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/autoderef.rs
src/librustc_typeck/check/cast.rs
src/librustc_typeck/check/coercion.rs
src/librustc_typeck/check/method/confirm.rs
src/librustc_typeck/check/method/mod.rs
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/method/suggest.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/regionck.rs
src/librustc_typeck/check/wfcheck.rs
src/librustc_typeck/check/writeback.rs
src/librustc_typeck/collect.rs
src/librustc_typeck/constrained_type_params.rs
src/librustc_typeck/variance/constraints.rs
src/librustc_typeck/variance/terms.rs
src/librustdoc/clean/inline.rs
src/librustdoc/clean/mod.rs
src/librustdoc/core.rs
src/librustdoc/fold.rs
src/librustdoc/html/highlight.rs
src/librustdoc/html/markdown.rs
src/librustdoc/html/render.rs
src/librustdoc/html/static/main.js
src/librustdoc/html/toc.rs
src/librustdoc/plugins.rs
src/librustdoc/test.rs
src/librustdoc/visit_ast.rs
src/librustdoc/visit_lib.rs
src/libserialize/json.rs
src/libserialize/opaque.rs
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/set.rs
src/libstd/collections/hash/table.rs
src/libstd/io/buffered.rs
src/libstd/io/error.rs
src/libstd/io/lazy.rs
src/libstd/panicking.rs
src/libstd/path.rs
src/libstd/process.rs
src/libstd/sync/mpsc/blocking.rs
src/libstd/sync/mpsc/select.rs
src/libstd/sync/mpsc/sync.rs
src/libstd/sys/redox/net/dns/mod.rs
src/libstd/sys/unix/backtrace/tracing/gcc_s.rs
src/libstd/sys/unix/ext/net.rs
src/libstd/sys/unix/process/magenta.rs
src/libstd/sys/unix/process/process_common.rs
src/libstd/sys/unix/weak.rs
src/libstd/sys/windows/backtrace/mod.rs
src/libstd/sys/windows/pipe.rs
src/libstd/sys/windows/thread_local.rs
src/libstd/sys_common/thread_info.rs
src/libstd/sys_common/thread_local.rs
src/libstd/thread/local.rs
src/libstd/time/duration.rs
src/libstd_unicode/u_str.rs
src/libsyntax/ast.rs
src/libsyntax/attr.rs
src/libsyntax/codemap.rs
src/libsyntax/config.rs
src/libsyntax/diagnostics/plugin.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/build.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/placeholders.rs
src/libsyntax/ext/quote.rs
src/libsyntax/ext/tt/macro_parser.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/ext/tt/quoted.rs
src/libsyntax/feature_gate.rs
src/libsyntax/fold.rs
src/libsyntax/json.rs
src/libsyntax/parse/attr.rs
src/libsyntax/parse/lexer/comments.rs
src/libsyntax/parse/lexer/mod.rs
src/libsyntax/parse/lexer/tokentrees.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pp.rs
src/libsyntax/print/pprust.rs
src/libsyntax/show_span.rs
src/libsyntax/std_inject.rs
src/libsyntax/test.rs
src/libsyntax_ext/asm.rs
src/libsyntax_ext/deriving/bounds.rs
src/libsyntax_ext/deriving/clone.rs
src/libsyntax_ext/deriving/cmp/eq.rs
src/libsyntax_ext/deriving/cmp/ord.rs
src/libsyntax_ext/deriving/cmp/partial_eq.rs
src/libsyntax_ext/deriving/cmp/partial_ord.rs
src/libsyntax_ext/deriving/debug.rs
src/libsyntax_ext/deriving/decodable.rs
src/libsyntax_ext/deriving/default.rs
src/libsyntax_ext/deriving/encodable.rs
src/libsyntax_ext/deriving/generic/mod.rs
src/libsyntax_ext/deriving/generic/ty.rs
src/libsyntax_ext/deriving/hash.rs
src/libsyntax_ext/deriving/mod.rs
src/libsyntax_ext/format.rs
src/libsyntax_ext/format_foreign.rs
src/libsyntax_ext/global_asm.rs
src/libsyntax_ext/proc_macro_registrar.rs
src/libsyntax_pos/hygiene.rs
src/libsyntax_pos/lib.rs
src/libterm/terminfo/mod.rs
src/libterm/terminfo/parser/compiled.rs
src/libtest/lib.rs
src/tools/build-manifest/src/main.rs
src/tools/compiletest/src/errors.rs
src/tools/compiletest/src/json.rs
src/tools/compiletest/src/main.rs
src/tools/compiletest/src/procsrv.rs
src/tools/compiletest/src/runtest.rs

index 91dddc7b5bc8ad6e9267736bda04167c602dd461..cf6ebb48b2c6c2bc9cc393181052f02a064e940d 100644 (file)
@@ -193,7 +193,7 @@ pub struct ShouldRun<'a> {
 impl<'a> ShouldRun<'a> {
     fn new(builder: &'a Builder) -> ShouldRun<'a> {
         ShouldRun {
-            builder: builder,
+            builder,
             paths: BTreeSet::new(),
             is_really_default: true, // by default no additional conditions
         }
@@ -278,9 +278,9 @@ pub fn get_help(build: &Build, subcommand: &str) -> Option<String> {
         };
 
         let builder = Builder {
-            build: build,
+            build,
             top_stage: build.config.stage.unwrap_or(2),
-            kind: kind,
+            kind,
             cache: Cache::new(),
             stack: RefCell::new(Vec::new()),
         };
@@ -309,9 +309,9 @@ pub fn run(build: &Build) {
         };
 
         let builder = Builder {
-            build: build,
+            build,
             top_stage: build.config.stage.unwrap_or(2),
-            kind: kind,
+            kind,
             cache: Cache::new(),
             stack: RefCell::new(Vec::new()),
         };
index 1823dd4ebc0434bc16607c2361e07e49fe593249..92fb2105b7c5d57133c6425069cc09ae853ae5a8 100644 (file)
@@ -872,7 +872,7 @@ fn make_run(run: RunConfig) {
             builder.ensure(CrateLibrustc {
                 compiler,
                 target: run.target,
-                test_kind: test_kind,
+                test_kind,
                 krate: name,
             });
         };
@@ -934,8 +934,8 @@ fn make_run(run: RunConfig) {
             builder.ensure(Crate {
                 compiler,
                 target: run.target,
-                mode: mode,
-                test_kind: test_kind,
+                mode,
+                test_kind,
                 krate: name,
             });
         };
index 33c3638a894730a85a0dc6bb2846ae05011f734f..78bc225447bd0b920e9a7189b51b6314f66b1805 100644 (file)
@@ -74,13 +74,13 @@ fn run(self, builder: &Builder) {
             let from = builder.compiler(1, build.build);
             builder.ensure(Std {
                 compiler: from,
-                target: target,
+                target,
             });
             println!("Uplifting stage1 std ({} -> {})", from.host, target);
             builder.ensure(StdLink {
                 compiler: from,
                 target_compiler: compiler,
-                target: target,
+                target,
             });
             return;
         }
@@ -100,7 +100,7 @@ fn run(self, builder: &Builder) {
         builder.ensure(StdLink {
             compiler: builder.compiler(compiler.stage, build.build),
             target_compiler: compiler,
-            target: target,
+            target,
         });
     }
 }
@@ -202,7 +202,7 @@ fn run(self, builder: &Builder) {
 
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
-            target: target,
+            target,
             mode: Mode::Libstd,
         });
     }
@@ -326,13 +326,13 @@ fn run(self, builder: &Builder) {
         if build.force_use_stage1(compiler, target) {
             builder.ensure(Test {
                 compiler: builder.compiler(1, build.build),
-                target: target,
+                target,
             });
             println!("Uplifting stage1 test ({} -> {})", &build.build, target);
             builder.ensure(TestLink {
                 compiler: builder.compiler(1, build.build),
                 target_compiler: compiler,
-                target: target,
+                target,
             });
             return;
         }
@@ -351,7 +351,7 @@ fn run(self, builder: &Builder) {
         builder.ensure(TestLink {
             compiler: builder.compiler(compiler.stage, build.build),
             target_compiler: compiler,
-            target: target,
+            target,
         });
     }
 }
@@ -398,7 +398,7 @@ fn run(self, builder: &Builder) {
                     &libtest_stamp(build, compiler, target));
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
-            target: target,
+            target,
             mode: Mode::Libtest,
         });
     }
@@ -445,7 +445,7 @@ fn run(self, builder: &Builder) {
         if build.force_use_stage1(compiler, target) {
             builder.ensure(Rustc {
                 compiler: builder.compiler(1, build.build),
-                target: target,
+                target,
             });
             println!("Uplifting stage1 rustc ({} -> {})", &build.build, target);
             builder.ensure(RustcLink {
@@ -581,7 +581,7 @@ fn run(self, builder: &Builder) {
                        &librustc_stamp(build, compiler, target));
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
-            target: target,
+            target,
             mode: Mode::Librustc,
         });
     }
index 05c7d689f2cb6db21dfee98d1501b8956e7ea388..5ade2c279e2fb88c63af966629865059ac159446 100644 (file)
@@ -213,13 +213,13 @@ fn run(self, builder: &Builder) {
         let name = self.name;
         // build book first edition
         builder.ensure(Rustbook {
-            target: target,
+            target,
             name: INTERNER.intern_string(format!("{}/first-edition", name)),
         });
 
         // build book second edition
         builder.ensure(Rustbook {
-            target: target,
+            target,
             name: INTERNER.intern_string(format!("{}/second-edition", name)),
         });
 
index a9cefb65f4963af4b6c4979ee7856e2ddd1fd5fd..a84d43d3deedef29b70483cfcfc7e29d36e9d702 100644 (file)
@@ -274,14 +274,14 @@ pub fn parse(args: &[String]) -> Flags {
             }
             "test" => {
                 Subcommand::Test {
-                    paths: paths,
+                    paths,
                     test_args: matches.opt_strs("test-args"),
                     fail_fast: !matches.opt_present("no-fail-fast"),
                 }
             }
             "bench" => {
                 Subcommand::Bench {
-                    paths: paths,
+                    paths,
                     test_args: matches.opt_strs("test-args"),
                 }
             }
@@ -297,12 +297,12 @@ pub fn parse(args: &[String]) -> Flags {
             }
             "dist" => {
                 Subcommand::Dist {
-                    paths: paths,
+                    paths,
                 }
             }
             "install" => {
                 Subcommand::Install {
-                    paths: paths,
+                    paths,
                 }
             }
             _ => {
@@ -324,7 +324,7 @@ pub fn parse(args: &[String]) -> Flags {
 
         Flags {
             verbose: matches.opt_count("verbose"),
-            stage: stage,
+            stage,
             on_fail: matches.opt_str("on-fail"),
             keep_stage: matches.opt_str("keep-stage").map(|j| j.parse().unwrap()),
             build: matches.opt_str("build").map(|s| INTERNER.intern_string(s)),
@@ -333,9 +333,9 @@ pub fn parse(args: &[String]) -> Flags {
             target: split(matches.opt_strs("target"))
                 .into_iter().map(|x| INTERNER.intern_string(x)).collect::<Vec<_>>(),
             config: cfg_file,
-            src: src,
+            src,
             jobs: matches.opt_str("jobs").map(|j| j.parse().unwrap()),
-            cmd: cmd,
+            cmd,
             incremental: matches.opt_present("incremental"),
         }
     }
index 1452a38f6ed283b1433d1a63ea28cc144406473e..17f8bcdf03da1438f62ecd7368b295a261b72f4a 100644 (file)
@@ -314,19 +314,19 @@ pub fn new(config: Config) -> Build {
             hosts: config.hosts.clone(),
             targets: config.targets.clone(),
 
-            config: config,
-            src: src,
-            out: out,
+            config,
+            src,
+            out,
 
-            rust_info: rust_info,
-            cargo_info: cargo_info,
-            rls_info: rls_info,
+            rust_info,
+            cargo_info,
+            rls_info,
             cc: HashMap::new(),
             cxx: HashMap::new(),
             crates: HashMap::new(),
             lldb_version: None,
             lldb_python_dir: None,
-            is_sudo: is_sudo,
+            is_sudo,
             ci_env: CiEnv::current(),
             delayed_failures: Cell::new(0),
         }
index ad555be877ae4cf7b364cfb3f376f8482ab8f500..5f1df1d26e27382516e6d0afc94254ae20d7076b 100644 (file)
@@ -75,10 +75,10 @@ fn build_krate(build: &mut Build, krate: &str) {
                 doc_step: format!("doc-crate-{}", name),
                 test_step: format!("test-crate-{}", name),
                 bench_step: format!("bench-crate-{}", name),
-                name: name,
+                name,
                 version: package.version,
                 deps: Vec::new(),
-                path: path,
+                path,
             });
         }
     }
index daf556795fa6b2b9bdb71d7b9193cc36ba769f9d..b967eaaaab5b1ca7b22e525f582345fb5b44d987 100644 (file)
@@ -278,7 +278,7 @@ pub fn new(data: T) -> Arc<T> {
         let x: Box<_> = box ArcInner {
             strong: atomic::AtomicUsize::new(1),
             weak: atomic::AtomicUsize::new(1),
-            data: data,
+            data,
         };
         Arc { ptr: Shared::from(Box::into_unique(x)) }
     }
index 988f88516255731e47a4f43cb9cdc9987b574afc..57640af816a57a3308e0e4a4d136d5f8a9b6ad6d 100644 (file)
@@ -853,9 +853,9 @@ unsafe fn new(data: &'a mut [T], pos: usize) -> Self {
         debug_assert!(pos < data.len());
         let elt = ptr::read(&data[pos]);
         Hole {
-            data: data,
+            data,
             elt: Some(elt),
-            pos: pos,
+            pos,
         }
     }
 
@@ -1203,7 +1203,7 @@ fn make_place(self) -> Self::Place {
         let place = Placer::make_place(self.data.place_back());
         BinaryHeapPlace {
             heap: ptr,
-            place: place,
+            place,
         }
     }
 }
index 6318d22059f96c09339337a9f32dd23453b1a96c..c0d43d9c52755d3086c480ff23dff7222d546bee 100644 (file)
@@ -169,7 +169,7 @@ fn make_place<T>() -> IntermediateBox<T> {
 
     IntermediateBox {
         ptr: p,
-        layout: layout,
+        layout,
         marker: marker::PhantomData,
     }
 }
index a51c70159db4d788c2a5454e161f22fe92627393..f733c3332e282e402f17fce6bafa6d1adf856919 100644 (file)
@@ -234,7 +234,7 @@ fn take(&mut self, key: &Q) -> Option<K> {
         match search::search_tree(self.root.as_mut(), key) {
             Found(handle) => {
                 Some(OccupiedEntry {
-                         handle: handle,
+                         handle,
                          length: &mut self.length,
                          _marker: PhantomData,
                      }
@@ -250,8 +250,8 @@ fn replace(&mut self, key: K) -> Option<K> {
             Found(handle) => Some(mem::replace(handle.into_kv_mut().0, key)),
             GoDown(handle) => {
                 VacantEntry {
-                    key: key,
-                    handle: handle,
+                    key,
+                    handle,
                     length: &mut self.length,
                     _marker: PhantomData,
                 }
@@ -695,7 +695,7 @@ pub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<V>
         match search::search_tree(self.root.as_mut(), key) {
             Found(handle) => {
                 Some(OccupiedEntry {
-                         handle: handle,
+                         handle,
                          length: &mut self.length,
                          _marker: PhantomData,
                      }
@@ -866,15 +866,15 @@ pub fn entry(&mut self, key: K) -> Entry<K, V> {
         match search::search_tree(self.root.as_mut(), &key) {
             Found(handle) => {
                 Occupied(OccupiedEntry {
-                    handle: handle,
+                    handle,
                     length: &mut self.length,
                     _marker: PhantomData,
                 })
             }
             GoDown(handle) => {
                 Vacant(VacantEntry {
-                    key: key,
-                    handle: handle,
+                    key,
+                    handle,
                     length: &mut self.length,
                     _marker: PhantomData,
                 })
index 0e61905131f6f3328b472b5a9eabe8d2be030d12..b057c18fca8952c43aee42eb5c6ea747196535e8 100644 (file)
@@ -776,8 +776,8 @@ pub fn new_kv(node: NodeRef<BorrowType, K, V, NodeType>, idx: usize) -> Self {
         debug_assert!(idx < node.len());
 
         Handle {
-            node: node,
-            idx: idx,
+            node,
+            idx,
             _marker: PhantomData
         }
     }
@@ -850,8 +850,8 @@ pub fn new_edge(node: NodeRef<BorrowType, K, V, NodeType>, idx: usize) -> Self {
         debug_assert!(idx <= node.len());
 
         Handle {
-            node: node,
-            idx: idx,
+            node,
+            idx,
             _marker: PhantomData
         }
     }
@@ -1149,7 +1149,7 @@ pub fn split(mut self)
 
             let mut new_root = Root {
                 node: BoxedNode::from_internal(new_node),
-                height: height
+                height,
             };
 
             for i in 0..(new_len+1) {
@@ -1449,12 +1449,12 @@ pub fn force(self) -> ForceResult<
     > {
         match self.node.force() {
             ForceResult::Leaf(node) => ForceResult::Leaf(Handle {
-                node: node,
+                node,
                 idx: self.idx,
                 _marker: PhantomData
             }),
             ForceResult::Internal(node) => ForceResult::Internal(Handle {
-                node: node,
+                node,
                 idx: self.idx,
                 _marker: PhantomData
             })
index 850dd6adcf0af08e3d8c033f500b1b577e53a397..f9512cbe977a41f942031f7fc9ee7051f3157273 100644 (file)
@@ -140,7 +140,7 @@ fn new(element: T) -> Self {
         Node {
             next: None,
             prev: None,
-            element: element,
+            element,
         }
     }
 
@@ -924,7 +924,7 @@ pub fn insert_next(&mut self, element: T) {
                 let node = Some(Shared::from(Box::into_unique(box Node {
                     next: Some(head),
                     prev: Some(prev),
-                    element: element,
+                    element,
                 })));
 
                 prev.as_mut().next = node;
index 6090fc3942a565c66ac056ab8d3f41e04ddab826..9a8614895f30c30bca9fe18600624674c439a049 100644 (file)
@@ -60,8 +60,8 @@ pub fn new_in(a: A) -> Self {
         // Unique::empty() doubles as "unallocated" and "zero-sized allocation"
         RawVec {
             ptr: Unique::empty(),
-            cap: cap,
-            a: a,
+            cap,
+            a,
         }
     }
 
@@ -104,8 +104,8 @@ fn allocate_in(cap: usize, zeroed: bool, mut a: A) -> Self {
 
             RawVec {
                 ptr: Unique::new_unchecked(ptr as *mut _),
-                cap: cap,
-                a: a,
+                cap,
+                a,
             }
         }
     }
@@ -159,8 +159,8 @@ impl<T, A: Alloc> RawVec<T, A> {
     pub unsafe fn from_raw_parts_in(ptr: *mut T, cap: usize, a: A) -> Self {
         RawVec {
             ptr: Unique::new_unchecked(ptr),
-            cap: cap,
-            a: a,
+            cap,
+            a,
         }
     }
 }
@@ -176,7 +176,7 @@ impl<T> RawVec<T, Heap> {
     pub unsafe fn from_raw_parts(ptr: *mut T, cap: usize) -> Self {
         RawVec {
             ptr: Unique::new_unchecked(ptr),
-            cap: cap,
+            cap,
             a: Heap,
         }
     }
index a2184054b377ebddde035eeea2cf5c1f4eb7769b..9783aed895f7d689e44582ba0b2ebb65b2598dcf 100644 (file)
@@ -311,7 +311,7 @@ pub fn new(value: T) -> Rc<T> {
             ptr: Shared::from(Box::into_unique(box RcBox {
                 strong: Cell::new(1),
                 weak: Cell::new(1),
-                value: value,
+                value,
             })),
         }
     }
index ec7a2b6d0e8d92595fe8154b03e0e7b72887e3d8..356ca7a5f5e0cee6adf9372629a330b886cc3774 100644 (file)
@@ -1886,7 +1886,7 @@ fn merge_sort<T, F>(v: &mut [T], mut is_less: F)
 
         // Push this run onto the stack.
         runs.push(Run {
-            start: start,
+            start,
             len: end - start,
         });
         end = start;
index a913d833a90e4ac1f53e71c601c3027c6c6b8a5f..76ee0158a62336c003fe84a662e5d6c39f105699 100644 (file)
@@ -1378,8 +1378,8 @@ pub fn drain<R>(&mut self, range: R) -> Drain
         let chars_iter = self[start..end].chars();
 
         Drain {
-            start: start,
-            end: end,
+            start,
+            end,
             iter: chars_iter,
             string: self_ptr,
         }
@@ -1442,11 +1442,11 @@ pub fn splice<'a, 'b, R>(&'a mut self, range: R, replace_with: &'b str) -> Splic
         let chars_iter = self[start..end].chars();
 
         Splice {
-            start: start,
-            end: end,
+            start,
+            end,
             iter: chars_iter,
             string: self_ptr,
-            replace_with: replace_with
+            replace_with,
         }
     }
 
index 9392ec3e6c5c67aee5b35a198dc882a58a078fcb..8141851b8c9af9cbd22567a94cc40309a55bccfd 100644 (file)
@@ -1728,9 +1728,9 @@ fn into_iter(mut self) -> IntoIter<T> {
             mem::forget(self);
             IntoIter {
                 buf: Shared::new_unchecked(begin),
-                cap: cap,
+                cap,
                 ptr: begin,
-                end: end,
+                end,
             }
         }
     }
index 2068c2c9c5fb56268f5ece03cd97bc06d1022dc6..bf9069200297d8e3a52132a3b83e1e9f94097bdb 100644 (file)
@@ -2442,7 +2442,7 @@ fn from(mut other: Vec<T>) -> Self {
             VecDeque {
                 tail: 0,
                 head: len,
-                buf: buf,
+                buf,
             }
         }
     }
index 322df6e5b47c690e5d05d0204de35701b40d9065..8125097d7d1056573e82d36c7297e36af77a2053 100644 (file)
@@ -18,7 +18,7 @@ struct PadAdapter<'a, 'b: 'a> {
 impl<'a, 'b: 'a> PadAdapter<'a, 'b> {
     fn new(fmt: &'a mut fmt::Formatter<'b>) -> PadAdapter<'a, 'b> {
         PadAdapter {
-            fmt: fmt,
+            fmt,
             on_newline: false,
         }
     }
@@ -94,8 +94,8 @@ pub fn debug_struct_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>,
                                 -> DebugStruct<'a, 'b> {
     let result = fmt.write_str(name);
     DebugStruct {
-        fmt: fmt,
-        result: result,
+        fmt,
+        result,
         has_fields: false,
     }
 }
@@ -185,8 +185,8 @@ pub struct DebugTuple<'a, 'b: 'a> {
 pub fn debug_tuple_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str) -> DebugTuple<'a, 'b> {
     let result = fmt.write_str(name);
     DebugTuple {
-        fmt: fmt,
-        result: result,
+        fmt,
+        result,
         fields: 0,
         empty_name: name.is_empty(),
     }
@@ -317,8 +317,8 @@ pub fn debug_set_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugSet<'a, 'b
     let result = write!(fmt, "{{");
     DebugSet {
         inner: DebugInner {
-            fmt: fmt,
-            result: result,
+            fmt,
+            result,
             has_fields: false,
         },
     }
@@ -388,8 +388,8 @@ pub fn debug_list_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugList<'a,
     let result = write!(fmt, "[");
     DebugList {
         inner: DebugInner {
-            fmt: fmt,
-            result: result,
+            fmt,
+            result,
             has_fields: false,
         },
     }
@@ -460,8 +460,8 @@ pub struct DebugMap<'a, 'b: 'a> {
 pub fn debug_map_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugMap<'a, 'b> {
     let result = write!(fmt, "{{");
     DebugMap {
-        fmt: fmt,
-        result: result,
+        fmt,
+        result,
         has_fields: false,
     }
 }
index 97839844087ce6525b8f405caf0e63a34cfe0cdc..cf6262bda9748355deef2461e76e919e5561ad94 100644 (file)
@@ -334,9 +334,9 @@ impl<'a> Arguments<'a> {
     pub fn new_v1(pieces: &'a [&'a str],
                   args: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
         Arguments {
-            pieces: pieces,
+            pieces,
             fmt: None,
-            args: args
+            args,
         }
     }
 
@@ -353,9 +353,9 @@ pub fn new_v1_formatted(pieces: &'a [&'a str],
                             args: &'a [ArgumentV1<'a>],
                             fmt: &'a [rt::v1::Argument]) -> Arguments<'a> {
         Arguments {
-            pieces: pieces,
+            pieces,
             fmt: Some(fmt),
-            args: args
+            args,
         }
     }
 
index 22b997a768e6d6f7d5543c2654b3a56601871c11..ebedfe1d743bb37583c7ac4ccd70f670a19dc5ac 100644 (file)
@@ -840,8 +840,8 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B>
     type Item = (A::Item, B::Item);
     default fn new(a: A, b: B) -> Self {
         Zip {
-            a: a,
-            b: b,
+            a,
+            b,
             index: 0, // unused
             len: 0, // unused
         }
@@ -903,10 +903,10 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B>
     fn new(a: A, b: B) -> Self {
         let len = cmp::min(a.len(), b.len());
         Zip {
-            a: a,
-            b: b,
+            a,
+            b,
             index: 0,
-            len: len,
+            len,
         }
     }
 
index 19098f036acd2c428308cc85cfddf32246978b96..2af129a67bddf94ef471a45538f090a46b68234a 100644 (file)
@@ -744,7 +744,7 @@ pub fn process<F, U>(iter: I, mut f: F) -> Result<U, E>
 
     fn new(iter: I) -> Self {
         ResultShunt {
-            iter: iter,
+            iter,
             error: None,
         }
     }
index 6635d95155f4baa4537a0cce133ff8f10bb806a6..97bcba2f2ffbc8b9da881fe3bdcdb789b5c3ee8e 100644 (file)
@@ -86,7 +86,7 @@ pub fn normalize_to(&self, e: i16) -> Fp {
         assert_eq!(self.f << edelta >> edelta, self.f);
         Fp {
             f: self.f << edelta,
-            e: e,
+            e,
         }
     }
 }
index 74b9e7bf37d5110a754d51a532d2eef5e9ea8d00..beaa6e140a6993b978c6b60bf63f7eb775bb2199 100644 (file)
@@ -442,7 +442,7 @@ pub fn to_shortest_str<'a, T, F>(mut format_shortest: F, v: T,
         }
         FullDecoded::Finite(ref decoded) => {
             let (len, exp) = format_shortest(decoded, buf);
-            Formatted { sign: sign,
+            Formatted { sign,
                         parts: digits_to_dec_str(&buf[..len], exp, frac_digits, parts) }
         }
     }
@@ -581,7 +581,7 @@ pub fn to_exact_exp_str<'a, T, F>(mut format_exact: F, v: T,
 
             let trunc = if ndigits < maxlen { ndigits } else { maxlen };
             let (len, exp) = format_exact(decoded, &mut buf[..trunc], i16::MIN);
-            Formatted { sign: sign,
+            Formatted { sign,
                         parts: digits_to_exp_str(&buf[..len], exp, ndigits, upper, parts) }
         }
     }
@@ -652,7 +652,7 @@ pub fn to_exact_fixed_str<'a, T, F>(mut format_exact: F, v: T,
                     Formatted { sign: sign, parts: &parts[..1] }
                 }
             } else {
-                Formatted { sign: sign,
+                Formatted { sign,
                             parts: digits_to_dec_str(&buf[..len], exp, frac_digits, parts) }
             }
         }
index fa0c482e55c916ba7fa54591a2bcf9cb76fd047d..0509936153c39c5d244ca0be69c8991eb1d2ceb9 100644 (file)
@@ -300,7 +300,7 @@ fn split<P>(&self, pred: P) -> Split<T, P>
     {
         Split {
             v: self,
-            pred: pred,
+            pred,
             finished: false
         }
     }
index 4c99fe97dafa38a73d64cfddd626ef583675d087..a5f6e49a53b4f7cff5238d4b2a85b8edce0c589c 100644 (file)
@@ -2233,7 +2233,7 @@ fn rsplit<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplit<'a, P>
     fn splitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> SplitN<'a, P> {
         SplitN(SplitNInternal {
             iter: self.split(pat).0,
-            count: count,
+            count,
         })
     }
 
index c4ff95b1d6a49dffc151b9a8c516e6218ab7f03b..edb7bed4520fb0e1df9f5635cc96a6eebc1078ff 100644 (file)
@@ -290,7 +290,7 @@ impl<'a, C: CharEq> Pattern<'a> for CharEqPattern<C> {
     fn into_searcher(self, haystack: &'a str) -> CharEqSearcher<'a, C> {
         CharEqSearcher {
             ascii_only: self.0.only_ascii(),
-            haystack: haystack,
+            haystack,
             char_eq: self.0,
             char_indices: haystack.char_indices(),
         }
@@ -596,8 +596,8 @@ impl<'a, 'b> StrSearcher<'a, 'b> {
     fn new(haystack: &'a str, needle: &'b str) -> StrSearcher<'a, 'b> {
         if needle.is_empty() {
             StrSearcher {
-                haystack: haystack,
-                needle: needle,
+                haystack,
+                needle,
                 searcher: StrSearcherImpl::Empty(EmptyNeedle {
                     position: 0,
                     end: haystack.len(),
@@ -607,8 +607,8 @@ fn new(haystack: &'a str, needle: &'b str) -> StrSearcher<'a, 'b> {
             }
         } else {
             StrSearcher {
-                haystack: haystack,
-                needle: needle,
+                haystack,
+                needle,
                 searcher: StrSearcherImpl::TwoWay(
                     TwoWaySearcher::new(needle.as_bytes(), haystack.len())
                 ),
@@ -899,13 +899,13 @@ fn new(needle: &[u8], end: usize) -> TwoWaySearcher {
                 TwoWaySearcher::reverse_maximal_suffix(needle, period, true));
 
             TwoWaySearcher {
-                crit_pos: crit_pos,
-                crit_pos_back: crit_pos_back,
-                period: period,
+                crit_pos,
+                crit_pos_back,
+                period,
                 byteset: Self::byteset_create(&needle[..period]),
 
                 position: 0,
-                end: end,
+                end,
                 memory: 0,
                 memory_back: needle.len(),
             }
@@ -918,13 +918,13 @@ fn new(needle: &[u8], end: usize) -> TwoWaySearcher {
             // reverse search.
 
             TwoWaySearcher {
-                crit_pos: crit_pos,
+                crit_pos,
                 crit_pos_back: crit_pos,
                 period: cmp::max(crit_pos, needle.len() - crit_pos) + 1,
                 byteset: Self::byteset_create(needle),
 
                 position: 0,
-                end: end,
+                end,
                 memory: usize::MAX, // Dummy value to signify that the period is long
                 memory_back: usize::MAX,
             }
index a1249a5f22cf73c797e0f98dfab73f0a8db945a4..ed6923929d6b0b15d0ac294c67fd159c5105af98 100644 (file)
@@ -392,7 +392,7 @@ pub struct CycleIter<'a, T: 'a> {
 pub fn cycle<T>(data: &[T]) -> CycleIter<T> {
     CycleIter {
         index: 0,
-        data: data,
+        data,
     }
 }
 
index 51b0655f680f6186857c7e07cdedaa640326ab16..6bac55575fb1817d72abfe7f0522c1d551cf1da8 100644 (file)
@@ -53,7 +53,7 @@ fn drop(&mut self) {
 
     fn r(i: Rc<RefCell<isize>>) -> R {
         R {
-            i: i
+            i,
         }
     }
 
index 493ce04f672a6dee01ae19b1e331dce09f2375fe..43345c6d0977b3e2d07675418fdb94bba4d4f295 100644 (file)
@@ -284,7 +284,7 @@ fn argument(&mut self) -> Argument<'a> {
 
         Argument {
             position: pos,
-            format: format,
+            format,
         }
     }
 
index f41fc5aa29fa42339a45fed41543b489f1c5f168..83f2de54023158d9a954df22aba65103e413e988 100644 (file)
@@ -250,28 +250,28 @@ pub fn long_to_short(&self) -> Opt {
             (0, _) => {
                 Opt {
                     name: Long((long_name)),
-                    hasarg: hasarg,
-                    occur: occur,
+                    hasarg,
+                    occur,
                     aliases: Vec::new(),
                 }
             }
             (1, 0) => {
                 Opt {
                     name: Short(short_name.chars().next().unwrap()),
-                    hasarg: hasarg,
-                    occur: occur,
+                    hasarg,
+                    occur,
                     aliases: Vec::new(),
                 }
             }
             (1, _) => {
                 Opt {
                     name: Long((long_name)),
-                    hasarg: hasarg,
-                    occur: occur,
+                    hasarg,
+                    occur,
                     aliases: vec![Opt {
                                       name: Short(short_name.chars().next().unwrap()),
-                                      hasarg: hasarg,
-                                      occur: occur,
+                                      hasarg,
+                                      occur,
                                       aliases: Vec::new(),
                                   }],
                 }
@@ -530,8 +530,8 @@ pub fn opt(short_name: &str,
         long_name: long_name.to_owned(),
         hint: hint.to_owned(),
         desc: desc.to_owned(),
-        hasarg: hasarg,
-        occur: occur,
+        hasarg,
+        occur,
     }
 }
 
@@ -681,9 +681,9 @@ fn f(_x: usize) -> Vec<Optval> {
         }
     }
     Ok(Matches {
-        opts: opts,
-        vals: vals,
-        free: free,
+        opts,
+        vals,
+        free,
     })
 }
 
index c01938f5e117435c4b8ef806ffd0e2deedaf977c..d66fba18f475c0258932deec3bb486392a7cbe50 100644 (file)
@@ -781,10 +781,10 @@ struct Edge {
 
     fn edge(from: usize, to: usize, label: &'static str, style: Style) -> Edge {
         Edge {
-            from: from,
-            to: to,
-            label: label,
-            style: style,
+            from,
+            to,
+            label,
+            style,
         }
     }
 
@@ -848,9 +848,9 @@ fn new(name: &'static str,
                -> LabelledGraph {
             let count = node_labels.len();
             LabelledGraph {
-                name: name,
+                name,
                 node_labels: node_labels.to_opt_strs(),
-                edges: edges,
+                edges,
                 node_styles: match node_styles {
                     Some(nodes) => nodes,
                     None => vec![Style::None; count],
index aadbeb96b2d235a255c8981c445de957fb39223c..63e44f71a3a8f3d7249b084cd79e97fcd159580f 100644 (file)
@@ -74,7 +74,7 @@ pub unsafe fn panic(data: Box<Any + Send>) -> u32 {
     let exception = Box::new(Exception {
         _uwe: uw::_Unwind_Exception {
             exception_class: rust_exception_class(),
-            exception_cleanup: exception_cleanup,
+            exception_cleanup,
             private: [0; uw::unwinder_private_data_size],
         },
         cause: Some(data),
index 9a42b82beff67ef674e45aab0779d3cd40e8ac3e..188e71f3fa948271ff5052e21baff67b0c1bb778 100644 (file)
@@ -127,9 +127,9 @@ impl GammaLargeShape {
     fn new_raw(shape: f64, scale: f64) -> GammaLargeShape {
         let d = shape - 1. / 3.;
         GammaLargeShape {
-            scale: scale,
+            scale,
             c: 1. / (9. * d).sqrt(),
-            d: d,
+            d,
         }
     }
 }
index 67b9449981e0f02a4d24fa5adfb3928ec612665c..47967a719d397a8972d39bf4e90ac356721af550 100644 (file)
@@ -149,7 +149,7 @@ pub fn new(items: &'a mut [Weighted<T>]) -> WeightedChoice<'a, T> {
                 "WeightedChoice::new called with a total weight of 0");
 
         WeightedChoice {
-            items: items,
+            items,
             // we're likely to be generating numbers in this range
             // relatively often, so might as well cache it
             weight_range: Range::new(0, running_total),
index 33de11ab63087c766e7534706bf53c92ae6f2610..e1518dab21c2b9bb3215f6fa805547d39d44d40f 100644 (file)
@@ -103,8 +103,8 @@ impl Normal {
     pub fn new(mean: f64, std_dev: f64) -> Normal {
         assert!(std_dev >= 0.0, "Normal::new called with `std_dev` < 0");
         Normal {
-            mean: mean,
-            std_dev: std_dev,
+            mean,
+            std_dev,
         }
     }
 }
index be238b0b1abdfd22397d4784d85178ae62bff585..f2f8132e5b47ba18fa6910bb06abc7bf972728cc 100644 (file)
@@ -104,7 +104,7 @@ fn construct_range(low: $ty, high: $ty) -> Range<$ty> {
                 let zone = unsigned_max - unsigned_max % range;
 
                 Range {
-                    low: low,
+                    low,
                     range: range as $ty,
                     accept_zone: zone as $ty
                 }
@@ -143,7 +143,7 @@ macro_rules! float_impl {
         impl SampleRange for $ty {
             fn construct_range(low: $ty, high: $ty) -> Range<$ty> {
                 Range {
-                    low: low,
+                    low,
                     range: high - low,
                     accept_zone: 0.0 // unused
                 }
index 5e56b0d8ab16cf0f9d02b79234a2cc74dff47923..a1b6ddcb331a82de0dc8f9b6d16a8a439b1172ff 100644 (file)
@@ -418,10 +418,10 @@ fn rand<R: Rng>(rng: &mut R) -> XorShiftRng {
         }
         let (x, y, z, w) = tuple;
         XorShiftRng {
-            x: x,
-            y: y,
-            z: z,
-            w: w,
+            x,
+            y,
+            z,
+            w,
         }
     }
 }
index 21684e38f7b6ebebc6556b195568f74275b07876..804fe9dc63c5314924c3cdb9b0db88df12304dfa 100644 (file)
@@ -38,10 +38,10 @@ impl<R: Rng, Rsdr: Reseeder<R>> ReseedingRng<R, Rsdr> {
     /// * `reseeder`: the reseeding object to use.
     pub fn new(rng: R, generation_threshold: usize, reseeder: Rsdr) -> ReseedingRng<R, Rsdr> {
         ReseedingRng {
-            rng: rng,
-            generation_threshold: generation_threshold,
+            rng,
+            generation_threshold,
             bytes_generated: 0,
-            reseeder: reseeder,
+            reseeder,
         }
     }
 
index 8a2b115e58d3d083b1abf9532f13120a803e20c2..b8624722692e9addab9d8d70763f57f171764ece 100644 (file)
@@ -630,8 +630,8 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
     let krate = tcx.hir.krate();
     let live_symbols = find_live(tcx, access_levels, krate);
     let mut visitor = DeadVisitor {
-        tcx: tcx,
-        live_symbols: live_symbols,
+        tcx,
+        live_symbols,
     };
     intravisit::walk_crate(&mut visitor, krate);
 }
index f71ad67bd1d7b0faaf42f6096f54a6f92a3f3be5..b8f27f8741dc5e937cbc4e594dc10ed4f1e181a4 100644 (file)
@@ -1695,8 +1695,8 @@ pub fn mk_projection(self,
                          substs: &'tcx Substs<'tcx>)
         -> Ty<'tcx> {
             self.mk_ty(TyProjection(ProjectionTy {
-                item_def_id: item_def_id,
-                substs: substs,
+                item_def_id,
+                substs,
             }))
         }
 
index 0d9ef8196c79451aee01ff55727221a8b043a57e..c035817d66db0336381e2177ec286f7bc8af319f 100644 (file)
@@ -253,7 +253,7 @@ fn relate<'a, 'gcx, R>(relation: &mut R,
             let substs = relation.relate(&a.substs, &b.substs)?;
             Ok(ty::ExistentialProjection {
                 item_def_id: a.item_def_id,
-                substs: substs,
+                substs,
                 ty,
             })
         }
index 48ace804995ab238697101669dcbf644791c9eaf..e41eb079b3782dd9356af8ff4d87b02ac558aee8 100644 (file)
@@ -137,7 +137,7 @@ fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>)
         tcx.lift(&self.substs).map(|substs| {
             ty::ProjectionTy {
                 item_def_id: self.item_def_id,
-                substs: substs,
+                substs,
             }
         })
     }
index b42180b288bf6cb7cc43484d7293cba7ca1e529f..389c581ebe314b5ac363a3affc5753c0454955c4 100644 (file)
@@ -569,7 +569,7 @@ pub fn from_ref_and_name(
     pub fn trait_ref(&self, tcx: TyCtxt) -> ty::TraitRef<'tcx> {
         let def_id = tcx.associated_item(self.item_def_id).container.id();
         ty::TraitRef {
-            def_id: def_id,
+            def_id,
             substs: self.substs,
         }
     }
@@ -874,7 +874,7 @@ impl<'a, 'tcx, 'gcx> ExistentialProjection<'tcx> {
     pub fn trait_ref(&self, tcx: TyCtxt) -> ty::ExistentialTraitRef<'tcx> {
         let def_id = tcx.associated_item(self.item_def_id).container.id();
         ty::ExistentialTraitRef{
-            def_id: def_id,
+            def_id,
             substs: self.substs,
         }
     }
index 78b07a33389e2bca110edd7143e412e503537a4b..f99c6a29ff00a9cd71033aa40781b7a68c2027b4 100644 (file)
@@ -36,9 +36,9 @@ pub fn modify(sess: &ParseSess,
               krate: Crate,
               handler: &rustc_errors::Handler) -> ast::Crate {
     ExpandAllocatorDirectives {
-        handler: handler,
-        sess: sess,
-        resolver: resolver,
+        handler,
+        sess,
+        resolver,
         found: false,
     }.fold_crate(krate)
 }
@@ -88,7 +88,7 @@ fn fold_item(&mut self, item: P<Item>) -> SmallVector<P<Item>> {
         };
         let ecfg = ExpansionConfig::default(name.to_string());
         let mut f = AllocFnFactory {
-            span: span,
+            span,
             kind: AllocatorKind::Global,
             global: item.ident,
             alloc: Ident::from_str("alloc"),
index 2e7d30d969ec4b140c773d744f0e41ca0d9a161f..4b02d0b60b8b59a43fc9baff50df77d7fc962b4c 100644 (file)
@@ -97,7 +97,7 @@ pub fn opts(arch: Arch) -> Result<TargetOptions, String> {
         cpu: target_cpu(arch),
         dynamic_linking: false,
         executables: true,
-        pre_link_args: pre_link_args,
+        pre_link_args,
         has_elf_tls: false,
         .. super::apple_base::opts()
     })
index 998183d401500d3cb093a079de726c9afea51358..d95f6fa97cf422ce26e0bcb502f8c0065fb07074 100644 (file)
@@ -25,7 +25,7 @@ pub fn opts() -> TargetOptions {
         exe_allocation_crate: Some("alloc_system".to_string()),
         panic_strategy: PanicStrategy::Abort,
         linker: "ld".to_string(),
-        pre_link_args: pre_link_args,
+        pre_link_args,
         target_family: Some("unix".to_string()),
         .. Default::default()
     }
index f4265e0eb1462d2bd7bc5abf466088aa369ad869..51eeae50e22ee17ece637332c51d82d5115f3342 100644 (file)
@@ -25,8 +25,8 @@ pub fn target() -> TargetResult {
         linker: "pnacl-clang".to_string(),
         ar: "pnacl-ar".to_string(),
 
-        pre_link_args: pre_link_args,
-        post_link_args: post_link_args,
+        pre_link_args,
+        post_link_args,
         dynamic_linking: false,
         executables: true,
         exe_suffix: ".pexe".to_string(),
index db47040bf3a90a62546f312ba90b7d3a26512b83..42ab19404049eee0cee5aa14aa19fe97f568ea40 100644 (file)
@@ -38,7 +38,7 @@ pub fn target() -> Result<Target, String> {
         obj_is_bitcode: true,
         is_like_emscripten: true,
         max_atomic_width: Some(32),
-        post_link_args: post_link_args,
+        post_link_args,
         target_family: Some("unix".to_string()),
         .. Default::default()
     };
index f5fb63038e9172926db0c7e34da47a489e0bc14e..a0a2699d8f951c0fe1e4e99e1344d7796d517e6d 100644 (file)
@@ -34,7 +34,7 @@ pub fn target() -> Result<Target, String> {
         obj_is_bitcode: true,
         is_like_emscripten: true,
         max_atomic_width: Some(32),
-        post_link_args: post_link_args,
+        post_link_args,
         target_family: Some("unix".to_string()),
         .. Default::default()
     };
index 9bde24a28dd9b253ed14c0a1a5f8e3fe4d244921..e6aa745d54e9d8c8d625a164437c67e84730c792 100644 (file)
@@ -78,7 +78,7 @@ pub fn opts() -> TargetOptions {
         target_family: Some("windows".to_string()),
         is_like_windows: true,
         allows_weak_linkage: false,
-        pre_link_args: pre_link_args,
+        pre_link_args,
         pre_link_objects_exe: vec![
             "crt2.o".to_string(),    // mingw C runtime initialization for executables
             "rsbegin.o".to_string(), // Rust compiler runtime initialization, see rsbegin.rs
@@ -87,7 +87,7 @@ pub fn opts() -> TargetOptions {
             "dllcrt2.o".to_string(), // mingw C runtime initialization for dlls
             "rsbegin.o".to_string(),
         ],
-        late_link_args: late_link_args,
+        late_link_args,
         post_link_objects: vec![
             "rsend.o".to_string()
         ],
index c34bf4c3d284dc5bdcc76853572683e584de4bd2..c82377173252f6630c5d23fd2822450fbbb4e1f8 100644 (file)
@@ -194,10 +194,10 @@ pub fn check_loans<'a, 'b, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
     let def_id = bccx.tcx.hir.body_owner_def_id(body.id());
     let param_env = bccx.tcx.param_env(def_id);
     let mut clcx = CheckLoanCtxt {
-        bccx: bccx,
-        dfcx_loans: dfcx_loans,
-        move_data: move_data,
-        all_loans: all_loans,
+        bccx,
+        dfcx_loans,
+        move_data,
+        all_loans,
         param_env,
     };
     euv::ExprUseVisitor::new(&mut clcx, bccx.tcx, param_env, &bccx.region_maps, bccx.tables)
index 3d98c2a23dc674317b619c96c502830c16a9b624..bca980c5ccf4c974b2823e5016a5349766b5b2aa 100644 (file)
@@ -106,8 +106,8 @@ pub fn gather_move_from_expr<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
     };
     let move_info = GatherMoveInfo {
         id: move_expr_id,
-        kind: kind,
-        cmt: cmt,
+        kind,
+        cmt,
         span_path_opt: None,
     };
     gather_move(bccx, move_data, move_error_collector, move_info);
@@ -163,7 +163,7 @@ pub fn gather_move_from_pat<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
     let move_info = GatherMoveInfo {
         id: move_pat.id,
         kind: MovePat,
-        cmt: cmt,
+        cmt,
         span_path_opt: pat_span_path_opt,
     };
 
index 89c60da396913cf36986f0be7be303cdbd13703f..22de3c759139d8bf3aac6e9c32cb553e445574f9 100644 (file)
@@ -37,10 +37,10 @@ pub fn guarantee_lifetime<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
     debug!("guarantee_lifetime(cmt={:?}, loan_region={:?})",
            cmt, loan_region);
     let ctxt = GuaranteeLifetimeContext {bccx: bccx,
-                                         item_scope: item_scope,
-                                         span: span,
-                                         cause: cause,
-                                         loan_region: loan_region,
+                                         item_scope,
+                                         span,
+                                         cause,
+                                         loan_region,
                                          cmt_original: cmt.clone()};
     ctxt.check(&cmt, None)
 }
index 35af83c8ae23a2e46bae33a8e090692aca7a5344..4ff603b7eae01441e9f26a0e646b92a72c6aa12a 100644 (file)
@@ -41,7 +41,7 @@ pub fn gather_loans_in_fn<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
     let def_id = bccx.tcx.hir.body_owner_def_id(body);
     let param_env = bccx.tcx.param_env(def_id);
     let mut glcx = GatherLoanCtxt {
-        bccx: bccx,
+        bccx,
         all_loans: Vec::new(),
         item_ub: region::CodeExtent::Misc(body.node_id),
         move_data: MoveData::new(),
@@ -230,8 +230,8 @@ fn check_mutability<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
             // Only mutable data can be lent as mutable.
             if !cmt.mutbl.is_mutable() {
                 Err(bccx.report(BckError { span: borrow_span,
-                                           cause: cause,
-                                           cmt: cmt,
+                                           cause,
+                                           cmt,
                                            code: err_mutbl }))
             } else {
                 Ok(())
@@ -389,13 +389,13 @@ fn guarantee_valid(&mut self,
 
                 Loan {
                     index: self.all_loans.len(),
-                    loan_path: loan_path,
+                    loan_path,
                     kind: req_kind,
-                    gen_scope: gen_scope,
-                    kill_scope: kill_scope,
+                    gen_scope,
+                    kill_scope,
                     span: borrow_span,
-                    restricted_paths: restricted_paths,
-                    cause: cause,
+                    restricted_paths,
+                    cause,
                 }
             }
         };
@@ -423,13 +423,13 @@ fn guarantee_valid(&mut self,
             //    let all_loans = &mut *self.all_loans; // FIXME(#5074)
             //    Loan {
             //        index: all_loans.len(),
-            //        loan_path: loan_path,
-            //        cmt: cmt,
+            //        loan_path,
+            //        cmt,
             //        mutbl: ConstMutability,
             //        gen_scope: borrow_id,
-            //        kill_scope: kill_scope,
+            //        kill_scope,
             //        span: borrow_span,
-            //        restrictions: restrictions
+            //        restrictions,
             //    }
         // }
     }
index bfd883be84876252e9671819c0980948d79dc78a..31a0312ef96995b87c21f38df048fc0112d6107f 100644 (file)
@@ -49,8 +49,8 @@ pub fn with_move_info(move_from: mc::cmt<'tcx>,
                           move_to: Option<MovePlace<'tcx>>)
                           -> MoveError<'tcx> {
         MoveError {
-            move_from: move_from,
-            move_to: move_to,
+            move_from,
+            move_to,
         }
     }
 }
index b7965f81b8826e3e0a8b28d2cafb2d04699179fc..bc01f22d3881ec6690c63732a5fc26365c63e8c2 100644 (file)
@@ -34,10 +34,10 @@ pub fn compute_restrictions<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
                                       loan_region: ty::Region<'tcx>)
                                       -> RestrictionResult<'tcx> {
     let ctxt = RestrictionsContext {
-        bccx: bccx,
-        span: span,
-        cause: cause,
-        loan_region: loan_region,
+        bccx,
+        span,
+        cause,
+        loan_region,
     };
 
     ctxt.restrict(cmt)
index 412af05f5bdfa4cffe3517b04ad8203fb47d6e39..9514b9b39fd3b244df6fec0c3869ef4c18ae1d1c 100644 (file)
@@ -180,7 +180,7 @@ fn build_borrowck_dataflow_data<'a, 'c, 'tcx, F>(this: &mut BorrowckCtxt<'a, 'tc
                                                       id_range,
                                                       body);
 
-    Some(AnalysisData { all_loans: all_loans,
+    Some(AnalysisData { all_loans,
                         loans: loan_dfcx,
                         move_data:flowed_moves })
 }
index fd80e8320d6a10853b3395d5758df7151524bbf0..5a08d63829159a68129bff598875f57f689e86f9 100644 (file)
@@ -310,7 +310,7 @@ pub fn move_path(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>,
                     parent: parent_index,
                     first_move: InvalidMoveIndex,
                     first_child: InvalidMovePathIndex,
-                    next_sibling: next_sibling,
+                    next_sibling,
                 });
 
                 index
@@ -408,9 +408,9 @@ fn add_move_helper(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
         self.moves.borrow_mut().push(Move {
             path: path_index,
-            id: id,
-            kind: kind,
-            next_move: next_move
+            id,
+            kind,
+            next_move,
         });
     }
 
@@ -468,8 +468,8 @@ fn add_assignment_helper(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>,
         let assignment = Assignment {
             path: path_index,
             id: assign_id,
-            span: span,
-            assignee_id: assignee_id,
+            span,
+            assignee_id,
         };
 
         if self.is_var_path(path_index) {
@@ -504,7 +504,7 @@ pub fn add_variant_match(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>,
             path: path_index,
             base_path: base_path_index,
             id: pattern_id,
-            mode: mode,
+            mode,
         };
 
         self.variant_matches.borrow_mut().push(variant_match);
@@ -680,9 +680,9 @@ pub fn new(move_data: MoveData<'tcx>,
         dfcx_assign.propagate(cfg, body);
 
         FlowedMoveData {
-            move_data: move_data,
-            dfcx_moves: dfcx_moves,
-            dfcx_assign: dfcx_assign,
+            move_data,
+            dfcx_moves,
+            dfcx_assign,
         }
     }
 
index bae44c0047e2e3f80c798a2d4b254073c780958b..bc9aa9665c103520c7d378073522d4de37aa4abf 100644 (file)
@@ -166,8 +166,8 @@ pub fn create_and_enter<F, R>(
         let pattern_arena = TypedArena::new();
 
         f(MatchCheckCtxt {
-            tcx: tcx,
-            module: module,
+            tcx,
+            module,
             pattern_arena: &pattern_arena,
             byte_array_map: FxHashMap(),
         })
@@ -296,7 +296,7 @@ fn push_wild_constructor<'a>(
         let sub_pattern_tys = constructor_sub_pattern_tys(cx, ctor, ty);
         self.0.extend(sub_pattern_tys.into_iter().map(|ty| {
             Pattern {
-                ty: ty,
+                ty,
                 span: DUMMY_SP,
                 kind: box PatternKind::Wild,
             }
@@ -344,7 +344,7 @@ fn apply_constructor<'a>(
                         if adt.variants.len() > 1 {
                             PatternKind::Variant {
                                 adt_def: adt,
-                                substs: substs,
+                                substs,
                                 variant_index: ctor.variant_index_for_adt(adt),
                                 subpatterns: pats
                             }
@@ -378,7 +378,7 @@ fn apply_constructor<'a>(
         };
 
         self.0.push(Pattern {
-            ty: ty,
+            ty,
             span: DUMMY_SP,
             kind: Box::new(pat),
         });
@@ -673,7 +673,7 @@ fn is_useful_specialized<'p, 'a:'p, 'tcx: 'a>(
     let sub_pat_tys = constructor_sub_pattern_tys(cx, &ctor, lty);
     let wild_patterns_owned: Vec<_> = sub_pat_tys.iter().map(|ty| {
         Pattern {
-            ty: ty,
+            ty,
             span: DUMMY_SP,
             kind: box PatternKind::Wild,
         }
index ea7deef472425632798f9e6848752942e5d97050..2bed1950afc28000f1fae466f5a7ce7ab452b278 100644 (file)
@@ -524,7 +524,7 @@ fn check_legality_of_move_bindings(cx: &MatchVisitor,
 /// FIXME: this should be done by borrowck.
 fn check_for_mutation_in_guard(cx: &MatchVisitor, guard: &hir::Expr) {
     let mut checker = MutationChecker {
-        cx: cx,
+        cx,
     };
     ExprUseVisitor::new(&mut checker, cx.tcx, cx.param_env, cx.region_maps, cx.tables)
         .walk_expr(guard);
index 20ca218571c790fd98eda7e2bf81670b94e3e2d7..c7def0b834cfd4f32674c0b2c49c576f2ce93272 100644 (file)
@@ -379,7 +379,7 @@ fn eval_const_expr_partial<'a, 'tcx>(cx: &ConstContext<'a, 'tcx>,
             tcx,
             param_env: cx.param_env,
             tables: tcx.typeck_tables_of(def_id),
-            substs: substs,
+            substs,
             fn_args: Some(call_args)
           };
           callee_cx.eval(&body.value)?
index d151e817040a9a2733b628eca38798f2ec653fa6..ba79f775ef73d50c0576db3bf179ab7d885152d1 100644 (file)
@@ -407,8 +407,8 @@ pub fn lower_pattern(&mut self, pat: &hir::Pat) -> Pattern<'tcx> {
                 }
 
                 PatternKind::Binding {
-                    mutability: mutability,
-                    mode: mode,
+                    mutability,
+                    mode,
                     name: ident.node,
                     var: id,
                     ty: var_ty,
@@ -470,7 +470,7 @@ pub fn lower_pattern(&mut self, pat: &hir::Pat) -> Pattern<'tcx> {
 
         Pattern {
             span: pat.span,
-            ty: ty,
+            ty,
             kind: Box::new(kind),
         }
     }
@@ -569,10 +569,10 @@ fn lower_variant_or_leaf(
                         _ => bug!("inappropriate type for def: {:?}", ty.sty),
                     };
                     PatternKind::Variant {
-                        adt_def: adt_def,
-                        substs: substs,
+                        adt_def,
+                        substs,
                         variant_index: adt_def.variant_index_with_id(variant_id),
-                        subpatterns: subpatterns,
+                        subpatterns,
                     }
                 } else {
                     PatternKind::Leaf { subpatterns: subpatterns }
@@ -626,8 +626,8 @@ fn lower_path(&mut self,
         };
 
         Pattern {
-            span: span,
-            ty: ty,
+            span,
+            ty,
             kind: Box::new(kind),
         }
     }
@@ -762,7 +762,7 @@ fn lower_const_expr(&mut self,
         };
 
         Pattern {
-            span: span,
+            span,
             ty: pat_ty,
             kind: Box::new(kind),
         }
index df660d08603adfa1cc2fb31a82d63299d1540902..1e67461e0556dd7af0c22212832cb8296b01eba4 100644 (file)
@@ -281,8 +281,8 @@ fn into_iter(self) -> Self::IntoIter {
         let indices = 0..self.count;
         mem::forget(self);
         Iter {
-            indices: indices,
-            store: store,
+            indices,
+            store,
         }
     }
 }
index 7fc59be780f6e565983e870d3cee6a09c186d21e..7331016c2d26c17f83b3f09f662c748395f68f10 100644 (file)
@@ -151,7 +151,7 @@ pub fn new(rows: usize, columns: usize) -> BitMatrix {
         // element. Round up to an even number of u64s.
         let u64s_per_row = u64s(columns);
         BitMatrix {
-            columns: columns,
+            columns,
             vector: vec![0; rows * u64s_per_row],
         }
     }
index ab675db21503e2893e3144cb736c1055acc08cb1..65dd336fdbd2fa31045f65cf13c3fcd3179ab885 100644 (file)
@@ -71,8 +71,8 @@ pub fn dominators_given_rpo<G: ControlFlowGraph>(graph: &G,
     }
 
     Dominators {
-        post_order_rank: post_order_rank,
-        immediate_dominators: immediate_dominators,
+        post_order_rank,
+        immediate_dominators,
     }
 }
 
@@ -181,7 +181,7 @@ pub fn dominator_tree(&self) -> DominatorTree<Node> {
         }
         DominatorTree {
             root: root.unwrap(),
-            children: children,
+            children,
         }
     }
 }
index d48a6e684ad8e8f8258c4a43cd91d68c3fc4ce95..f04b536bc185ffab4d3d9fd607f9524e7072b197 100644 (file)
@@ -26,7 +26,7 @@ impl TestGraph {
     pub fn new(start_node: usize, edges: &[(usize, usize)]) -> Self {
         let mut graph = TestGraph {
             num_nodes: start_node + 1,
-            start_node: start_node,
+            start_node,
             successors: HashMap::new(),
             predecessors: HashMap::new(),
         };
index a1a117edb94fce9cd41e00d413b69c611275d1e2..163d65c089c33c1ff698b736c44969b06d71302f 100644 (file)
@@ -23,8 +23,8 @@ pub fn new(base_graph: G) -> Self {
 
     pub fn with_start(base_graph: G, start_node: G::Node) -> Self {
         TransposedGraph {
-            base_graph: base_graph,
-            start_node: start_node,
+            base_graph,
+            start_node,
         }
     }
 }
index f562ae0e3b84d2641f9e99a1781b806fcd294dc0..eb8342530ab54d2ae13f8f2f944f6ec37eef7deb 100644 (file)
@@ -153,7 +153,7 @@ pub fn add_node(&mut self, data: N) -> NodeIndex {
         let idx = self.next_node_index();
         self.nodes.push(Node {
             first_edge: [INVALID_EDGE_INDEX, INVALID_EDGE_INDEX],
-            data: data,
+            data,
         });
         idx
     }
@@ -189,9 +189,9 @@ pub fn add_edge(&mut self, source: NodeIndex, target: NodeIndex, data: E) -> Edg
         // as the next pointers
         self.edges.push(Edge {
             next_edge: [source_first, target_first],
-            source: source,
-            target: target,
-            data: data,
+            source,
+            target,
+            data,
         });
 
         // adjust the firsts for each node target be the next object.
@@ -269,7 +269,7 @@ pub fn adjacent_edges(&self, source: NodeIndex, direction: Direction) -> Adjacen
         let first_edge = self.node(source).first_edge[direction.repr];
         AdjacentEdges {
             graph: self,
-            direction: direction,
+            direction,
             next: first_edge,
         }
     }
@@ -482,10 +482,10 @@ impl<'g, N: Debug, E: Debug> DepthFirstTraversal<'g, N, E> {
     pub fn new(graph: &'g Graph<N, E>, direction: Direction) -> Self {
         let visited = BitVector::new(graph.len_nodes());
         DepthFirstTraversal {
-            graph: graph,
+            graph,
             stack: vec![],
-            visited: visited,
-            direction: direction,
+            visited,
+            direction,
         }
     }
 
@@ -496,10 +496,10 @@ pub fn with_start_node(graph: &'g Graph<N, E>,
         let mut visited = BitVector::new(graph.len_nodes());
         visited.insert(start_node.node_id());
         DepthFirstTraversal {
-            graph: graph,
+            graph,
             stack: vec![start_node],
-            visited: visited,
-            direction: direction,
+            visited,
+            direction,
         }
     }
 
index 6e70944ce642f09ba23e8e76964cdeada774883d..5a5bc67b59234b87d1f8cfa3c1e9d634edf50a90 100644 (file)
@@ -269,7 +269,7 @@ pub fn to_errors<E: Clone>(&mut self, error: E) -> Vec<Error<O, E>> {
                 let backtrace = self.error_at(index);
                 errors.push(Error {
                     error: error.clone(),
-                    backtrace: backtrace,
+                    backtrace,
                 });
             }
         }
@@ -346,7 +346,7 @@ pub fn process_obligations<P>(&mut self, processor: &mut P) -> Outcome<O, P::Err
                     let backtrace = self.error_at(index);
                     errors.push(Error {
                         error: err,
-                        backtrace: backtrace,
+                        backtrace,
                     });
                 }
             }
@@ -357,8 +357,8 @@ pub fn process_obligations<P>(&mut self, processor: &mut P) -> Outcome<O, P::Err
             // changed.
             return Outcome {
                 completed: vec![],
-                errors: errors,
-                stalled: stalled,
+                errors,
+                stalled,
             };
         }
 
@@ -372,8 +372,8 @@ pub fn process_obligations<P>(&mut self, processor: &mut P) -> Outcome<O, P::Err
 
         Outcome {
             completed: completed_obligations,
-            errors: errors,
-            stalled: stalled,
+            errors,
+            stalled,
         }
     }
 
@@ -638,8 +638,8 @@ fn apply_rewrites(&mut self, node_rewrites: &[usize]) {
 impl<O> Node<O> {
     fn new(parent: Option<NodeIndex>, obligation: O) -> Node<O> {
         Node {
-            obligation: obligation,
-            parent: parent,
+            obligation,
+            parent,
             state: Cell::new(NodeState::Pending),
             dependents: vec![],
         }
index e2d3a4f453749aafb0822d4224f20f8d3b759b33..c9c50e1acb61f16a4c8c59d2267425fd57fc45f8 100644 (file)
@@ -87,8 +87,8 @@ fn new_var(key: K, value: K::Value) -> VarValue<K> {
     fn new(parent: K, value: K::Value, rank: u32) -> VarValue<K> {
         VarValue {
             parent: parent, // this is a root
-            value: value,
-            rank: rank,
+            value,
+            rank,
         }
     }
 
@@ -98,8 +98,8 @@ fn redirect(self, to: K) -> VarValue<K> {
 
     fn root(self, rank: u32, value: K::Value) -> VarValue<K> {
         VarValue {
-            rank: rank,
-            value: value,
+            rank,
+            value,
             ..self
         }
     }
index 1444dcf4271c84563628bbe145e67e0bf6f81590..8a12aa1f7ae6a3835289ebf74f5918498c5638d3 100644 (file)
@@ -401,8 +401,8 @@ fn empty(input: &'a Input,
              out_dir: &'a Option<PathBuf>)
              -> Self {
         CompileState {
-            input: input,
-            session: session,
+            input,
+            session,
             out_dir: out_dir.as_ref().map(|s| &**s),
             out_file: None,
             arena: None,
@@ -868,7 +868,7 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
             trait_map: resolver.trait_map,
             maybe_unused_trait_imports: resolver.maybe_unused_trait_imports,
         },
-        hir_forest: hir_forest,
+        hir_forest,
     })
 }
 
index f8cd2280cafe1e5779ab0c277e3538ecf3f21d3d..a726a792767e20ecf40fab1205640141dec1ae3f 100644 (file)
@@ -802,7 +802,7 @@ fn print_crate_info(sess: &Session,
                     let mut cfgs = Vec::new();
                     for &(name, ref value) in sess.parse_sess.config.iter() {
                         let gated_cfg = GatedCfg::gate(&ast::MetaItem {
-                            name: name,
+                            name,
                             node: ast::MetaItemKind::Word,
                             span: DUMMY_SP,
                         });
index 84d3ab65b1c1f6eab9e44031ba670f51905d9256..8a61a3092508383e143f099b4458f362c8ace5b7 100644 (file)
@@ -174,7 +174,7 @@ fn call_with_pp_support<'tcx, A, F>(&self,
         match *self {
             PpmNormal | PpmEveryBodyLoops | PpmExpanded => {
                 let annotation = NoAnn {
-                    sess: sess,
+                    sess,
                     hir_map: hir_map.map(|m| m.clone()),
                 };
                 f(&annotation)
@@ -182,14 +182,14 @@ fn call_with_pp_support<'tcx, A, F>(&self,
 
             PpmIdentified | PpmExpandedIdentified => {
                 let annotation = IdentifiedAnnotation {
-                    sess: sess,
+                    sess,
                     hir_map: hir_map.map(|m| m.clone()),
                 };
                 f(&annotation)
             }
             PpmExpandedHygiene => {
                 let annotation = HygieneAnnotation {
-                    sess: sess,
+                    sess,
                 };
                 f(&annotation)
             }
@@ -211,7 +211,7 @@ fn call_with_pp_support_hir<'tcx, A, F>(&self,
         match *self {
             PpmNormal => {
                 let annotation = NoAnn {
-                    sess: sess,
+                    sess,
                     hir_map: Some(hir_map.clone()),
                 };
                 f(&annotation, hir_map.forest.krate())
@@ -219,7 +219,7 @@ fn call_with_pp_support_hir<'tcx, A, F>(&self,
 
             PpmIdentified => {
                 let annotation = IdentifiedAnnotation {
-                    sess: sess,
+                    sess,
                     hir_map: Some(hir_map.clone()),
                 };
                 f(&annotation, hir_map.forest.krate())
@@ -235,7 +235,7 @@ fn call_with_pp_support_hir<'tcx, A, F>(&self,
                                                                  |tcx, _, _, _| {
                     let empty_tables = ty::TypeckTables::empty(None);
                     let annotation = TypedAnnotation {
-                        tcx: tcx,
+                        tcx,
                         tables: Cell::new(&empty_tables)
                     };
                     let _ignore = tcx.dep_graph.in_ignore();
@@ -680,7 +680,7 @@ fn expr_to_block(rules: ast::BlockCheckMode, e: Option<P<ast::Expr>>) -> P<ast::
                     })
                     .into_iter()
                     .collect(),
-                rules: rules,
+                rules,
                 id: ast::DUMMY_NODE_ID,
                 span: syntax_pos::DUMMY_SP,
             })
@@ -739,7 +739,7 @@ fn print_flowgraph<'a, 'tcx, W: Write>(variants: Vec<borrowck_dot::Variant>,
         hir_map: &tcx.hir,
         cfg: &cfg,
         name: format!("node_{}", code.id()),
-        labelled_edges: labelled_edges,
+        labelled_edges,
     };
 
     match code {
@@ -758,7 +758,7 @@ fn print_flowgraph<'a, 'tcx, W: Write>(variants: Vec<borrowck_dot::Variant>,
 
             let lcfg = borrowck_dot::DataflowLabeller {
                 inner: lcfg,
-                variants: variants,
+                variants,
                 borrowck_ctxt: &bccx,
                 analysis_data: &analysis_data,
             };
index 91d32dbb84fea53f09916cd02307326de99ee9a9..6c52eabd66d1219826b3c9cc5575e2366f61ae59 100644 (file)
@@ -83,9 +83,9 @@ pub fn new(level: Level, message: &str) -> Self {
 
     pub fn new_with_code(level: Level, code: Option<String>, message: &str) -> Self {
         Diagnostic {
-            level: level,
+            level,
             message: vec![(message.to_owned(), Style::NoStyle)],
-            code: code,
+            code,
             span: MultiSpan::new(),
             children: vec![],
             suggestions: vec![],
@@ -306,10 +306,10 @@ fn sub(&mut self,
            span: MultiSpan,
            render_span: Option<RenderSpan>) {
         let sub = SubDiagnostic {
-            level: level,
+            level,
             message: vec![(message.to_owned(), Style::NoStyle)],
-            span: span,
-            render_span: render_span,
+            span,
+            render_span,
         };
         self.children.push(sub);
     }
@@ -322,10 +322,10 @@ fn sub_with_highlights(&mut self,
                            span: MultiSpan,
                            render_span: Option<RenderSpan>) {
         let sub = SubDiagnostic {
-            level: level,
-            message: message,
-            span: span,
-            render_span: render_span,
+            level,
+            message,
+            span,
+            render_span,
         };
         self.children.push(sub);
     }
index 5d7c5e2829a373c7e0731bf504aa0ac9b3d21043..ee0bd9498982c775d1ffed48651db2dcdbceb368 100644 (file)
@@ -179,7 +179,7 @@ pub fn new_with_code(handler: &'a Handler,
                          message: &str)
                          -> DiagnosticBuilder<'a> {
         DiagnosticBuilder {
-            handler: handler,
+            handler,
             diagnostic: Diagnostic::new_with_code(level, code, message)
         }
     }
index 3cfa635f5b208004b6985fba2f7d01c2589f7589..22b6a888f257ac6858636d03190e9d29c047b399 100644 (file)
@@ -120,7 +120,7 @@ pub fn stderr(color_config: ColorConfig, code_map: Option<Rc<CodeMapper>>) -> Em
         if color_config.use_color() {
             let dst = Destination::from_stderr();
             EmitterWriter {
-                dst: dst,
+                dst,
                 cm: code_map,
             }
         } else {
@@ -156,7 +156,7 @@ fn add_annotation_to_file(file_vec: &mut Vec<FileWithAnnotatedLines>,
                     }
                     // We don't have a line yet, create one
                     slot.lines.push(Line {
-                        line_index: line_index,
+                        line_index,
                         annotations: vec![ann],
                     });
                     slot.lines.sort();
@@ -165,9 +165,9 @@ fn add_annotation_to_file(file_vec: &mut Vec<FileWithAnnotatedLines>,
             }
             // This is the first time we're seeing the file
             file_vec.push(FileWithAnnotatedLines {
-                file: file,
+                file,
                 lines: vec![Line {
-                                line_index: line_index,
+                                line_index,
                                 annotations: vec![ann],
                             }],
                 multiline_depth: 0,
index 159d2c7a2df1ce595c3e2b87179de107ee371eca..3459771459a021e1c63d67c7ae8c082444dc7b06 100644 (file)
@@ -155,8 +155,8 @@ fn push_trailing(buf: &mut String,
         let lo = primary_spans.iter().map(|sp| sp.0.lo).min().unwrap();
         let hi = primary_spans.iter().map(|sp| sp.0.hi).min().unwrap();
         let bounding_span = Span {
-            lo: lo,
-            hi: hi,
+            lo,
+            hi,
             ctxt: NO_EXPANSION,
         };
         let lines = cm.span_to_lines(bounding_span).unwrap();
@@ -292,8 +292,8 @@ pub fn with_emitter(can_emit_warnings: bool,
         Handler {
             err_count: Cell::new(0),
             emitter: RefCell::new(e),
-            can_emit_warnings: can_emit_warnings,
-            treat_err_as_bug: treat_err_as_bug,
+            can_emit_warnings,
+            treat_err_as_bug,
             continue_after_error: Cell::new(true),
             delayed_span_bug: RefCell::new(None),
         }
index 04192c35ef3ab22f82a6b8dcd49936c30ee97191..1d58d17996090b7b11a49f78d123831d0cf8cec2 100644 (file)
@@ -76,7 +76,7 @@ pub fn assert_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
 
     // Find annotations supplied by user (if any).
     let (if_this_changed, then_this_would_need) = {
-        let mut visitor = IfThisChanged { tcx: tcx,
+        let mut visitor = IfThisChanged { tcx,
                                           if_this_changed: vec![],
                                           then_this_would_need: vec![] };
         visitor.process_attrs(ast::CRATE_NODE_ID, &tcx.hir.krate().attrs);
index 3f3dc10365c673403cb1752e3a729527fccdcbe9..126057fd043f82cc787f91986aacb95d50a3f43e 100644 (file)
@@ -83,15 +83,15 @@ pub fn check_dirty_clean_annotations<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     debug!("query-nodes: {:?}", query.nodes());
     let krate = tcx.hir.krate();
     let mut dirty_clean_visitor = DirtyCleanVisitor {
-        tcx: tcx,
+        tcx,
         query: &query,
-        dirty_inputs: dirty_inputs,
+        dirty_inputs,
         checked_attrs: FxHashSet(),
     };
     krate.visit_all_item_likes(&mut dirty_clean_visitor);
 
     let mut all_attrs = FindAllAttrs {
-        tcx: tcx,
+        tcx,
         attr_names: vec![ATTR_DIRTY, ATTR_CLEAN],
         found_attrs: vec![],
     };
@@ -243,15 +243,15 @@ pub fn check_dirty_clean_metadata<'a, 'tcx>(
     tcx.dep_graph.with_ignore(||{
         let krate = tcx.hir.krate();
         let mut dirty_clean_visitor = DirtyCleanMetadataVisitor {
-            tcx: tcx,
-            prev_metadata_hashes: prev_metadata_hashes,
-            current_metadata_hashes: current_metadata_hashes,
+            tcx,
+            prev_metadata_hashes,
+            current_metadata_hashes,
             checked_attrs: FxHashSet(),
         };
         intravisit::walk_crate(&mut dirty_clean_visitor, krate);
 
         let mut all_attrs = FindAllAttrs {
-            tcx: tcx,
+            tcx,
             attr_names: vec![ATTR_DIRTY_METADATA, ATTR_CLEAN_METADATA],
             found_attrs: vec![],
         };
index 0e8ffb9ee3c969635d0224e44fc8dcbe8500bca7..9d762a74bfe670510d2760b61626834d9fa0154c 100644 (file)
@@ -38,8 +38,8 @@ pub fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                incremental_hashes_map: &'a IncrementalHashesMap)
                -> Self {
         HashContext {
-            tcx: tcx,
-            incremental_hashes_map: incremental_hashes_map,
+            tcx,
+            incremental_hashes_map,
             metadata_hashes: FxHashMap(),
             crate_hashes: FxHashMap(),
         }
index 559bdbdd1e2e5d11d1a39ccc72c6cec508dfbaea..aa29afd543c77f8f400ff256d3bf276f07334e53 100644 (file)
@@ -45,7 +45,7 @@ impl<'a, 'g, N, I, O> Classify<'a, 'g, N, I, O>
 {
     pub(super) fn new(r: &'a mut GraphReduce<'g, N, I, O>) -> Self {
         Classify {
-            r: r,
+            r,
             colors: vec![Color::White; r.in_graph.len_nodes()],
             stack: vec![],
             dag: Dag {
index f7b6b7376d1fa09610a8f556fe1edfbab25dd4f8..5483134523c47daa5515ad5c87f465f59d273aea 100644 (file)
@@ -103,8 +103,8 @@ pub fn new(query: &'q DepGraphQuery, hcx: &mut HashContext) -> Self {
 
         Predecessors {
             reduced_graph: graph,
-            bootstrap_outputs: bootstrap_outputs,
-            hashes: hashes,
+            bootstrap_outputs,
+            hashes,
         }
     }
 }
index 8f99ce91a67a985eee1117c8554a4e860ede9f2f..e20d7a006b0ddb0844ec0a88f54eba4624447c36 100644 (file)
@@ -57,7 +57,7 @@ pub fn save_trans_partition(sess: &Session,
     let work_product = WorkProduct {
         cgu_name: cgu_name.to_string(),
         input_hash: partition_hash,
-        saved_files: saved_files,
+        saved_files,
     };
 
     sess.dep_graph.insert_work_product(&work_product_id, work_product);
index 0b24e55541b07269f52f3f41d5e924c834d6cb74..6c3626cd880b2f8cedd1d6c9ed05823a46f25a7c 100644 (file)
@@ -94,7 +94,7 @@ fn next(&mut self) -> Option<Result<Child<'a>, String>> {
             ::last_error().map(Err)
         } else {
             Some(Ok(Child {
-                ptr: ptr,
+                ptr,
                 _data: marker::PhantomData,
             }))
         }
index c5276e0c9710ca22442bc865b10c34d5fe3f7f6a..c5cdf6566921c4c9d10acb7397da9435800ab0eb 100644 (file)
@@ -82,12 +82,12 @@ unsafe fn unpack(kind: OptimizationDiagnosticKind,
         }
 
         OptimizationDiagnostic {
-            kind: kind,
+            kind,
             pass_name: pass_name.expect("got a non-UTF8 pass name from LLVM"),
-            function: function,
-            line: line,
-            column: column,
-            filename: filename,
+            function,
+            line,
+            column,
+            filename,
             message: message.expect("got a non-UTF8 OptimizationDiagnostic message from LLVM")
         }
     }
index 6c02ac7eafec32e0dba689f5cba942281a897bf1..b1b3e92347a213468421455ec178ffe7f74aef8c 100644 (file)
@@ -53,7 +53,7 @@ pub fn encode_body(&mut self, body_id: hir::BodyId) -> Lazy<Ast<'tcx>> {
             body: lazy_body,
             tables: lazy_tables,
             nested_bodies: lazy_nested_bodies,
-            rvalue_promotable_to_static: rvalue_promotable_to_static
+            rvalue_promotable_to_static,
         })
     }
 }
index d15843b4f318bbb5cf38fc9a67c6c211c793c990..4c25d03b441eaba7a9961c9804e4484a7cb0714f 100644 (file)
@@ -162,8 +162,8 @@ enum LoadResult {
 impl<'a> CrateLoader<'a> {
     pub fn new(sess: &'a Session, cstore: &'a CStore, local_crate_name: &str) -> Self {
         CrateLoader {
-            sess: sess,
-            cstore: cstore,
+            sess,
+            cstore,
             next_crate_num: cstore.next_crate_num(),
             local_crate_name: Symbol::intern(local_crate_name),
         }
@@ -184,7 +184,7 @@ fn extract_crate_info(&self, i: &ast::Item) -> Option<ExternCrateInfo> {
                 };
                 Some(ExternCrateInfo {
                     ident: i.ident.name,
-                    name: name,
+                    name,
                     id: i.id,
                     dep_kind: if attr::contains_name(&i.attrs, "no_link") {
                         DepKind::UnexportedMacrosOnly
@@ -325,25 +325,25 @@ fn register_crate(&mut self,
             });
 
         let mut cmeta = cstore::CrateMetadata {
-            name: name,
+            name,
             extern_crate: Cell::new(None),
             def_path_table: Rc::new(def_path_table),
-            exported_symbols: exported_symbols,
-            trait_impls: trait_impls,
+            exported_symbols,
+            trait_impls,
             proc_macros: crate_root.macro_derive_registrar.map(|_| {
                 self.load_derive_macros(&crate_root, dylib.clone().map(|p| p.0), span)
             }),
             root: crate_root,
             blob: metadata,
             cnum_map: RefCell::new(cnum_map),
-            cnum: cnum,
+            cnum,
             codemap_import_info: RefCell::new(vec![]),
             attribute_cache: RefCell::new([Vec::new(), Vec::new()]),
             dep_kind: Cell::new(dep_kind),
             source: cstore::CrateSource {
-                dylib: dylib,
-                rlib: rlib,
-                rmeta: rmeta,
+                dylib,
+                rlib,
+                rmeta,
             },
             // Initialize this with an empty set. The field is populated below
             // after we were able to deserialize its contents.
@@ -388,14 +388,14 @@ fn resolve_crate(&mut self,
             info!("falling back to a load");
             let mut locate_ctxt = locator::Context {
                 sess: self.sess,
-                span: span,
-                ident: ident,
+                span,
+                ident,
                 crate_name: name,
                 hash: hash.map(|a| &*a),
                 filesearch: self.sess.target_filesearch(path_kind),
                 target: &self.sess.target.target,
                 triple: &self.sess.opts.target_triple,
-                root: root,
+                root,
                 rejected_via_hash: vec![],
                 rejected_via_triple: vec![],
                 rejected_via_kind: vec![],
@@ -547,7 +547,7 @@ fn read_extension_crate(&mut self, span: Span, info: &ExternCrateInfo) -> Extens
         let mut target_only = false;
         let mut locate_ctxt = locator::Context {
             sess: self.sess,
-            span: span,
+            span,
             ident: info.ident,
             crate_name: info.name,
             hash: None,
@@ -596,9 +596,9 @@ fn read_extension_crate(&mut self, span: Span, info: &ExternCrateInfo) -> Extens
         };
 
         ExtensionCrate {
-            metadata: metadata,
+            metadata,
             dylib: dylib.map(|p| p.0),
-            target_only: target_only,
+            target_only,
         }
     }
 
@@ -1221,9 +1221,9 @@ fn process_foreign_mod(&mut self, i: &ast::Item, fm: &ast::ForeignMod,
                 .collect();
             let lib = NativeLibrary {
                 name: n,
-                kind: kind,
-                cfg: cfg,
-                foreign_items: foreign_items,
+                kind,
+                cfg,
+                foreign_items,
             };
             register_native_lib(self.sess, self.cstore, Some(m.span), lib);
         }
index fb43f91c46d7f02ff3f43af49bb1a00514aaad73..3419d121088282a542ba2e193255e7fdc7152a14 100644 (file)
@@ -114,7 +114,7 @@ pub fn new(dep_graph: &DepGraph, metadata_loader: Box<MetadataLoader>) -> CStore
             statically_included_foreign_items: RefCell::new(FxHashSet()),
             dllimport_foreign_items: RefCell::new(FxHashSet()),
             visible_parent_map: RefCell::new(FxHashMap()),
-            metadata_loader: metadata_loader,
+            metadata_loader,
         }
     }
 
index d2ab9b2fbced359c497376a5f550c7cce1de0389..cfba11b5151a2ea28fadd6c6baf1d22b7232ae75 100644 (file)
@@ -282,7 +282,7 @@ fn plugin_registrar_fn(&self, cnum: CrateNum) -> Option<DefId>
     {
         self.get_crate_data(cnum).root.plugin_registrar_fn.map(|index| DefId {
             krate: cnum,
-            index: index
+            index,
         })
     }
 
@@ -290,7 +290,7 @@ fn derive_registrar_fn(&self, cnum: CrateNum) -> Option<DefId>
     {
         self.get_crate_data(cnum).root.macro_derive_registrar.map(|index| DefId {
             krate: cnum,
-            index: index
+            index,
         })
     }
 
index ad3a9dd9fefaf4c354000aef492aa2110e290d7a..5c37333fc7e82d5903ecc58af49540bec498060f 100644 (file)
@@ -69,7 +69,7 @@ fn decoder(self, pos: usize) -> DecodeContext<'a, 'tcx> {
             opaque: opaque::Decoder::new(self.raw_bytes(), pos),
             cdata: self.cdata(),
             sess: self.sess().or(tcx.map(|tcx| tcx.sess)),
-            tcx: tcx,
+            tcx,
             last_filemap_index: 0,
             lazy_state: LazyState::NoNode,
         }
@@ -468,7 +468,7 @@ fn entry(&self, item_id: DefIndex) -> Entry<'tcx> {
     fn local_def_id(&self, index: DefIndex) -> DefId {
         DefId {
             krate: self.cnum,
-            index: index,
+            index,
         }
     }
 
@@ -703,7 +703,7 @@ pub fn each_child_of_item<F>(&self, id: DefIndex, mut callback: F, sess: &Sessio
                         for child_index in child.children.decode((self, sess)) {
                             if let Some(def) = self.get_def(child_index) {
                                 callback(def::Export {
-                                    def: def,
+                                    def,
                                     ident: Ident::with_empty_ctxt(self.item_name(child_index)),
                                     span: self.entry(child_index).span.decode((self, sess)),
                                 });
@@ -835,8 +835,8 @@ pub fn get_associated_item(&self, id: DefIndex) -> ty::AssociatedItem {
         };
 
         ty::AssociatedItem {
-            name: name,
-            kind: kind,
+            name,
+            kind,
             vis: item.visibility.decode(self),
             defaultness: container.defaultness(),
             def_id: self.local_def_id(id),
index 8a753a0ae4b573e1a32b53b893dd90dbe262f257..1dc5d695348c17644b8d1569486f2bdd137be264 100644 (file)
@@ -422,16 +422,16 @@ fn encode_crate_root(&mut self) -> Lazy<CrateRoot> {
                 None
             },
 
-            crate_deps: crate_deps,
-            dylib_dependency_formats: dylib_dependency_formats,
-            lang_items: lang_items,
-            lang_items_missing: lang_items_missing,
-            native_libraries: native_libraries,
-            codemap: codemap,
-            def_path_table: def_path_table,
-            impls: impls,
-            exported_symbols: exported_symbols,
-            index: index,
+            crate_deps,
+            dylib_dependency_formats,
+            lang_items,
+            lang_items_missing,
+            native_libraries,
+            codemap,
+            def_path_table,
+            impls,
+            exported_symbols,
+            index,
         });
 
         let total_bytes = self.position();
@@ -719,15 +719,15 @@ fn encode_info_for_trait_item(&mut self, def_id: DefId) -> Entry<'tcx> {
                     };
                     FnData {
                         constness: hir::Constness::NotConst,
-                        arg_names: arg_names,
+                        arg_names,
                         sig: self.lazy(&tcx.fn_sig(def_id)),
                     }
                 } else {
                     bug!()
                 };
                 EntryKind::Method(self.lazy(&MethodData {
-                    fn_data: fn_data,
-                    container: container,
+                    fn_data,
+                    container,
                     has_self: trait_item.method_has_self_argument,
                 }))
             }
@@ -735,7 +735,7 @@ fn encode_info_for_trait_item(&mut self, def_id: DefId) -> Entry<'tcx> {
         };
 
         Entry {
-            kind: kind,
+            kind,
             visibility: self.lazy(&trait_item.vis),
             span: self.lazy(&ast_item.span),
             attributes: self.encode_attributes(&ast_item.attrs),
@@ -805,8 +805,8 @@ fn encode_info_for_impl_item(&mut self, def_id: DefId) -> Entry<'tcx> {
                     bug!()
                 };
                 EntryKind::Method(self.lazy(&MethodData {
-                    fn_data: fn_data,
-                    container: container,
+                    fn_data,
+                    container,
                     has_self: impl_item.method_has_self_argument,
                 }))
             }
@@ -828,7 +828,7 @@ fn encode_info_for_impl_item(&mut self, def_id: DefId) -> Entry<'tcx> {
         };
 
         Entry {
-            kind: kind,
+            kind,
             visibility: self.lazy(&impl_item.vis),
             span: self.lazy(&ast_item.span),
             attributes: self.encode_attributes(&ast_item.attrs),
@@ -915,7 +915,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
             }
             hir::ItemFn(_, _, constness, .., body) => {
                 let data = FnData {
-                    constness: constness,
+                    constness,
                     arg_names: self.encode_fn_arg_names_for_body(body),
                     sig: self.lazy(&tcx.fn_sig(def_id)),
                 };
@@ -946,7 +946,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
                 EntryKind::Struct(self.lazy(&VariantData {
                     ctor_kind: variant.ctor_kind,
                     discr: variant.discr,
-                    struct_ctor: struct_ctor,
+                    struct_ctor,
                     ctor_sig: None,
                 }), repr_options)
             }
@@ -998,10 +998,10 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
                     });
 
                 let data = ImplData {
-                    polarity: polarity,
-                    defaultness: defaultness,
+                    polarity,
+                    defaultness,
                     parent_impl: parent,
-                    coerce_unsized_info: coerce_unsized_info,
+                    coerce_unsized_info,
                     trait_ref: trait_ref.map(|trait_ref| self.lazy(&trait_ref)),
                 };
 
@@ -1023,7 +1023,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
         };
 
         Entry {
-            kind: kind,
+            kind,
             visibility: self.lazy(&ty::Visibility::from_hir(&item.vis, item.id, tcx)),
             span: self.lazy(&item.span),
             attributes: self.encode_attributes(&item.attrs),
@@ -1333,7 +1333,7 @@ fn encode_impls(&mut self, _: ()) -> LazySeq<TraitImpls> {
         debug!("IsolatedEncoder::encode_impls()");
         let tcx = self.tcx;
         let mut visitor = ImplVisitor {
-            tcx: tcx,
+            tcx,
             impls: FxHashMap(),
         };
         tcx.hir.krate().visit_all_item_likes(&mut visitor);
@@ -1412,7 +1412,7 @@ fn encode_info_for_foreign_item(&mut self,
         };
 
         Entry {
-            kind: kind,
+            kind,
             visibility: self.lazy(&ty::Visibility::from_hir(&nitem.vis, nitem.id, tcx)),
             span: self.lazy(&nitem.span),
             attributes: self.encode_attributes(&nitem.attrs),
@@ -1653,14 +1653,14 @@ pub fn encode_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     let (root, metadata_hashes) = {
         let mut ecx = EncodeContext {
             opaque: opaque::Encoder::new(&mut cursor),
-            tcx: tcx,
-            link_meta: link_meta,
-            exported_symbols: exported_symbols,
+            tcx,
+            link_meta,
+            exported_symbols,
             lazy_state: LazyState::NoNode,
             type_shorthands: Default::default(),
             predicate_shorthands: Default::default(),
             metadata_hashes: EncodedMetadataHashes::new(),
-            compute_ich: compute_ich,
+            compute_ich,
         };
 
         // Encode the rustc version string in a predictable location.
index 2db9c6a4ff811f76df11e4c6f23e71cbc8a8245b..1d2b6cc33d46a0942f968d938049b3bfd758b60a 100644 (file)
@@ -92,7 +92,7 @@ impl<'a, 'b, 'tcx> IndexBuilder<'a, 'b, 'tcx> {
     pub fn new(ecx: &'a mut EncodeContext<'b, 'tcx>) -> Self {
         IndexBuilder {
             items: Index::new(ecx.tcx.hir.definitions().def_index_counts_lo_hi()),
-            ecx: ecx,
+            ecx,
         }
     }
 
@@ -137,7 +137,7 @@ pub fn record<'x, DATA>(&'x mut self,
         if let Some(hash) = fingerprint {
             ecx.metadata_hashes.hashes.push(EncodedMetadataHash {
                 def_index: id.index,
-                hash: hash,
+                hash,
             });
         }
 
index c4116489357afde361dba77a63c0861e3a0bc830..b9ad9086c039a6b2835734f66ab35c5288901a92 100644 (file)
@@ -32,8 +32,8 @@ pub fn new(ecx: &'a mut EncodeContext<'b, 'tcx>) -> Self {
         let tcx = ecx.tcx;
         let compute_ich = ecx.compute_ich;
         IsolatedEncoder {
-            tcx: tcx,
-            ecx: ecx,
+            tcx,
+            ecx,
             hcx: if compute_ich {
                 // We are always hashing spans for things in metadata because
                 // don't know if a downstream crate will use them or not.
index 9bcf590eb8bb3bcb73d25d81bccd9d2b0e1811c7..257af2f2850cd531777220e2dc341d13a472805a 100644 (file)
@@ -518,9 +518,9 @@ fn find_library_crate(&mut self) -> Option<Library> {
             if let Some((h, m)) = slot {
                 libraries.insert(h,
                                  Library {
-                                     dylib: dylib,
-                                     rlib: rlib,
-                                     rmeta: rmeta,
+                                     dylib,
+                                     rlib,
+                                     rmeta,
                                      metadata: m,
                                  });
             }
@@ -808,10 +808,10 @@ fn find_commandline_library<'b, LOCS>(&mut self, locs: LOCS) -> Option<Library>
         match slot {
             Some((_, metadata)) => {
                 Some(Library {
-                    dylib: dylib,
-                    rlib: rlib,
-                    rmeta: rmeta,
-                    metadata: metadata,
+                    dylib,
+                    rlib,
+                    rmeta,
+                    metadata,
                 })
             }
             None => None,
index 0b670121ba23b38f2a7318d7286ff9db8943762f..b71f4d0d98cf9aba4d7e3950d17e7cf4c4677704 100644 (file)
@@ -84,7 +84,7 @@ pub struct Lazy<T> {
 impl<T> Lazy<T> {
     pub fn with_position(position: usize) -> Lazy<T> {
         Lazy {
-            position: position,
+            position,
             _marker: PhantomData,
         }
     }
@@ -141,8 +141,8 @@ pub fn empty() -> LazySeq<T> {
 
     pub fn with_position_and_length(position: usize, len: usize) -> LazySeq<T> {
         LazySeq {
-            len: len,
-            position: position,
+            len,
+            position,
             _marker: PhantomData,
         }
     }
@@ -199,7 +199,7 @@ pub struct Tracked<T> {
 impl<T> Tracked<T> {
     pub fn new(state: T) -> Tracked<T> {
         Tracked {
-            state: state,
+            state,
         }
     }
 
index c20f8bde783868baf7ddda11ee62477b6fb28b8a..b390e2888f26c2c177e8ce32224fe9c9e835c7c2 100644 (file)
@@ -49,7 +49,7 @@ pub fn push_end_region(&mut self,
                            source_info: SourceInfo,
                            extent: CodeExtent) {
         self.push(block, Statement {
-            source_info: source_info,
+            source_info,
             kind: StatementKind::EndRegion(extent),
         });
     }
@@ -60,7 +60,7 @@ pub fn push_assign(&mut self,
                        lvalue: &Lvalue<'tcx>,
                        rvalue: Rvalue<'tcx>) {
         self.push(block, Statement {
-            source_info: source_info,
+            source_info,
             kind: StatementKind::Assign(lvalue.clone(), rvalue)
         });
     }
@@ -93,8 +93,8 @@ pub fn terminate(&mut self,
                       block,
                       self.block_data(block));
         self.block_data_mut(block).terminator = Some(Terminator {
-            source_info: source_info,
-            kind: kind,
+            source_info,
+            kind,
         });
     }
 }
index a625f4b04580be5fbc1acbdcaf202795f4e30c31..c74378bdadce52ccb9d63ec371896de007a9f091 100644 (file)
@@ -100,7 +100,7 @@ fn expr_as_rvalue(&mut self,
                 if let Some(scope) = scope {
                     // schedule a shallow free of that memory, lest we unwind:
                     this.cfg.push(block, Statement {
-                        source_info: source_info,
+                        source_info,
                         kind: StatementKind::StorageLive(result.clone())
                     });
                     this.schedule_drop(expr_span, scope, &result, value.ty);
index 9be306d2848b3f4c37f86f47895a9a54ee42e418..4f248ddb0e2cfde09771e0622510dafce7817d26 100644 (file)
@@ -52,7 +52,7 @@ fn expr_as_temp(&mut self,
 
         if !expr_ty.is_never() && temp_lifetime.is_some() {
             this.cfg.push(block, Statement {
-                source_info: source_info,
+                source_info,
                 kind: StatementKind::StorageLive(temp.clone())
             });
         }
index 7ae5d6b0ec19aa483151274f9641115f9ecdc12a..576b1059e59972348cc6fc43b07c706a33cbbb0c 100644 (file)
@@ -240,8 +240,8 @@ pub fn into_expr(&mut self,
                     let cleanup = this.diverge_cleanup();
                     this.cfg.terminate(block, source_info, TerminatorKind::Call {
                         func: fun,
-                        args: args,
-                        cleanup: cleanup,
+                        args,
+                        cleanup,
                         destination: if diverges {
                             None
                         } else {
index 3120ac21908246e1a7cd78b99f0e47f59565dbff..0da722f72a15a2a4770b9a0ccab1309da686f4a0 100644 (file)
@@ -127,11 +127,11 @@ pub fn stmt_expr(&mut self, mut block: BasicBlock, expr: Expr<'tcx>) -> BlockAnd
                     unpack!(block = this.as_local_operand(block, input))
                 }).collect();
                 this.cfg.push(block, Statement {
-                    source_info: source_info,
+                    source_info,
                     kind: StatementKind::InlineAsm {
                         asm: box asm.clone(),
-                        outputs: outputs,
-                        inputs: inputs
+                        outputs,
+                        inputs,
                     },
                 });
                 block.unit()
index c0b54ce2a84decf7947e90f58321115103895471..78805ba87ec22f017db686d50f5af7d54ac0b6e6 100644 (file)
@@ -69,8 +69,8 @@ pub fn match_expr(&mut self,
                         span: pattern.span,
                         match_pairs: vec![MatchPair::new(discriminant_lvalue.clone(), pattern)],
                         bindings: vec![],
-                        guard: guard,
-                        arm_index: arm_index,
+                        guard,
+                        arm_index,
                     }
                 })
                 .collect();
@@ -179,7 +179,7 @@ pub fn declare_bindings(&mut self,
                 var_scope = Some(this.new_visibility_scope(scope_span));
             }
             let source_info = SourceInfo {
-                span: span,
+                span,
                 scope: var_scope.unwrap()
             };
             this.declare_binding(source_info, mutability, name, var, ty);
@@ -193,7 +193,7 @@ pub fn storage_live_binding(&mut self, block: BasicBlock, var: NodeId, span: Spa
         let local_id = self.var_indices[&var];
         let source_info = self.source_info(span);
         self.cfg.push(block, Statement {
-            source_info: source_info,
+            source_info,
             kind: StatementKind::StorageLive(Lvalue::Local(local_id))
         });
         Lvalue::Local(local_id)
@@ -708,10 +708,10 @@ fn declare_binding(&mut self,
                var_id, name, var_ty, source_info);
 
         let var = self.local_decls.push(LocalDecl::<'tcx> {
-            mutability: mutability,
+            mutability,
             ty: var_ty.clone(),
             name: Some(name),
-            source_info: source_info,
+            source_info,
             is_user_variable: true,
         });
         self.var_indices.insert(var_id, var);
index efddee2c933f40baf3bb7d80c1d19f4293232ebc..6e3eef5735233aaf8a0ecf589f28f64f3a10a75a 100644 (file)
@@ -71,8 +71,8 @@ fn simplify_match_pair<'pat>(&mut self,
 
             PatternKind::Binding { name, mutability, mode, var, ty, ref subpattern } => {
                 candidate.bindings.push(Binding {
-                    name: name,
-                    mutability: mutability,
+                    name,
+                    mutability,
                     span: match_pair.pattern.span,
                     source: match_pair.lvalue.clone(),
                     var_id: var,
index 28386fa598ce6c7890ddd6762a44d3e4bb65d369..dc15163ecc12eef7039a3d3ddf7349ca9bb18ad2 100644 (file)
@@ -218,7 +218,7 @@ pub fn perform_test(&mut self,
                     discr: Operand::Consume(discr),
                     switch_ty: discr_ty,
                     values: From::from(values),
-                    targets: targets
+                    targets,
                 });
                 target_blocks
             }
@@ -249,9 +249,9 @@ pub fn perform_test(&mut self,
                     ).collect();
                     (targets.clone(), TerminatorKind::SwitchInt {
                         discr: Operand::Consume(lvalue.clone()),
-                        switch_ty: switch_ty,
+                        switch_ty,
                         values: From::from(values),
-                        targets: targets,
+                        targets,
                     })
                 };
                 self.cfg.terminate(block, source_info, terminator);
@@ -315,7 +315,7 @@ pub fn perform_test(&mut self,
                         }),
                         args: vec![val, expect],
                         destination: Some((eq_result.clone(), eq_block)),
-                        cleanup: cleanup,
+                        cleanup,
                     });
 
                     // check the result
index a013875b3110b9a713a2d8bd0d914184d59482a1..3e303865ac423e40d75e2f6bb80096333569c170 100644 (file)
@@ -44,7 +44,7 @@ pub fn prefix_slice_suffix<'pat>(&mut self,
                   .map(|(idx, subpattern)| {
                       let elem = ProjectionElem::ConstantIndex {
                           offset: idx as u32,
-                          min_length: min_length,
+                          min_length,
                           from_end: false,
                       };
                       let lvalue = lvalue.clone().elem(elem);
@@ -67,7 +67,7 @@ pub fn prefix_slice_suffix<'pat>(&mut self,
                   .map(|(idx, subpattern)| {
                       let elem = ProjectionElem::ConstantIndex {
                           offset: (idx+1) as u32,
-                          min_length: min_length,
+                          min_length,
                           from_end: true,
                       };
                       let lvalue = lvalue.clone().elem(elem);
@@ -80,8 +80,8 @@ pub fn prefix_slice_suffix<'pat>(&mut self,
 impl<'pat, 'tcx> MatchPair<'pat, 'tcx> {
     pub fn new(lvalue: Lvalue<'tcx>, pattern: &'pat Pattern<'tcx>) -> MatchPair<'pat, 'tcx> {
         MatchPair {
-            lvalue: lvalue,
-            pattern: pattern,
+            lvalue,
+            pattern,
             slice_len_checked: false,
         }
     }
index 6c93e073de6b1953bd56b60de2d9069409b9d390..0e4aac4299111670b9fd71fdb4b870035ad0711f 100644 (file)
@@ -41,9 +41,9 @@ pub fn literal_operand(&mut self,
                            literal: Literal<'tcx>)
                            -> Operand<'tcx> {
         let constant = box Constant {
-            span: span,
-            ty: ty,
-            literal: literal,
+            span,
+            ty,
+            literal,
         };
         Operand::Constant(constant)
     }
index 14392ae70e4e34a9f847254c20dbfa7258c140df..0c7a78c980a48b93bbd65816a04615937f6fbdc4 100644 (file)
@@ -121,7 +121,7 @@ pub fn mir_build<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Mir<'t
 
         // Convert the Mir to global types.
         let mut globalizer = GlobalizeMir {
-            tcx: tcx,
+            tcx,
             span: mir.span
         };
         globalizer.visit_mir(&mut mir);
@@ -179,7 +179,7 @@ fn create_constructor_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             // Convert the Mir to global types.
             let tcx = infcx.tcx.global_tcx();
             let mut globalizer = GlobalizeMir {
-                tcx: tcx,
+                tcx,
                 span: mir.span
             };
             globalizer.visit_mir(&mut mir);
@@ -380,7 +380,7 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
             };
             let mut decl = UpvarDecl {
                 debug_name: keywords::Invalid.name(),
-                by_ref: by_ref
+                by_ref,
             };
             if let Some(hir::map::NodeLocal(pat)) = tcx.hir.find(var_node_id) {
                 if let hir::PatKind::Binding(_, _, ref ident, _) = pat.node {
@@ -437,10 +437,10 @@ fn new(hir: Cx<'a, 'gcx, 'tcx>,
            return_ty: Ty<'tcx>)
            -> Builder<'a, 'gcx, 'tcx> {
         let mut builder = Builder {
-            hir: hir,
+            hir,
             cfg: CFG { basic_blocks: IndexVec::new() },
             fn_span: span,
-            arg_count: arg_count,
+            arg_count,
             scopes: vec![],
             visibility_scopes: IndexVec::new(),
             visibility_scope: ARGUMENT_VISIBILITY_SCOPE,
@@ -500,12 +500,12 @@ fn args_and_body(&mut self,
 
             self.local_decls.push(LocalDecl {
                 mutability: Mutability::Not,
-                ty: ty,
+                ty,
                 source_info: SourceInfo {
                     scope: ARGUMENT_VISIBILITY_SCOPE,
                     span: pattern.map_or(self.fn_span, |pat| pat.span)
                 },
-                name: name,
+                name,
                 is_user_variable: false,
             });
         }
index ce64f88d18e1fd4dff69b96ea1b2798fd6e7c4cf..d22969d5a1b2a08c13d3e839e80e0a2a3dbf59d0 100644 (file)
@@ -213,7 +213,7 @@ fn cached_block(&self) -> Option<BasicBlock> {
     /// Given a span and this scope's visibility scope, make a SourceInfo.
     fn source_info(&self, span: Span) -> SourceInfo {
         SourceInfo {
-            span: span,
+            span,
             scope: self.visibility_scope
         }
     }
@@ -235,10 +235,10 @@ pub fn in_breakable_scope<F, R>(&mut self,
     {
         let extent = self.topmost_scope();
         let scope = BreakableScope {
-            extent: extent,
+            extent,
             continue_block: loop_block,
-            break_block: break_block,
-            break_destination: break_destination,
+            break_block,
+            break_destination,
         };
         self.breakable_scopes.push(scope);
         let res = f(self);
@@ -386,7 +386,7 @@ pub fn new_visibility_scope(&mut self, span: Span) -> VisibilityScope {
         let parent = self.visibility_scope;
         let scope = VisibilityScope::new(self.visibility_scopes.len());
         self.visibility_scopes.push(VisibilityScopeData {
-            span: span,
+            span,
             parent_scope: Some(parent),
         });
         scope
@@ -411,7 +411,7 @@ pub fn find_breakable_scope(&mut self,
     /// Given a span and the current visibility scope, make a SourceInfo.
     pub fn source_info(&self, span: Span) -> SourceInfo {
         SourceInfo {
-            span: span,
+            span,
             scope: self.visibility_scope
         }
     }
@@ -619,7 +619,7 @@ pub fn build_drop(&mut self,
         let diverge_target = self.diverge_cleanup();
         self.cfg.terminate(block, source_info,
                            TerminatorKind::Drop {
-                               location: location,
+                               location,
                                target: next_target,
                                unwind: diverge_target,
                            });
@@ -637,8 +637,8 @@ pub fn build_drop_and_replace(&mut self,
         let diverge_target = self.diverge_cleanup();
         self.cfg.terminate(block, source_info,
                            TerminatorKind::DropAndReplace {
-                               location: location,
-                               value: value,
+                               location,
+                               value,
                                target: next_target,
                                unwind: diverge_target,
                            });
@@ -661,11 +661,11 @@ pub fn assert(&mut self, block: BasicBlock,
 
         self.cfg.terminate(block, source_info,
                            TerminatorKind::Assert {
-                               cond: cond,
-                               expected: expected,
-                               msg: msg,
+                               cond,
+                               expected,
+                               msg,
                                target: success_block,
-                               cleanup: cleanup
+                               cleanup,
                            });
 
         success_block
@@ -716,7 +716,7 @@ fn build_scope_drops<'tcx>(cfg: &mut CFG<'tcx>,
         match drop_data.location {
             Lvalue::Local(index) if index.index() > arg_count => {
                 cfg.push(block, Statement {
-                    source_info: source_info,
+                    source_info,
                     kind: StatementKind::StorageDead(drop_data.location.clone())
                 });
             }
@@ -748,7 +748,7 @@ fn build_diverge_scope<'a, 'gcx, 'tcx>(_tcx: TyCtxt<'a, 'gcx, 'tcx>,
 
     let visibility_scope = scope.visibility_scope;
     let source_info = |span| SourceInfo {
-        span: span,
+        span,
         scope: visibility_scope
     };
 
@@ -776,7 +776,7 @@ fn build_diverge_scope<'a, 'gcx, 'tcx>(_tcx: TyCtxt<'a, 'gcx, 'tcx>,
             cfg.terminate(block, source_info(drop_data.span),
                           TerminatorKind::Drop {
                               location: drop_data.location.clone(),
-                              target: target,
+                              target,
                               unwind: None
                           });
             *cached_block = Some(block);
index 890fe3c091ab2f166a62c835b8897d1a6d39c272..a7894f0249972cbba2ad8382429ed051e6cc710a 100644 (file)
@@ -76,9 +76,9 @@ pub(crate) fn do_dataflow<'a, 'tcx, BD, P>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         name_found(tcx.sess, attributes, "borrowck_graphviz_postflow");
 
     let mut mbcx = DataflowBuilder {
-        node_id: node_id,
-        print_preflow_to: print_preflow_to,
-        print_postflow_to: print_postflow_to,
+        node_id,
+        print_preflow_to,
+        print_postflow_to,
         flow_state: DataflowAnalysis::new(tcx, mir, dead_unwinds, bd),
     };
 
index 7c0137b18c02ea2dd3695436037402b453212b2e..ea855ee4d3e5fb075753e2c7b9f76453ec7ffcc1 100644 (file)
@@ -410,12 +410,12 @@ pub fn new(_tcx: TyCtxt<'a, 'tcx, 'tcx>,
         });
 
         DataflowAnalysis {
-            mir: mir,
-            dead_unwinds: dead_unwinds,
+            mir,
+            dead_unwinds,
             flow_state: DataflowState {
                 sets: AllSets {
-                    bits_per_block: bits_per_block,
-                    words_per_block: words_per_block,
+                    bits_per_block,
+                    words_per_block,
                     gen_sets: zeroes.clone(),
                     kill_sets: zeroes,
                     on_entry_sets: on_entry,
index 1255209322b0ee4245384f21138bb5cb9e5d8c47..173396f22457a6e4b95bd5f72e4d3df0e4ac4adb 100644 (file)
@@ -58,9 +58,9 @@ fn lift(&self) -> Self::Abstract {
                 ProjectionElem::Subslice { from: from, to: to },
             ProjectionElem::ConstantIndex {offset,min_length,from_end} =>
                 ProjectionElem::ConstantIndex {
-                    offset: offset,
-                    min_length: min_length,
-                    from_end: from_end
+                    offset,
+                    min_length,
+                    from_end,
                 },
             ProjectionElem::Downcast(a, u) =>
                 ProjectionElem::Downcast(a.clone(), u.clone()),
index 20a61418d85a57731d12d5c947aada26945e2ff3..eff6883f170e7cb05b0a04105c5f3830a25637aa 100644 (file)
@@ -212,9 +212,9 @@ fn new(mir: &'a Mir<'tcx>,
         let mut path_map = IndexVec::new();
 
         MoveDataBuilder {
-            mir: mir,
-            tcx: tcx,
-            param_env: param_env,
+            mir,
+            tcx,
+            param_env,
             data: MoveData {
                 moves: IndexVec::new(),
                 loc_map: LocationMap::new(mir),
@@ -224,8 +224,8 @@ fn new(mir: &'a Mir<'tcx>,
                     }).collect(),
                     projections: FxHashMap(),
                 },
-                move_paths: move_paths,
-                path_map: path_map,
+                move_paths,
+                path_map,
             }
         }
     }
@@ -239,8 +239,8 @@ fn new_move_path(move_paths: &mut IndexVec<MovePathIndex, MovePath<'tcx>>,
         let move_path = move_paths.push(MovePath {
             next_sibling: None,
             first_child: None,
-            parent: parent,
-            lvalue: lvalue
+            parent,
+            lvalue,
         });
 
         if let Some(parent) = parent {
index fa54925c6e75e1d2330eabc6070d9858dd2f6b9d..0324552cd56fd34bef71d04e0d05282f6473d90e 100644 (file)
@@ -29,9 +29,9 @@ fn make_mirror<'a, 'gcx>(self, cx: &mut Cx<'a, 'gcx, 'tcx>) -> Block<'tcx> {
         Block {
             targeted_by_break: self.targeted_by_break,
             extent: CodeExtent::Misc(self.id),
-            opt_destruction_extent: opt_destruction_extent,
+            opt_destruction_extent,
             span: self.span,
-            stmts: stmts,
+            stmts,
             expr: self.expr.to_ref(),
         }
     }
@@ -79,7 +79,7 @@ fn mirror_stmts<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                             kind: StmtKind::Let {
                                 remainder_scope: remainder_extent,
                                 init_scope: CodeExtent::Misc(id),
-                                pattern: pattern,
+                                pattern,
                                 initializer: local.init.to_ref(),
                             },
                             opt_destruction_extent: opt_dxn_ext,
@@ -99,7 +99,7 @@ pub fn to_expr_ref<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
     let temp_lifetime = cx.region_maps.temporary_scope(block.id);
     let expr = Expr {
         ty: block_ty,
-        temp_lifetime: temp_lifetime,
+        temp_lifetime,
         span: block.span,
         kind: ExprKind::Block { body: block },
     };
index 617c3c77bbb116f5693baaa88d10387ea7f345b6..944fb8e83329b3be20d833189b06350261de3c47 100644 (file)
@@ -42,7 +42,7 @@ fn make_mirror<'a, 'gcx>(self, cx: &mut Cx<'a, 'gcx, 'tcx>) -> Expr<'tcx> {
 
         // Next, wrap this up in the expr's scope.
         expr = Expr {
-            temp_lifetime: temp_lifetime,
+            temp_lifetime,
             ty: expr.ty,
             span: self.span,
             kind: ExprKind::Scope {
@@ -54,11 +54,11 @@ fn make_mirror<'a, 'gcx>(self, cx: &mut Cx<'a, 'gcx, 'tcx>) -> Expr<'tcx> {
         // Finally, create a destruction scope, if any.
         if let Some(extent) = cx.region_maps.opt_destruction_extent(self.id) {
             expr = Expr {
-                temp_lifetime: temp_lifetime,
+                temp_lifetime,
                 ty: expr.ty,
                 span: self.span,
                 kind: ExprKind::Scope {
-                    extent: extent,
+                    extent,
                     value: expr.to_ref(),
                 },
             };
@@ -136,7 +136,7 @@ fn apply_adjustment<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                                   }),
                 span,
                 kind: ExprKind::Borrow {
-                    region: region,
+                    region,
                     borrow_kind: to_borrow_kind(m),
                     arg: expr.to_ref(),
                 },
@@ -173,7 +173,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
             ExprKind::Call {
                 ty: expr.ty,
                 fun: expr.to_ref(),
-                args: args,
+                args,
             }
         }
 
@@ -191,7 +191,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                 let arg_tys = args.iter().map(|e| cx.tables().expr_ty_adjusted(e));
                 let tupled_args = Expr {
                     ty: cx.tcx.mk_tup(arg_tys, false),
-                    temp_lifetime: temp_lifetime,
+                    temp_lifetime,
                     span: expr.span,
                     kind: ExprKind::Tuple { fields: args.iter().map(ToRef::to_ref).collect() },
                 };
@@ -228,8 +228,8 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                         })
                         .collect();
                     ExprKind::Adt {
-                        adt_def: adt_def,
-                        substs: substs,
+                        adt_def,
+                        substs,
                         variant_index: index,
                         fields: field_refs,
                         base: None,
@@ -250,7 +250,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                 _ => span_bug!(expr.span, "type of & not region"),
             };
             ExprKind::Borrow {
-                region: region,
+                region,
                 borrow_kind: to_borrow_kind(mutbl),
                 arg: expr.to_ref(),
             }
@@ -320,7 +320,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                     _ => {
                         let op = bin_op(op.node);
                         ExprKind::Binary {
-                            op: op,
+                            op,
                             lhs: lhs.to_ref(),
                             rhs: rhs.to_ref(),
                         }
@@ -384,7 +384,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                             ExprKind::Adt {
                                 adt_def: adt,
                                 variant_index: 0,
-                                substs: substs,
+                                substs,
                                 fields: field_refs,
                                 base: base.as_ref().map(|base| {
                                     FruInfo {
@@ -410,7 +410,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                                     ExprKind::Adt {
                                         adt_def: adt,
                                         variant_index: index,
-                                        substs: substs,
+                                        substs,
                                         fields: field_refs,
                                         base: None,
                                     }
@@ -446,8 +446,8 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
             });
             ExprKind::Closure {
                 closure_id: def_id,
-                substs: substs,
-                upvars: upvars,
+                substs,
+                upvars,
             }
         }
 
@@ -458,7 +458,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
 
         hir::ExprInlineAsm(ref asm, ref outputs, ref inputs) => {
             ExprKind::InlineAsm {
-                asm: asm,
+                asm,
                 outputs: outputs.to_ref(),
                 inputs: inputs.to_ref(),
             }
@@ -477,7 +477,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
 
             ExprKind::Repeat {
                 value: v.to_ref(),
-                count: count,
+                count,
             }
         }
         hir::ExprRet(ref v) => ExprKind::Return { value: v.to_ref() },
@@ -570,10 +570,10 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
     };
 
     Expr {
-        temp_lifetime: temp_lifetime,
+        temp_lifetime,
         ty: expr_ty,
         span: expr.span,
-        kind: kind,
+        kind,
     }
 }
 
@@ -587,7 +587,7 @@ fn method_callee<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
          cx.tables().node_substs(expr.hir_id))
     });
     Expr {
-        temp_lifetime: temp_lifetime,
+        temp_lifetime,
         ty: cx.tcx().mk_fn_def(def_id, substs),
         span: expr.span,
         kind: ExprKind::Literal {
@@ -637,8 +637,8 @@ fn convert_path_expr<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
         Def::Const(def_id) |
         Def::AssociatedConst(def_id) => ExprKind::Literal {
             literal: Literal::Item {
-                def_id: def_id,
-                substs: substs,
+                def_id,
+                substs,
             },
         },
 
@@ -649,9 +649,9 @@ fn convert_path_expr<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                 // We return a completely different ExprKind here to account for this special case.
                 ty::TyAdt(adt_def, substs) => {
                     ExprKind::Adt {
-                        adt_def: adt_def,
+                        adt_def,
                         variant_index: adt_def.variant_index_with_id(def_id),
-                        substs: substs,
+                        substs,
                         fields: vec![],
                         base: None,
                     }
@@ -712,12 +712,12 @@ fn convert_var<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                                                        });
                     Expr {
                         ty: closure_ty,
-                        temp_lifetime: temp_lifetime,
+                        temp_lifetime,
                         span: expr.span,
                         kind: ExprKind::Deref {
                             arg: Expr {
                                 ty: ref_closure_ty,
-                                temp_lifetime: temp_lifetime,
+                                temp_lifetime,
                                 span: expr.span,
                                 kind: ExprKind::SelfRef,
                             }
@@ -733,12 +733,12 @@ fn convert_var<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                                                        });
                     Expr {
                         ty: closure_ty,
-                        temp_lifetime: temp_lifetime,
+                        temp_lifetime,
                         span: expr.span,
                         kind: ExprKind::Deref {
                             arg: Expr {
                                 ty: ref_closure_ty,
-                                temp_lifetime: temp_lifetime,
+                                temp_lifetime,
                                 span: expr.span,
                                 kind: ExprKind::SelfRef,
                             }.to_ref(),
@@ -748,7 +748,7 @@ fn convert_var<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                 ty::ClosureKind::FnOnce => {
                     Expr {
                         ty: closure_ty,
-                        temp_lifetime: temp_lifetime,
+                        temp_lifetime,
                         span: expr.span,
                         kind: ExprKind::SelfRef,
                     }
@@ -772,7 +772,7 @@ fn convert_var<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                 ty::UpvarCapture::ByRef(borrow) => {
                     ExprKind::Deref {
                         arg: Expr {
-                            temp_lifetime: temp_lifetime,
+                            temp_lifetime,
                             ty: cx.tcx.mk_ref(borrow.region,
                                               ty::TypeAndMut {
                                                   ty: var_ty,
@@ -857,7 +857,7 @@ fn overloaded_lvalue<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
     let temp_lifetime = cx.region_maps.temporary_scope(expr.id);
     let fun = method_callee(cx, expr, custom_callee);
     let ref_expr = Expr {
-        temp_lifetime: temp_lifetime,
+        temp_lifetime,
         ty: ref_ty,
         span: expr.span,
         kind: ExprKind::Call {
@@ -887,7 +887,7 @@ fn capture_freevar<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
     let var_ty = cx.tables()
                    .node_id_to_type(cx.tcx.hir.node_to_hir_id(var_node_id));
     let captured_var = Expr {
-        temp_lifetime: temp_lifetime,
+        temp_lifetime,
         ty: var_ty,
         span: closure_expr.span,
         kind: convert_var(cx, closure_expr, freevar.def),
@@ -901,12 +901,12 @@ fn capture_freevar<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
                 ty::BorrowKind::MutBorrow => BorrowKind::Mut,
             };
             Expr {
-                temp_lifetime: temp_lifetime,
+                temp_lifetime,
                 ty: freevar_ty,
                 span: closure_expr.span,
                 kind: ExprKind::Borrow {
                     region: upvar_borrow.region,
-                    borrow_kind: borrow_kind,
+                    borrow_kind,
                     arg: captured_var.to_ref(),
                 },
             }.to_ref()
index 62e762be93a71938a7a3f93ccfdc40d1186a43f7..6b4a8a2dcb7e4a81fc1c3bcaac7f1dca96e4d23d 100644 (file)
@@ -303,7 +303,7 @@ fn build_call_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
                 span
             ));
             statements.push(Statement {
-                source_info: source_info,
+                source_info,
                 kind: StatementKind::Assign(
                     Lvalue::Local(ref_rcvr),
                     Rvalue::Ref(tcx.types.re_erased, BorrowKind::Mut, rcvr_l)
@@ -317,7 +317,7 @@ fn build_call_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
         CallKind::Indirect => (rcvr, vec![]),
         CallKind::Direct(def_id) => (
             Operand::Constant(box Constant {
-                span: span,
+                span,
                 ty: tcx.type_of(def_id),
                 literal: Literal::Value {
                     value: ConstVal::Function(def_id,
@@ -351,7 +351,7 @@ fn build_call_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
     // BB #0
     block(&mut blocks, statements, TerminatorKind::Call {
         func: callee,
-        args: args,
+        args,
         destination: Some((Lvalue::Local(RETURN_POINTER),
                            BasicBlock::new(1))),
         cleanup: if let Adjustment::RefMut = rcvr_adjustment {
@@ -423,7 +423,7 @@ pub fn build_adt_ctor<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a, 'gcx, 'tcx>,
     let local_decls = local_decls_for_sig(&sig, span);
 
     let source_info = SourceInfo {
-        span: span,
+        span,
         scope: ARGUMENT_VISIBILITY_SCOPE
     };
 
@@ -436,7 +436,7 @@ pub fn build_adt_ctor<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a, 'gcx, 'tcx>,
     // return = ADT(arg0, arg1, ...); return
     let start_block = BasicBlockData {
         statements: vec![Statement {
-            source_info: source_info,
+            source_info,
             kind: StatementKind::Assign(
                 Lvalue::Local(RETURN_POINTER),
                 Rvalue::Aggregate(
@@ -448,7 +448,7 @@ pub fn build_adt_ctor<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a, 'gcx, 'tcx>,
             )
         }],
         terminator: Some(Terminator {
-            source_info: source_info,
+            source_info,
             kind: TerminatorKind::Return,
         }),
         is_cleanup: false
index 23a9c4c57ca6a39b107b2fef139c8540e3145457..3f14a6be8b25ed6d2ffb5d4188b0c8a9eee35b2e 100644 (file)
@@ -75,7 +75,7 @@ pub fn add_call_guards(&self, mir: &mut Mir) {
                         statements: vec![],
                         is_cleanup: block.is_cleanup,
                         terminator: Some(Terminator {
-                            source_info: source_info,
+                            source_info,
                             kind: TerminatorKind::Goto { target: *destination }
                         })
                     };
index dec0717e9e38355454b4f12311cd79cfdfd92ece..59b81f7e77c445b460208f42e03553748b9ef580 100644 (file)
@@ -299,8 +299,8 @@ impl<'tcx> ConstantPropagationVisitor<'tcx> {
     fn new(dest_local: Local, constant: Constant<'tcx>)
            -> ConstantPropagationVisitor<'tcx> {
         ConstantPropagationVisitor {
-            dest_local: dest_local,
-            constant: constant,
+            dest_local,
+            constant,
             uses_replaced: 0,
         }
     }
index b158cb43ce7a922c4192bcad6ea79ae43367c733..97391452e596d8514f88faa6736b42e82f53be75 100644 (file)
@@ -50,8 +50,8 @@ fn run_pass<'a, 'tcx>(&self,
         let elaborate_patch = {
             let mir = &*mir;
             let env = MoveDataParamEnv {
-                move_data: move_data,
-                param_env: param_env
+                move_data,
+                param_env,
             };
             let dead_unwinds = find_dead_unwinds(tcx, mir, id, &env);
             let flow_inits =
@@ -64,11 +64,11 @@ fn run_pass<'a, 'tcx>(&self,
                                       |bd, p| &bd.move_data().move_paths[p]);
 
             ElaborateDropsCtxt {
-                tcx: tcx,
-                mir: mir,
+                tcx,
+                mir,
                 env: &env,
-                flow_inits: flow_inits,
-                flow_uninits: flow_uninits,
+                flow_inits,
+                flow_uninits,
                 drop_flags: FxHashMap(),
                 patch: MirPatch::new(mir),
             }.elaborate()
@@ -510,7 +510,7 @@ fn elaborate_replace(
                 debug!("elaborate_drop_and_replace({:?}) - untracked {:?}", terminator, parent);
                 self.patch.patch_terminator(bb, TerminatorKind::Drop {
                     location: location.clone(),
-                    target: target,
+                    target,
                     unwind: Some(unwind)
                 });
             }
@@ -519,7 +519,7 @@ fn elaborate_replace(
 
     fn constant_bool(&self, span: Span, val: bool) -> Rvalue<'tcx> {
         Rvalue::Use(Operand::Constant(Box::new(Constant {
-            span: span,
+            span,
             ty: self.tcx.types.bool,
             literal: Literal::Value { value: ConstVal::Bool(val) }
         })))
index 89de847231c85e09c1986f42f3d778ccc06e792a..fa51cd91be1b673b641b14ae2100374b9ac3417b 100644 (file)
@@ -28,7 +28,7 @@ struct EraseRegionsVisitor<'a, 'tcx: 'a> {
 impl<'a, 'tcx> EraseRegionsVisitor<'a, 'tcx> {
     pub fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Self {
         EraseRegionsVisitor {
-            tcx: tcx,
+            tcx,
             in_validation_statement: false,
         }
     }
index d3fee8045e6e3bd916c9c2831e461cb8e1eb8f63..28aedc8d6749752c12de5a742fd4466c708f123f 100644 (file)
@@ -90,8 +90,8 @@ fn run_pass(&self, caller_mir: &mut Mir<'tcx>) {
                     if let ty::TyFnDef(callee_def_id, substs) = f.ty.sty {
                         callsites.push_back(CallSite {
                             callee: callee_def_id,
-                            substs: substs,
-                            bb: bb,
+                            substs,
+                            bb,
                             location: terminator.source_info
                         });
                     }
@@ -136,8 +136,8 @@ fn run_pass(&self, caller_mir: &mut Mir<'tcx>) {
                             if callsite.callee != callee_def_id {
                                 callsites.push_back(CallSite {
                                     callee: callee_def_id,
-                                    substs: substs,
-                                    bb: bb,
+                                    substs,
+                                    bb,
                                     location: terminator.source_info
                                 });
                             }
@@ -433,12 +433,12 @@ fn dest_needs_borrow(lval: &Lvalue) -> bool {
                 let mut integrator = Integrator {
                     block_idx: bb_len,
                     args: &args,
-                    local_map: local_map,
-                    scope_map: scope_map,
-                    promoted_map: promoted_map,
+                    local_map,
+                    scope_map,
+                    promoted_map,
                     _callsite: callsite,
                     destination: dest,
-                    return_block: return_block,
+                    return_block,
                     cleanup_block: cleanup,
                     in_cleanup_block: false
                 };
@@ -461,7 +461,7 @@ fn dest_needs_borrow(lval: &Lvalue) -> bool {
             kind => {
                 caller_mir[callsite.bb].terminator = Some(Terminator {
                     source_info: terminator.source_info,
-                    kind: kind
+                    kind,
                 });
                 false
             }
index 88a368077d4f5e94248dc4e15bcec93ed2a29cff..6ccc886577ac664a1a90f6cbe9ddc261217c7551 100644 (file)
@@ -76,8 +76,8 @@ struct OptimizationFinder<'b, 'a, 'tcx:'a+'b> {
 impl<'b, 'a, 'tcx:'b> OptimizationFinder<'b, 'a, 'tcx> {
     fn new(mir: &'b Mir<'tcx>, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> OptimizationFinder<'b, 'a, 'tcx> {
         OptimizationFinder {
-            mir: mir,
-            tcx: tcx,
+            mir,
+            tcx,
             optimizations: OptimizationList::default(),
         }
     }
index a247ce2231e769195ec4b13a10b1a60a8086d4f0..e3e4265a7dbc6a603ec0ee643907079f353c7ae1 100644 (file)
@@ -93,7 +93,7 @@ fn nested_visit_map<'b>(&'b mut self) -> NestedVisitorMap<'b, 'tcx> {
         }
     }
     tcx.hir.krate().visit_all_item_likes(&mut GatherCtors {
-        tcx: tcx,
+        tcx,
         set: &mut set,
     }.as_deep_visitor());
 
index fb4764c4962682bef62e135f33050ff536f09465..bd02788df1653c63ed458c53a8b69bf5e92d5370 100644 (file)
@@ -27,7 +27,7 @@ struct NLLVisitor<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
 impl<'a, 'gcx, 'tcx> NLLVisitor<'a, 'gcx, 'tcx> {
     pub fn new(infcx: InferCtxt<'a, 'gcx, 'tcx>) -> Self {
         NLLVisitor {
-            infcx: infcx,
+            infcx,
             lookup_map: HashMap::new(),
         }
     }
index e1c4602b045ebab53404a86b715176f6c4a7c84e..1665cb2f15eb8be52ea99fb403e032b2395451c0 100644 (file)
@@ -107,7 +107,7 @@ fn visit_lvalue(&mut self,
                     LvalueContext::Store |
                     LvalueContext::Call => {
                         *temp = TempState::Defined {
-                            location: location,
+                            location,
                             uses: 0
                         };
                         return;
@@ -140,7 +140,7 @@ pub fn collect_temps(mir: &Mir, rpo: &mut ReversePostorder) -> IndexVec<Local, T
     let mut collector = TempCollector {
         temps: IndexVec::from_elem(TempState::Undefined, &mir.local_decls),
         span: mir.span,
-        mir: mir,
+        mir,
     };
     for (bb, data) in rpo {
         collector.visit_basic_block_data(bb, data);
@@ -165,7 +165,7 @@ fn new_block(&mut self) -> BasicBlock {
             statements: vec![],
             terminator: Some(Terminator {
                 source_info: SourceInfo {
-                    span: span,
+                    span,
                     scope: ARGUMENT_VISIBILITY_SCOPE
                 },
                 kind: TerminatorKind::Return
@@ -179,7 +179,7 @@ fn assign(&mut self, dest: Local, rvalue: Rvalue<'tcx>, span: Span) {
         let data = &mut self.promoted[last];
         data.statements.push(Statement {
             source_info: SourceInfo {
-                span: span,
+                span,
                 scope: ARGUMENT_VISIBILITY_SCOPE
             },
             kind: StatementKind::Assign(Lvalue::Local(dest), rvalue)
@@ -251,7 +251,7 @@ fn promote_temp(&mut self, temp: Local) -> Local {
                 Terminator {
                     source_info: terminator.source_info,
                     kind: mem::replace(&mut terminator.kind, TerminatorKind::Goto {
-                        target: target
+                        target,
                     })
                 }
             };
@@ -268,8 +268,8 @@ fn promote_temp(&mut self, temp: Local) -> Local {
 
                     *self.promoted[last].terminator_mut() = Terminator {
                         kind: TerminatorKind::Call {
-                            func: func,
-                            args: args,
+                            func,
+                            args,
                             cleanup: None,
                             destination: Some((Lvalue::Local(new_temp), new_target))
                         },
@@ -289,7 +289,7 @@ fn promote_temp(&mut self, temp: Local) -> Local {
     fn promote_candidate(mut self, candidate: Candidate) {
         let span = self.promoted.span;
         let new_operand = Operand::Constant(box Constant {
-            span: span,
+            span,
             ty: self.promoted.return_ty,
             literal: Literal::Promoted {
                 index: Promoted::new(self.source.promoted.len())
@@ -387,7 +387,7 @@ pub fn promote_candidates<'a, 'tcx>(mir: &mut Mir<'tcx>,
             promoted: Mir::new(
                 IndexVec::new(),
                 Some(VisibilityScopeData {
-                    span: span,
+                    span,
                     parent_scope: None
                 }).into_iter().collect(),
                 IndexVec::new(),
@@ -423,7 +423,7 @@ pub fn promote_candidates<'a, 'tcx>(mir: &mut Mir<'tcx>,
             TerminatorKind::Drop { location: Lvalue::Local(index), target, .. } => {
                 if promoted(index) {
                     terminator.kind = TerminatorKind::Goto {
-                        target: target
+                        target,
                     };
                 }
             }
index 2ecffdf9fdf7c034a24f37c645fc87ed9e851c29..ee99bb7d9d5207fbe6201c1dafa7058a5edff76e 100644 (file)
@@ -135,13 +135,13 @@ fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         let temps = promote_consts::collect_temps(mir, &mut rpo);
         rpo.reset();
         Qualifier {
-            mode: mode,
+            mode,
             span: mir.span,
-            def_id: def_id,
-            mir: mir,
-            rpo: rpo,
-            tcx: tcx,
-            param_env: param_env,
+            def_id,
+            mir,
+            rpo,
+            tcx,
+            param_env,
             temp_qualif: IndexVec::from_elem(None, &mir.local_decls),
             return_qualif: None,
             qualif: Qualif::empty(),
index a1d56ccd874a11a228d6a3e47c71ad6a94a8166f..070250cda4d5d237358c4c422e3e202ca6fcd885 100644 (file)
@@ -99,8 +99,8 @@ pub fn new(mir: &'a mut Mir<'tcx>) -> Self {
         let basic_blocks = mir.basic_blocks_mut();
 
         CfgSimplifier {
-            basic_blocks: basic_blocks,
-            pred_count: pred_count
+            basic_blocks,
+            pred_count,
         }
     }
 
index f3a82b54063b4710c1fd594c0f0aa093b8784505..4d81c016bd0a06840ae9407e49561b1f0273156c 100644 (file)
@@ -108,8 +108,8 @@ fn visit_mir(&mut self, mir: &Mir<'tcx>) {
 impl<'a, 'b, 'gcx, 'tcx> TypeVerifier<'a, 'b, 'gcx, 'tcx> {
     fn new(cx: &'a mut TypeChecker<'b, 'gcx, 'tcx>, mir: &'a Mir<'tcx>) -> Self {
         TypeVerifier {
-            cx: cx,
-            mir: mir,
+            cx,
+            mir,
             last_span: mir.span,
             errors_reported: false
         }
@@ -235,8 +235,8 @@ fn sanitize_projection(&mut self,
                             }
                         } else {
                             LvalueTy::Downcast {
-                                adt_def: adt_def,
-                                substs: substs,
+                                adt_def,
+                                substs,
                                 variant_index: index
                             }
                         }
@@ -333,7 +333,7 @@ fn new(infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
            param_env: ty::ParamEnv<'gcx>)
            -> Self {
         TypeChecker {
-            infcx: infcx,
+            infcx,
             fulfillment_cx: traits::FulfillmentContext::new(),
             last_span: DUMMY_SP,
             body_id,
index d20d50c561140a3f6cf526c13a554c7737f5e48c..8dc5e31445be69f5f09c4fbdaf367f4bd864a7c3 100644 (file)
@@ -97,8 +97,8 @@ fn visit_lvalue(&mut self,
                     location: Location) {
         if let Some(ref mut info) = self.lvalue_mut_info(lvalue) {
             info.defs_and_uses.push(Use {
-                context: context,
-                location: location,
+                context,
+                location,
             })
         }
         self.super_lvalue(lvalue, context, location)
@@ -140,8 +140,8 @@ fn new(query: Local, callback: F, _: &Mir<'tcx>)
            -> MutateUseVisitor<'tcx, F>
            where F: for<'a> FnMut(&'a mut Lvalue<'tcx>, LvalueContext<'tcx>, Location) {
         MutateUseVisitor {
-            query: query,
-            callback: callback,
+            query,
+            callback,
             phantom: PhantomData,
         }
     }
index da7e218439cf0bfe21bef73e70fe8e81faee7f81..d8a061f4b1991e549d7caba5c7dd04381e7ff5a0 100644 (file)
@@ -521,7 +521,7 @@ fn destructor_call_block<'a>(&mut self, (succ, unwind): (BasicBlock, Unwind))
         let substs = tcx.mk_substs(iter::once(Kind::from(ty)));
 
         let ref_ty = tcx.mk_ref(tcx.types.re_erased, ty::TypeAndMut {
-            ty: ty,
+            ty,
             mutbl: hir::Mutability::MutMutable
         });
         let ref_lvalue = self.new_temp(ref_ty);
@@ -860,7 +860,7 @@ fn unelaborated_free_block<'a>(
     fn drop_block<'a>(&mut self, target: BasicBlock, unwind: Unwind) -> BasicBlock {
         let block = TerminatorKind::Drop {
             location: self.lvalue.clone(),
-            target: target,
+            target,
             unwind: unwind.into_option()
         };
         self.new_block(unwind, block)
index ac121131eb999544419365ae272069e03642dd68..1af0b6c67f259f7cd59b2520095405aa5d8c54c6 100644 (file)
@@ -156,7 +156,7 @@ pub fn apply(self, mir: &mut Mir<'tcx>) {
             );
             mir[loc.block].statements.insert(
                 loc.statement_index, Statement {
-                    source_info: source_info,
+                    source_info,
                     kind: stmt
                 });
             delta += 1;
index 9185f73974cd72118c459390a0ddb7871b6bc0dd..763f885b4d005e4ede9408f9930dc61e53cfac85 100644 (file)
@@ -470,7 +470,7 @@ fn check_adjustments<'a, 'tcx>(v: &mut CheckCrateVisitor<'a, 'tcx>, e: &hir::Exp
 
 pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
     tcx.hir.krate().visit_all_item_likes(&mut CheckCrateVisitor {
-        tcx: tcx,
+        tcx,
         tables: &ty::TypeckTables::empty(None),
         in_fn: false,
         promotable: false,
index 21a4c007fb1926b35144ee74db78919dd8ebf430..1b2a07cd1a7b8d47407e6208fd920ac2d32b8fdc 100644 (file)
@@ -51,7 +51,7 @@ struct CheckLoopVisitor<'a, 'hir: 'a> {
 pub fn check_crate(sess: &Session, map: &Map) {
     let krate = map.krate();
     krate.visit_all_item_likes(&mut CheckLoopVisitor {
-        sess: sess,
+        sess,
         hir_map: map,
         cx: Normal,
     }.as_deep_visitor());
index 0dbb2d1d4d0bf8e6183c295fb1b5cc79f226475e..987243b523473054a966f0efca0d3724389e56c5 100644 (file)
@@ -91,8 +91,8 @@ pub fn check_crate<'hir>(sess: &Session, hir_map: &hir_map::Map<'hir>)
                          -> Result<(), ErrorReported>
 {
     let mut visitor = CheckCrateVisitor {
-        sess: sess,
-        hir_map: hir_map,
+        sess,
+        hir_map,
         discriminant_map: NodeMap(),
         detected_recursive_ids: NodeSet(),
     };
index ed49e8a14c8c7b0097825e234b382d52e8f98967..aba56788928af2c9c332f7c4824bd2c4f8810505 100644 (file)
@@ -91,7 +91,7 @@ pub fn load_plugins(sess: &Session,
 impl<'a> PluginLoader<'a> {
     fn new(sess: &'a Session, cstore: &'a CStore, crate_name: &str) -> Self {
         PluginLoader {
-            sess: sess,
+            sess,
             reader: CrateLoader::new(sess, cstore, crate_name),
             plugins: vec![],
         }
@@ -104,8 +104,8 @@ fn load_plugin(&mut self, span: Span, name: &str, args: Vec<ast::NestedMetaItem>
             let symbol = self.sess.generate_plugin_registrar_symbol(disambiguator, index);
             let fun = self.dylink_registrar(span, lib, symbol);
             self.plugins.push(PluginRegistrar {
-                fun: fun,
-                args: args,
+                fun,
+                args,
             });
         }
     }
index aac21f2af0d963e4144989873a20dbddc0c1ec57..3f74093241d297e4861f62098e33d61823f879f0 100644 (file)
@@ -67,9 +67,9 @@ impl<'a> Registry<'a> {
     #[doc(hidden)]
     pub fn new(sess: &'a Session, krate_span: Span) -> Registry<'a> {
         Registry {
-            sess: sess,
+            sess,
             args_hidden: None,
-            krate_span: krate_span,
+            krate_span,
             syntax_exts: vec![],
             early_lint_passes: vec![],
             late_lint_passes: vec![],
index 983f478e07d620d3dec6f58837d7026e504c540c..959528612c346f750cb81df2c29fc3a38b531471 100644 (file)
@@ -1496,9 +1496,9 @@ fn check(&self, item_id: ast::NodeId, required_visibility: ty::Visibility)
             item_def_id: self.tcx.hir.local_def_id(item_id),
             span: self.tcx.hir.span(item_id),
             min_visibility: ty::Visibility::Public,
-            required_visibility: required_visibility,
+            required_visibility,
             has_pub_restricted: self.has_pub_restricted,
-            has_old_errors: has_old_errors,
+            has_old_errors,
         }
     }
 }
@@ -1660,7 +1660,7 @@ fn privacy_access_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
     // Check privacy of names not checked in previous compilation stages.
     let mut visitor = NamePrivacyVisitor {
-        tcx: tcx,
+        tcx,
         tables: &empty_tables,
         current_item: CRATE_NODE_ID,
         empty_tables: &empty_tables,
@@ -1670,7 +1670,7 @@ fn privacy_access_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     // Check privacy of explicitly written types and traits as well as
     // inferred types of expressions and patterns.
     let mut visitor = TypePrivacyVisitor {
-        tcx: tcx,
+        tcx,
         tables: &empty_tables,
         current_item: DefId::local(CRATE_DEF_INDEX),
         span: krate.span,
@@ -1681,7 +1681,7 @@ fn privacy_access_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     // Build up a set of all exported items in the AST. This is a set of all
     // items which are reachable from external crates based on visibility.
     let mut visitor = EmbargoVisitor {
-        tcx: tcx,
+        tcx,
         access_levels: Default::default(),
         prev_level: Some(AccessLevel::Public),
         changed: false,
@@ -1698,7 +1698,7 @@ fn privacy_access_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
     {
         let mut visitor = ObsoleteVisiblePrivateTypesVisitor {
-            tcx: tcx,
+            tcx,
             access_levels: &visitor.access_levels,
             in_variant: false,
             old_error_set: NodeSet(),
@@ -1708,7 +1708,7 @@ fn privacy_access_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
         let has_pub_restricted = {
             let mut pub_restricted_visitor = PubRestrictedVisitor {
-                tcx: tcx,
+                tcx,
                 has_pub_restricted: false
             };
             intravisit::walk_crate(&mut pub_restricted_visitor, krate);
@@ -1717,8 +1717,8 @@ fn privacy_access_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
         // Check for private types and traits in public interfaces
         let mut visitor = PrivateItemsInPublicInterfacesVisitor {
-            tcx: tcx,
-            has_pub_restricted: has_pub_restricted,
+            tcx,
+            has_pub_restricted,
             old_error_set: &visitor.old_error_set,
             inner_visibility: ty::Visibility::Public,
         };
index a061484b5c4a51032018e2fa7fa5324a9b030c75..47fa5357abf0d64b50e6ef7b131d8c4a7cbd2cc0 100644 (file)
@@ -172,7 +172,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, expansion: Mark) {
 
                         let subclass = SingleImport {
                             target: binding,
-                            source: source,
+                            source,
                             result: self.per_ns(|_, _| Cell::new(Err(Undetermined))),
                             type_ns_only: false,
                         };
@@ -229,7 +229,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, expansion: Mark) {
                                 target: rename,
                                 source: ident.node,
                                 result: self.per_ns(|_, _| Cell::new(Err(Undetermined))),
-                                type_ns_only: type_ns_only,
+                                type_ns_only,
                             };
                             let id = source_item.node.id;
                             self.add_import_directive(
@@ -239,7 +239,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, expansion: Mark) {
                     }
                     ViewPathGlob(_) => {
                         let subclass = GlobImport {
-                            is_prelude: is_prelude,
+                            is_prelude,
                             max_vis: Cell::new(ty::Visibility::Invisible),
                         };
                         self.add_import_directive(
@@ -262,13 +262,13 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, expansion: Mark) {
                     (module, ty::Visibility::Public, sp, expansion).to_name_binding(self.arenas);
                 let directive = self.arenas.alloc_import_directive(ImportDirective {
                     id: item.id,
-                    parent: parent,
+                    parent,
                     imported_module: Cell::new(Some(module)),
                     subclass: ImportDirectiveSubclass::ExternCrate,
                     span: item.span,
                     module_path: Vec::new(),
                     vis: Cell::new(vis),
-                    expansion: expansion,
+                    expansion,
                     used: Cell::new(used),
                 });
                 self.potentially_unused_imports.push(directive);
@@ -618,10 +618,10 @@ fn process_legacy_macro_imports(&mut self, item: &Item, module: Module<'a>, expa
             parent: graph_root,
             imported_module: Cell::new(Some(module)),
             subclass: ImportDirectiveSubclass::MacroUse,
-            span: span,
+            span,
             module_path: Vec::new(),
             vis: Cell::new(ty::Visibility::Restricted(DefId::local(CRATE_DEF_INDEX))),
-            expansion: expansion,
+            expansion,
             used: Cell::new(false),
         });
 
index a8bb6619bbdda4b7ff9993e4bc27107df2da5b57..05c227340d8685d7e89772f112628eb3fadcdc5d 100644 (file)
@@ -135,7 +135,7 @@ pub fn check_crate(resolver: &mut Resolver, krate: &ast::Crate) {
     }
 
     let mut visitor = UnusedImportCheckVisitor {
-        resolver: resolver,
+        resolver,
         unused_imports: NodeMap(),
     };
     visit::walk_crate(&mut visitor, krate);
index da170e7fe22ca77f6e1520c44ed15735fd5a621a..2502f04ee6aef9594a8b00ecbed4fc2ff0365320 100644 (file)
@@ -793,7 +793,7 @@ impl<'a> Rib<'a> {
     fn new(kind: RibKind<'a>) -> Rib<'a> {
         Rib {
             bindings: FxHashMap(),
-            kind: kind,
+            kind,
         }
     }
 }
@@ -875,9 +875,9 @@ fn new(parent: Option<Module<'a>>,
            expansion: Mark,
            span: Span) -> Self {
         ModuleData {
-            parent: parent,
-            kind: kind,
-            normal_ancestor_id: normal_ancestor_id,
+            parent,
+            kind,
+            normal_ancestor_id,
             resolutions: RefCell::new(FxHashMap()),
             legacy_macro_resolutions: RefCell::new(Vec::new()),
             macro_resolutions: RefCell::new(Vec::new()),
@@ -887,8 +887,8 @@ fn new(parent: Option<Module<'a>>,
             globs: RefCell::new((Vec::new())),
             traits: RefCell::new(None),
             populated: Cell::new(normal_ancestor_id.is_local()),
-            span: span,
-            expansion: expansion,
+            span,
+            expansion,
         }
     }
 
@@ -1356,13 +1356,13 @@ pub fn new(session: &'a Session,
         macro_defs.insert(Mark::root(), root_def_id);
 
         Resolver {
-            session: session,
+            session,
 
-            definitions: definitions,
+            definitions,
 
             // The outermost module has def ID 0; this is not reflected in the
             // AST.
-            graph_root: graph_root,
+            graph_root,
             prelude: None,
 
             has_self: FxHashSet(),
@@ -1389,7 +1389,7 @@ pub fn new(session: &'a Session,
             freevars_seen: NodeMap(),
             export_map: NodeMap(),
             trait_map: NodeMap(),
-            module_map: module_map,
+            module_map,
             block_map: NodeMap(),
             extern_module_map: FxHashMap(),
 
@@ -1404,7 +1404,7 @@ pub fn new(session: &'a Session,
             gated_errors: FxHashSet(),
             disallowed_shadowing: Vec::new(),
 
-            arenas: arenas,
+            arenas,
             dummy_binding: arenas.alloc_name_binding(NameBinding {
                 kind: NameBindingKind::Def(Def::Err),
                 expansion: Mark::root(),
@@ -1416,14 +1416,14 @@ pub fn new(session: &'a Session,
             use_extern_macros:
                 features.use_extern_macros || features.proc_macro || features.decl_macro,
 
-            crate_loader: crate_loader,
+            crate_loader,
             macro_names: FxHashSet(),
             global_macros: FxHashMap(),
             lexical_macro_resolutions: Vec::new(),
             macro_map: FxHashMap(),
             macro_exports: Vec::new(),
-            invocations: invocations,
-            macro_defs: macro_defs,
+            invocations,
+            macro_defs,
             local_macro_def_scopes: FxHashMap(),
             name_already_seen: FxHashMap(),
             whitelisted_legacy_custom_derives: Vec::new(),
@@ -1502,7 +1502,7 @@ fn record_use(&mut self, ident: Ident, ns: Namespace, binding: &'a NameBinding<'
             NameBindingKind::Import { .. } => false,
             NameBindingKind::Ambiguity { b1, b2, legacy } => {
                 self.ambiguity_errors.push(AmbiguityError {
-                    span: span, name: ident.name, lexical: false, b1: b1, b2: b2, legacy: legacy,
+                    span: span, name: ident.name, lexical: false, b1: b1, b2: b2, legacy,
                 });
                 if legacy {
                     self.record_use(ident, ns, b1, span);
@@ -2915,7 +2915,7 @@ fn adjust_local_def(&mut self,
                             if record_used {
                                 vec.push(Freevar {
                                     def: prev_def,
-                                    span: span,
+                                    span,
                                 });
                                 seen.insert(node_id, depth);
                             }
index 7572c4aa6802a423ce3d1b3eee1a2d54fed8b0a0..f8dc341653eceb663ab938cb631e0c48d3bae78d 100644 (file)
@@ -273,7 +273,7 @@ fn find_legacy_attr_invoc(&mut self, attrs: &mut Vec<ast::Attribute>)
                         id: attr::mk_attr_id(),
                         style: ast::AttrStyle::Outer,
                         is_sugared_doc: false,
-                        span: span,
+                        span,
                     });
                 }
             }
@@ -491,7 +491,7 @@ pub fn resolve_lexical_macro_path_segment(&mut self,
                             let name = ident.name;
                             self.ambiguity_errors.push(AmbiguityError {
                                 span: path_span,
-                                name: name,
+                                name,
                                 b1: shadower,
                                 b2: binding,
                                 lexical: true,
index 26c398379dc83256c906a843b2f59639be5b8c0a..5616971e9d1f54ff50197e1e8f920778f9c94e96 100644 (file)
@@ -165,7 +165,7 @@ pub fn resolve_ident_in_module_unadjusted(&mut self,
                        binding.def() != shadowed_glob.def() {
                         self.ambiguity_errors.push(AmbiguityError {
                             span: path_span,
-                            name: name,
+                            name,
                             lexical: false,
                             b1: binding,
                             b2: shadowed_glob,
@@ -265,13 +265,13 @@ pub fn add_import_directive(&mut self,
         let current_module = self.current_module;
         let directive = self.arenas.alloc_import_directive(ImportDirective {
             parent: current_module,
-            module_path: module_path,
+            module_path,
             imported_module: Cell::new(None),
-            subclass: subclass,
-            span: span,
-            id: id,
+            subclass,
+            span,
+            id,
             vis: Cell::new(vis),
-            expansion: expansion,
+            expansion,
             used: Cell::new(false),
         });
 
@@ -311,13 +311,13 @@ pub fn import(&self, binding: &'a NameBinding<'a>, directive: &'a ImportDirectiv
 
         self.arenas.alloc_name_binding(NameBinding {
             kind: NameBindingKind::Import {
-                binding: binding,
-                directive: directive,
+                binding,
+                directive,
                 used: Cell::new(false),
                 legacy_self_import: false,
             },
             span: directive.span,
-            vis: vis,
+            vis,
             expansion: directive.expansion,
         })
     }
@@ -661,8 +661,8 @@ fn finalize_import(&mut self, directive: &'b ImportDirective<'b>) -> Option<(Spa
             legacy_self_import = Some(directive);
             let binding = this.arenas.alloc_name_binding(NameBinding {
                 kind: NameBindingKind::Import {
-                    binding: binding,
-                    directive: directive,
+                    binding,
+                    directive,
                     used: Cell::new(false),
                     legacy_self_import: true,
                 },
index 658b6dbc4e3535b0334b779ff64e07c566accf65..619ebbc5422e05401296bcebb726138711f54734 100644 (file)
@@ -83,8 +83,8 @@ pub fn new(save_ctxt: SaveContext<'l, 'tcx>,
         let span_utils = SpanUtils::new(&save_ctxt.tcx.sess);
         DumpVisitor {
             tcx: save_ctxt.tcx,
-            save_ctxt: save_ctxt,
-            dumper: dumper,
+            save_ctxt,
+            dumper,
             span: span_utils.clone(),
             cur_scope: CRATE_NODE_ID,
             // mac_defs: HashSet::new(),
@@ -1351,7 +1351,7 @@ fn visit_expr(&mut self, ex: &'l ast::Expr) {
                                 self.span_from_span(sub_span.expect("No span found for var ref"));
                             self.dumper.dump_ref(Ref {
                                 kind: RefKind::Variable,
-                                span: span,
+                                span,
                                 ref_id: ::id_from_def_id(def.struct_variant().fields[idx.node].did),
                             });
                         }
index c3d071d27d6ef76a7218968239b0002c793200c2..f16ce13b2d5c8b31d6b57653829e1df84ce3ba6b 100644 (file)
@@ -881,7 +881,7 @@ pub struct DumpHandler<'a> {
 impl<'a> DumpHandler<'a> {
     pub fn new(odir: Option<&'a Path>, cratename: &str) -> DumpHandler<'a> {
         DumpHandler {
-            odir: odir,
+            odir,
             cratename: cratename.to_owned()
         }
     }
@@ -976,9 +976,9 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>(tcx: TyCtxt<'l, 'tcx, 'tcx>,
     info!("Dumping crate {}", cratename);
 
     let save_ctxt = SaveContext {
-        tcx: tcx,
+        tcx,
         tables: &ty::TypeckTables::empty(None),
-        analysis: analysis,
+        analysis,
         span_utils: SpanUtils::new(&tcx.sess),
         config: find_config(config),
     };
@@ -1048,7 +1048,7 @@ fn lower_attributes(attrs: Vec<Attribute>, scx: &SaveContext) -> Vec<rls_data::A
         let value = value[2..value.len()-1].to_string();
 
         rls_data::Attribute {
-            value: value,
+            value,
             span: scx.span_from_span(attr.span),
         }
     }).collect()
index 6ef499694aa4f964e90649832010841df59aab2d..c7e00245d63502b6b883ac079f79ff9cbfe1c636 100644 (file)
@@ -149,7 +149,7 @@ fn merge_sigs(text: String, sigs: Vec<Signature>) -> Signature {
 
 fn text_sig(text: String) -> Signature {
     Signature {
-        text: text,
+        text,
         defs: vec![],
         refs: vec![],
     }
@@ -706,8 +706,8 @@ fn make(&self, offset: usize, _parent_id: Option<NodeId>, scx: &SaveContext) ->
                 text.push('}');
                 Ok(Signature {
                     text,
-                    defs: defs,
-                    refs: refs,
+                    defs,
+                    refs,
                 })
             }
             ast::VariantData::Tuple(ref fields, id) => {
@@ -729,8 +729,8 @@ fn make(&self, offset: usize, _parent_id: Option<NodeId>, scx: &SaveContext) ->
                 text.push(')');
                 Ok(Signature {
                     text,
-                    defs: defs,
-                    refs: refs,
+                    defs,
+                    refs,
                 })
             }
             ast::VariantData::Unit(id) => {
index 631907b28f8b8d0a40736b5d1e6f8386aeeaac71..36e4d09c963f5b6bd1e8f9d813b77c4b82b45f81 100644 (file)
@@ -32,7 +32,7 @@ pub struct SpanUtils<'a> {
 impl<'a> SpanUtils<'a> {
     pub fn new(sess: &'a Session) -> SpanUtils<'a> {
         SpanUtils {
-            sess: sess,
+            sess,
             err_count: Cell::new(0),
         }
     }
index 144b484d7e819ee020c4095e2ff7e81be2c689dd..5e50696b56009d7b0819cbb59c671bd644cbb09c 100644 (file)
@@ -433,7 +433,7 @@ impl<'a, 'tcx> ArgType<'tcx> {
     fn new(layout: TyLayout<'tcx>) -> ArgType<'tcx> {
         ArgType {
             kind: ArgKind::Direct,
-            layout: layout,
+            layout,
             cast: None,
             pad: None,
             attrs: ArgAttributes::default()
@@ -808,10 +808,10 @@ pub fn unadjusted(ccx: &CrateContext<'a, 'tcx>,
         }
 
         FnType {
-            args: args,
-            ret: ret,
+            args,
+            ret,
             variadic: sig.variadic,
-            cconv: cconv
+            cconv,
         }
     }
 
index 6ec40bd689c23eb963a6ee93679d0d710a2d5c33..31dee241de440d1edddb9e5d597d52303ca6f45e 100644 (file)
@@ -89,7 +89,7 @@ impl<'a> ArchiveBuilder<'a> {
     /// by `config`.
     pub fn new(config: ArchiveConfig<'a>) -> ArchiveBuilder<'a> {
         ArchiveBuilder {
-            config: config,
+            config,
             removals: Vec::new(),
             additions: Vec::new(),
             should_update_symbols: false,
@@ -190,7 +190,7 @@ fn add_archive<F>(&mut self, archive: &Path, skip: F)
             Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
         };
         self.additions.push(Addition::Archive {
-            archive: archive,
+            archive,
             skip: Box::new(skip),
         });
         Ok(())
index a9bd8ea90109e24316c7b4a150802d389c36a95b..d2c96a877fdb71f36b1b7122b8a63b8c7ea5b8cf 100644 (file)
@@ -379,7 +379,7 @@ fn archive_config<'a>(sess: &'a Session,
                       output: &Path,
                       input: Option<&Path>) -> ArchiveConfig<'a> {
     ArchiveConfig {
-        sess: sess,
+        sess,
         dst: output.to_path_buf(),
         src: input.map(|p| p.to_path_buf()),
         lib_search_paths: archive_search_paths(sess),
index b364f92f1044d0ea6ba7590946df4027d86f96c3..ab401465b560b80b09ee460b9ad0d99cb99bbf9c 100644 (file)
@@ -49,22 +49,22 @@ pub fn to_linker(&'a self,
         match sess.linker_flavor() {
             LinkerFlavor::Msvc => {
                 Box::new(MsvcLinker {
-                    cmd: cmd,
-                    sess: sess,
+                    cmd,
+                    sess,
                     info: self
                 }) as Box<Linker>
             }
             LinkerFlavor::Em =>  {
                 Box::new(EmLinker {
-                    cmd: cmd,
-                    sess: sess,
+                    cmd,
+                    sess,
                     info: self
                 }) as Box<Linker>
             }
             LinkerFlavor::Gcc =>  {
                 Box::new(GccLinker {
-                    cmd: cmd,
-                    sess: sess,
+                    cmd,
+                    sess,
                     info: self,
                     hinted_static: false,
                     is_ld: false,
@@ -72,8 +72,8 @@ pub fn to_linker(&'a self,
             }
             LinkerFlavor::Ld => {
                 Box::new(GccLinker {
-                    cmd: cmd,
-                    sess: sess,
+                    cmd,
+                    sess,
                     info: self,
                     hinted_static: false,
                     is_ld: true,
index 94cae37761fe2bf36cd54e6246eedb10392f2c78..8ed9daed49b8fd4a327ff3ec4fbdd79efc126ee3 100644 (file)
@@ -237,7 +237,7 @@ impl ModuleConfig {
     fn new(sess: &Session, passes: Vec<String>) -> ModuleConfig {
         ModuleConfig {
             tm: create_target_machine(sess),
-            passes: passes,
+            passes,
             opt_level: None,
             opt_size: None,
 
@@ -426,8 +426,8 @@ unsafe fn optimize_and_codegen(cgcx: &CodegenContext,
     let tm = config.tm;
 
     let fv = HandlerFreeVars {
-        cgcx: cgcx,
-        diag_handler: diag_handler,
+        cgcx,
+        diag_handler,
     };
     let fv = &fv as *const HandlerFreeVars as *mut c_void;
 
@@ -1012,9 +1012,9 @@ fn build_work_item(mtrans: ModuleTranslation,
                    -> WorkItem
 {
     WorkItem {
-        mtrans: mtrans,
-        config: config,
-        output_names: output_names
+        mtrans,
+        config,
+        output_names,
     }
 }
 
@@ -1136,17 +1136,17 @@ fn start_executing_work(sess: &Session,
 
     let cgcx = CodegenContext {
         crate_types: sess.crate_types.borrow().clone(),
-        each_linked_rlib_for_lto: each_linked_rlib_for_lto,
+        each_linked_rlib_for_lto,
         lto: sess.lto(),
         no_landing_pads: sess.no_landing_pads(),
         opts: Arc::new(sess.opts.clone()),
         time_passes: sess.time_passes(),
-        exported_symbols: exported_symbols,
+        exported_symbols,
         plugin_passes: sess.plugin_llvm_passes.borrow().clone(),
         remark: sess.opts.cg.remark.clone(),
         worker: 0,
         incr_comp_session_dir: sess.incr_comp_session_dir_opt().map(|r| r.clone()),
-        coordinator_send: coordinator_send,
+        coordinator_send,
         diag_emitter: shared_emitter.clone(),
         time_graph,
     };
index b4a2891f94c2af91ea278df98f9d82940afdfc72..354a85b4d29a5fe4b62d3c28d7453e1debbc3529 100644 (file)
@@ -99,9 +99,9 @@ impl<'a, 'tcx> StatRecorder<'a, 'tcx> {
     pub fn new(ccx: &'a CrateContext<'a, 'tcx>, name: String) -> StatRecorder<'a, 'tcx> {
         let istart = ccx.stats().n_llvm_insns.get();
         StatRecorder {
-            ccx: ccx,
+            ccx,
             name: Some(name),
-            istart: istart,
+            istart,
         }
     }
 }
@@ -1058,8 +1058,8 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             let (llcx, llmod) =
                 context::create_context_and_module(tcx.sess, "allocator");
             let modules = ModuleLlvm {
-                llmod: llmod,
-                llcx: llcx,
+                llmod,
+                llcx,
             };
             time(tcx.sess.time_passes(), "write allocator module", || {
                 allocator::trans(tcx, &modules, kind)
index 5103ca5c5e1094ef94b66bbbe65a497e07f21cd7..8a585e72f59ed2ba296ac721a6b48850beec033d 100644 (file)
@@ -70,8 +70,8 @@ pub fn with_ccx(ccx: &'a CrateContext<'a, 'tcx>) -> Self {
             llvm::LLVMCreateBuilderInContext(ccx.llcx())
         };
         Builder {
-            llbuilder: llbuilder,
-            ccx: ccx,
+            llbuilder,
+            ccx,
         }
     }
 
index b31295f4022ed3580b333b8c0682712e413d537a..ae1b60ae7ba283b8b3aca1689df0c2b833a1bf06 100644 (file)
@@ -331,8 +331,8 @@ fn collect_roots<'a, 'tcx>(scx: &SharedCrateContext<'a, 'tcx>,
 
     {
         let mut visitor = RootCollector {
-            scx: scx,
-            mode: mode,
+            scx,
+            mode,
             exported_symbols,
             output: &mut roots,
         };
@@ -1035,9 +1035,9 @@ fn collect_neighbours<'a, 'tcx>(scx: &SharedCrateContext<'a, 'tcx>,
     let mir = scx.tcx().instance_mir(instance.def);
 
     let mut visitor = MirNeighborCollector {
-        scx: scx,
+        scx,
         mir: &mir,
-        output: output,
+        output,
         param_substs: instance.substs,
         const_context,
     };
index 0cc499577bb7caaa5c98ac97ecb029866e214654..09aa3d2335a6a06e4e83e8e9c58f9ad3866df1d5 100644 (file)
@@ -177,7 +177,7 @@ pub struct Funclet {
 impl Funclet {
     pub fn new(cleanuppad: ValueRef) -> Funclet {
         Funclet {
-            cleanuppad: cleanuppad,
+            cleanuppad,
             operand: OperandBundleDef::new("funclet", &[cleanuppad]),
         }
     }
index bec39e3cde6d0d2f935d3b7f063222389288c49c..8c6bd302e4bfdb51fd495938024285a04b8ba25c 100644 (file)
@@ -323,10 +323,10 @@ pub fn new(tcx: TyCtxt<'b, 'tcx, 'tcx>,
         let use_dll_storage_attrs = tcx.sess.target.target.options.is_like_msvc;
 
         SharedCrateContext {
-            tcx: tcx,
-            check_overflow: check_overflow,
-            use_dll_storage_attrs: use_dll_storage_attrs,
-            output_filenames: output_filenames,
+            tcx,
+            check_overflow,
+            use_dll_storage_attrs,
+            output_filenames,
         }
     }
 
@@ -395,10 +395,10 @@ pub fn new(shared: &SharedCrateContext<'a, 'tcx>,
             };
 
             let local_ccx = LocalCrateContext {
-                llmod: llmod,
-                llcx: llcx,
+                llmod,
+                llcx,
                 stats: Stats::default(),
-                codegen_unit: codegen_unit,
+                codegen_unit,
                 crate_trans_items,
                 exported_symbols,
                 instances: RefCell::new(FxHashMap()),
@@ -416,7 +416,7 @@ pub fn new(shared: &SharedCrateContext<'a, 'tcx>,
                 int_type: Type::from_ref(ptr::null_mut()),
                 opaque_vec_type: Type::from_ref(ptr::null_mut()),
                 str_slice_type: Type::from_ref(ptr::null_mut()),
-                dbg_cx: dbg_cx,
+                dbg_cx,
                 eh_personality: Cell::new(None),
                 eh_unwind_resume: Cell::new(None),
                 rust_try_fn: Cell::new(None),
@@ -462,7 +462,7 @@ fn dummy_ccx(shared: &'a SharedCrateContext<'a, 'tcx>,
                  -> CrateContext<'a, 'tcx> {
         assert!(local_ccxs.len() == 1);
         CrateContext {
-            shared: shared,
+            shared,
             local_ccx: &local_ccxs[0]
         }
     }
index ae618c7e170df4b4a07d4e93194070b12701023f..95f13ea87169f30233531f5cc65e5f6b7781a03d 100644 (file)
@@ -129,7 +129,7 @@ fn make_mir_scope(ccx: &CrateContext,
             loc.col.to_usize() as c_uint)
     };
     scopes[scope] = MirDebugScope {
-        scope_metadata: scope_metadata,
+        scope_metadata,
         file_start_pos: loc.file.start_pos,
         file_end_pos: loc.file.end_pos,
     };
index 61204b88e130ef715d518f0a72e6d077c895d837..9aba075a20cdb4822aa9036bdc94006ca915b863 100644 (file)
@@ -205,11 +205,11 @@ fn create_and_register_recursive_type_forward_declaration<'a, 'tcx>(
     type_map.register_type_with_metadata(unfinished_type, metadata_stub);
 
     UnfinishedMetadata {
-        unfinished_type: unfinished_type,
-        unique_type_id: unique_type_id,
-        metadata_stub: metadata_stub,
-        llvm_type: llvm_type,
-        member_description_factory: member_description_factory,
+        unfinished_type,
+        unique_type_id,
+        metadata_stub,
+        llvm_type,
+        member_description_factory,
     }
 }
 
@@ -847,8 +847,8 @@ struct MetadataCreationResult {
 impl MetadataCreationResult {
     fn new(metadata: DIType, already_stored_in_typemap: bool) -> MetadataCreationResult {
         MetadataCreationResult {
-            metadata: metadata,
-            already_stored_in_typemap: already_stored_in_typemap
+            metadata,
+            already_stored_in_typemap,
         }
     }
 }
@@ -947,10 +947,10 @@ fn create_member_descriptions<'a>(&self, cx: &CrateContext<'a, 'tcx>)
             let offset = FixedMemberOffset { bytes: offsets[i].bytes() as usize};
 
             MemberDescription {
-                name: name,
+                name,
                 llvm_type: type_of::in_memory_type_of(cx, fty),
                 type_metadata: type_metadata(cx, fty, self.span),
-                offset: offset,
+                offset,
                 flags: DIFlags::FlagZero,
             }
         }).collect()
@@ -987,9 +987,9 @@ fn prepare_struct_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
         struct_llvm_type,
         StructMDF(StructMemberDescriptionFactory {
             ty: struct_type,
-            variant: variant,
-            substs: substs,
-            span: span,
+            variant,
+            substs,
+            span,
         })
     )
 }
@@ -1052,7 +1052,7 @@ fn prepare_tuple_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
         TupleMDF(TupleMemberDescriptionFactory {
             ty: tuple_type,
             component_types: component_types.to_vec(),
-            span: span,
+            span,
         })
     )
 }
@@ -1111,9 +1111,9 @@ fn prepare_union_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
         union_metadata_stub,
         union_llvm_type,
         UnionMDF(UnionMemberDescriptionFactory {
-            variant: variant,
-            substs: substs,
-            span: span,
+            variant,
+            substs,
+            span,
         })
     )
 }
@@ -1462,14 +1462,14 @@ fn describe_enum_variant<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
     let member_description_factory =
         VariantMDF(VariantMemberDescriptionFactory {
             offsets: &struct_def.offsets[..],
-            args: args,
+            args,
             discriminant_type_metadata: match discriminant_info {
                 RegularDiscriminant(discriminant_type_metadata) => {
                     Some(discriminant_type_metadata)
                 }
                 _ => None
             },
-            span: span,
+            span,
         });
 
     (metadata_stub, variant_llvm_type, member_description_factory)
@@ -1590,12 +1590,12 @@ fn prepare_enum_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
         enum_metadata,
         enum_llvm_type,
         EnumMDF(EnumMemberDescriptionFactory {
-            enum_type: enum_type,
+            enum_type,
             type_rep: type_rep.layout,
-            discriminant_type_metadata: discriminant_type_metadata,
-            containing_scope: containing_scope,
-            file_metadata: file_metadata,
-            span: span,
+            discriminant_type_metadata,
+            containing_scope,
+            file_metadata,
+            span,
         }),
     );
 
index 68432c22f810c4eae471838a9aea2e9e7facc3d3..83366c13453bc4fc3cb8acbda8bb5f91339d7798 100644 (file)
@@ -87,9 +87,9 @@ pub fn new(llmod: ModuleRef) -> CrateDebugContext<'tcx> {
         // DIBuilder inherits context from the module, so we'd better use the same one
         let llcontext = unsafe { llvm::LLVMGetModuleContext(llmod) };
         CrateDebugContext {
-            llcontext: llcontext,
-            llmod: llmod,
-            builder: builder,
+            llcontext,
+            llmod,
+            builder,
             created_files: RefCell::new(FxHashMap()),
             created_enum_disr_types: RefCell::new(FxHashMap()),
             type_map: RefCell::new(TypeMap::new()),
@@ -292,7 +292,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
 
     // Initialize fn debug context (including scope map and namespace map)
     let fn_debug_context = FunctionDebugContextData {
-        fn_metadata: fn_metadata,
+        fn_metadata,
         source_locations_enabled: Cell::new(false),
         defining_crate: def_id.krate,
     };
index e99e26261a3a1017d366f2a4af32142c1e358866..7393802294aac38da8628d4de0df5700c6e2b95f 100644 (file)
@@ -72,9 +72,9 @@ pub enum InternalDebugLocation {
 impl InternalDebugLocation {
     pub fn new(scope: DIScope, line: usize, col: usize) -> InternalDebugLocation {
         KnownLocation {
-            scope: scope,
-            line: line,
-            col: col,
+            scope,
+            line,
+            col,
         }
     }
 }
index 9bb29c340d9839de4a3b7454fa0a36d73ef3f37b..28fe1044e7454c849db2e8e70c0aeda7dfcb6fa8 100644 (file)
@@ -673,8 +673,8 @@ fn trans_arguments_untupled(&mut self,
                         Ref(ptr, align)
                     };
                     let op = OperandRef {
-                        val: val,
-                        ty: ty
+                        val,
+                        ty,
                     };
                     self.trans_argument(bcx, op, llargs, fn_ty, next_idx, llfn, def);
                 }
@@ -697,7 +697,7 @@ fn trans_arguments_untupled(&mut self,
                     // If the tuple is immediate, the elements are as well
                     let op = OperandRef {
                         val: Immediate(elem),
-                        ty: ty
+                        ty,
                     };
                     self.trans_argument(bcx, op, llargs, fn_ty, next_idx, llfn, def);
                 }
@@ -713,7 +713,7 @@ fn trans_arguments_untupled(&mut self,
                     // Pair is always made up of immediates
                     let op = OperandRef {
                         val: Immediate(elem),
-                        ty: ty
+                        ty,
                     };
                     self.trans_argument(bcx, op, llargs, fn_ty, next_idx, llfn, def);
                 }
index 53469689bc7ddf20e853e5ff5a3e702cdd26a72c..293e6462de2797d210aca4acc70775f206051404 100644 (file)
@@ -57,8 +57,8 @@ pub struct Const<'tcx> {
 impl<'tcx> Const<'tcx> {
     pub fn new(llval: ValueRef, ty: Ty<'tcx>) -> Const<'tcx> {
         Const {
-            llval: llval,
-            ty: ty
+            llval,
+            ty,
         }
     }
 
@@ -158,7 +158,7 @@ pub fn to_operand<'a>(&self, ccx: &CrateContext<'a, 'tcx>) -> OperandRef<'tcx> {
         };
 
         OperandRef {
-            val: val,
+            val,
             ty: self.ty
         }
     }
@@ -247,9 +247,9 @@ fn new(ccx: &'a CrateContext<'a, 'tcx>,
            args: IndexVec<mir::Local, Result<Const<'tcx>, ConstEvalErr<'tcx>>>)
            -> MirConstContext<'a, 'tcx> {
         let mut context = MirConstContext {
-            ccx: ccx,
-            mir: mir,
-            substs: substs,
+            ccx,
+            mir,
+            substs,
             locals: (0..mir.local_decls.len()).map(|_| None).collect(),
         };
         for (i, arg) in args.into_iter().enumerate() {
@@ -491,7 +491,7 @@ fn const_lvalue(&self, lvalue: &mir::Lvalue<'tcx>, span: Span)
                 };
                 ConstLvalue {
                     base: projected,
-                    llextra: llextra,
+                    llextra,
                     ty: projected_ty
                 }
             }
index af8976967a1e7a9536267260d5f8039abaf9242e..89c76ccdd27c2d702c63040c34104b22d2be4723 100644 (file)
@@ -380,7 +380,7 @@ pub fn trans_lvalue(&mut self,
                 };
                 LvalueRef {
                     llval: llprojected,
-                    llextra: llextra,
+                    llextra,
                     ty: projected_ty,
                     alignment: align,
                 }
index d0f7f27d5a81c3791218c2062fbf78e71a5e0a66..a67fa070324c358fb0f2859d8db72e1a205ba2b9 100644 (file)
@@ -228,19 +228,19 @@ pub fn trans_mir<'a, 'tcx: 'a>(
     let (landing_pads, funclets) = create_funclets(&bcx, &cleanup_kinds, &block_bcxs);
 
     let mut mircx = MirContext {
-        mir: mir,
-        llfn: llfn,
-        fn_ty: fn_ty,
-        ccx: ccx,
+        mir,
+        llfn,
+        fn_ty,
+        ccx,
         llpersonalityslot: None,
         blocks: block_bcxs,
         unreachable_block: None,
-        cleanup_kinds: cleanup_kinds,
-        landing_pads: landing_pads,
+        cleanup_kinds,
+        landing_pads,
         funclets: &funclets,
-        scopes: scopes,
+        scopes,
         locals: IndexVec::new(),
-        debug_context: debug_context,
+        debug_context,
         param_substs: {
             assert!(!instance.substs.needs_infer());
             instance.substs
@@ -486,7 +486,7 @@ fn arg_local_refs<'a, 'tcx>(bcx: &Builder<'a, 'tcx>,
                 OperandValue::Immediate(llarg)
             };
             let operand = OperandRef {
-                val: val,
+                val,
                 ty: arg_ty
             };
             return LocalRef::Operand(Some(operand.unpack_if_pair(bcx)));
index 1b8a05b6f6c746b125a1fbc7dfac71797d507a1b..9ce1749190ba17710228d41162c423ce42be2ba8 100644 (file)
@@ -98,8 +98,8 @@ pub fn new_zst(ccx: &CrateContext<'a, 'tcx>,
             OperandValue::Immediate(C_null(llty))
         };
         OperandRef {
-            val: val,
-            ty: ty
+            val,
+            ty,
         }
     }
 
@@ -122,7 +122,7 @@ pub fn deref(self) -> LvalueRef<'tcx> {
         };
         LvalueRef {
             llval: llptr,
-            llextra: llextra,
+            llextra,
             ty: LvalueTy::from_ty(projected_ty),
             alignment: Alignment::AbiAligned,
         }
index a23e1a0684bf4c27770058325dde9b9f132a0e77..8051e04060a4ccaae281addfd40ce009464719a0 100644 (file)
@@ -148,9 +148,9 @@ pub fn trans_rvalue(&mut self,
                                     dest.llval, dest.ty, dest.alignment);
                                 let field_index = active_field_index.unwrap_or(i);
                                 val.ty = LvalueTy::Downcast {
-                                    adt_def: adt_def,
+                                    adt_def,
                                     substs: self.monomorphize(&substs),
-                                    variant_index: variant_index,
+                                    variant_index,
                                 };
                                 let (lldest_i, align) = val.trans_field_ptr(&bcx, field_index);
                                 self.store_operand(&bcx, lldest_i, align.to_align(), op);
@@ -348,7 +348,7 @@ pub fn trans_rvalue_operand(&mut self,
                     }
                 };
                 let operand = OperandRef {
-                    val: val,
+                    val,
                     ty: cast_ty
                 };
                 (bcx, operand)
index b94fd13c3a4a29e84f7fdcfd8d5451a732338601..38232ed1d113a7696b03290991b72857fcd47608 100644 (file)
@@ -384,9 +384,9 @@ pub fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                omit_local_crate_name: bool)
                -> Self {
         DefPathBasedNames {
-            tcx: tcx,
-            omit_disambiguators: omit_disambiguators,
-            omit_local_crate_name: omit_local_crate_name,
+            tcx,
+            omit_disambiguators,
+            omit_local_crate_name,
         }
     }
 
index 2910d25486ed5ad714cf925f9ae24feaec9f71e6..32fa0534db618abf994697e9a6f3ea68f906c116 100644 (file)
@@ -117,8 +117,8 @@ pub fn ast_region_to_region(&self,
                 let name = tcx.hir.name(id);
                 tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion {
                     def_id: tcx.hir.local_def_id(id),
-                    index: index,
-                    name: name
+                    index,
+                    name,
                 }))
             }
 
index 6aac9dc42ee02bda67e747fb6738600259fc4116..e0e946a9c63fa7b367a5ef37c80da9ee7de024b0 100644 (file)
@@ -217,7 +217,7 @@ pub fn autoderef(&'a self, span: Span, base_ty: Ty<'tcx>) -> Autoderef<'a, 'gcx,
             cur_ty: self.resolve_type_vars_if_possible(&base_ty),
             obligations: vec![],
             at_start: true,
-            span: span,
+            span,
         }
     }
 
index b18b11f3d906992c2f4bfb09dc5c775672fd893b..9c6cacb9d25f9e04e0dbf95664b27393be0d5d53 100644 (file)
@@ -136,12 +136,12 @@ pub fn new(fcx: &FnCtxt<'a, 'gcx, 'tcx>,
                span: Span)
                -> Result<CastCheck<'tcx>, ErrorReported> {
         let check = CastCheck {
-            expr: expr,
-            expr_ty: expr_ty,
-            expr_diverges: expr_diverges,
-            cast_ty: cast_ty,
-            cast_span: cast_span,
-            span: span,
+            expr,
+            expr_ty,
+            expr_diverges,
+            cast_ty,
+            cast_span,
+            span,
         };
 
         // For better error messages, check for some obviously unsized
index 53f3d811fae4fb9d3ebba7d8f441197c40ca7e8e..48671e864b211b1a05dac0bcb3ffb33b7eab695a 100644 (file)
@@ -128,8 +128,8 @@ fn success<'tcx>(adj: Vec<Adjustment<'tcx>>,
 impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> {
     fn new(fcx: &'f FnCtxt<'f, 'gcx, 'tcx>, cause: ObligationCause<'tcx>) -> Self {
         Coerce {
-            fcx: fcx,
-            cause: cause,
+            fcx,
+            cause,
             use_lub: false,
         }
     }
index 355e6cdbbe074b2093cc3d4012bc0bee7b1938eb..cd2adfb7ab0c19d34d18e03913d56ccf15ed29cf 100644 (file)
@@ -69,10 +69,10 @@ fn new(fcx: &'a FnCtxt<'a, 'gcx, 'tcx>,
            call_expr: &'gcx hir::Expr)
            -> ConfirmContext<'a, 'gcx, 'tcx> {
         ConfirmContext {
-            fcx: fcx,
-            span: span,
-            self_expr: self_expr,
-            call_expr: call_expr,
+            fcx,
+            span,
+            self_expr,
+            call_expr,
         }
     }
 
index a1c987f22e053d07fccdd4d9c7a9dc019ab8e9a5..34cc6027a64210f84fc202b6b89e0e3c32be74a5 100644 (file)
@@ -83,10 +83,10 @@ pub fn new(static_candidates: Vec<CandidateSource>,
                mode: probe::Mode)
                -> Self {
         NoMatchData {
-            static_candidates: static_candidates,
-            unsatisfied_predicates: unsatisfied_predicates,
-            out_of_scope_traits: out_of_scope_traits,
-            mode: mode,
+            static_candidates,
+            unsatisfied_predicates,
+            out_of_scope_traits,
+            mode,
         }
     }
 }
@@ -331,7 +331,7 @@ pub fn lookup_method_in_trait(&self,
                                                  ty::Predicate::WellFormed(method_ty)));
 
         let callee = MethodCallee {
-            def_id: def_id,
+            def_id,
             substs: trait_ref.substs,
             sig: fn_sig,
         };
index 5de4a35bdc724ce687d616d294101c2bfca2d937..4cb5eef4563293ad9806b289e643baa182f7a94e 100644 (file)
@@ -253,7 +253,7 @@ fn probe_op<OP,R>(&'a self,
             }
         } else {
             vec![CandidateStep {
-                     self_ty: self_ty,
+                     self_ty,
                      autoderefs: 0,
                      unsize: false,
                  }]
@@ -361,15 +361,15 @@ fn new(fcx: &'a FnCtxt<'a, 'gcx, 'tcx>,
            opt_simplified_steps: Option<Vec<ty::fast_reject::SimplifiedType>>)
            -> ProbeContext<'a, 'gcx, 'tcx> {
         ProbeContext {
-            fcx: fcx,
-            span: span,
-            mode: mode,
-            looking_for: looking_for,
+            fcx,
+            span,
+            mode,
+            looking_for,
             inherent_candidates: Vec::new(),
             extension_candidates: Vec::new(),
             impl_dups: FxHashSet(),
             steps: Rc::new(steps),
-            opt_simplified_steps: opt_simplified_steps,
+            opt_simplified_steps,
             static_candidates: Vec::new(),
             private_candidate: None,
             unsatisfied_predicates: Vec::new(),
index 56eacc3194d1c8404c60d7c8e6dc073cc768af5c..2337e989be46df22ead6f7224e1b4bbcb7afc02c 100644 (file)
@@ -584,7 +584,7 @@ fn handle_external_def(tcx: TyCtxt,
     let borrow = tcx.all_traits.borrow();
     assert!(borrow.is_some());
     AllTraits {
-        borrow: borrow,
+        borrow,
         idx: 0,
     }
 }
index 1b56044710ba33d5a52c13c918609ae6bbf5648f..bc03c9254173823f67e5e17b1d40547ab002b439 100644 (file)
@@ -393,8 +393,8 @@ pub fn recurse(&mut self, blk: &hir::Block) -> UnsafetyState {
                     hir::DefaultBlock =>
                         (unsafety, self.def, self.unsafe_push_count),
                 };
-                UnsafetyState{ def: def,
-                               unsafety: unsafety,
+                UnsafetyState{ def,
+                               unsafety,
                                unsafe_push_count: count,
                                from_fn: false }
             }
@@ -609,7 +609,7 @@ fn new(infcx: InferCtxt<'a, 'gcx, 'tcx>, def_id: DefId) -> Self {
             tables: MaybeInProgressTables {
                 maybe_tables: infcx.in_progress_tables,
             },
-            infcx: infcx,
+            infcx,
             fulfillment_cx: RefCell::new(traits::FulfillmentContext::new()),
             locals: RefCell::new(NodeMap()),
             deferred_call_resolutions: RefCell::new(DefIdMap()),
@@ -1697,7 +1697,7 @@ pub fn new(inh: &'a Inherited<'a, 'gcx, 'tcx>,
                body_id: ast::NodeId)
                -> FnCtxt<'a, 'gcx, 'tcx> {
         FnCtxt {
-            body_id: body_id,
+            body_id,
             param_env,
             err_count_on_creation: inh.tcx.sess.err_count(),
             ret_coercion: None,
@@ -1709,7 +1709,7 @@ pub fn new(inh: &'a Inherited<'a, 'gcx, 'tcx>,
                 stack: Vec::new(),
                 by_id: NodeMap(),
             }),
-            inh: inh,
+            inh,
         }
     }
 
@@ -3783,7 +3783,7 @@ fn check_expr_kind(&self,
               };
 
               let ctxt = BreakableCtxt {
-                  coerce: coerce,
+                  coerce,
                   may_break: false, // will get updated if/when we find a `break`
               };
 
index b187075a36d27f7840b6f8a3706308bccda61e9e..73c243d27d1cfc406d790d1b00e55283c9a53399 100644 (file)
@@ -232,8 +232,8 @@ pub fn new(fcx: &'a FnCtxt<'a, 'gcx, 'tcx>,
                Subject(subject): Subject) -> RegionCtxt<'a, 'gcx, 'tcx> {
         let region_maps = fcx.tcx.region_maps(subject);
         RegionCtxt {
-            fcx: fcx,
-            region_maps: region_maps,
+            fcx,
+            region_maps,
             repeating_scope: initial_repeating_scope,
             body_id: initial_body_id,
             call_site_scope: None,
index 31e14a6b630d277885381555534d65ae31524469..f85835e3800f41777fbd6378ebff9a599578e4af 100644 (file)
@@ -54,7 +54,7 @@ fn with_fcx<F>(&'tcx mut self, f: F) where
             let fcx = FnCtxt::new(&inh, param_env, id);
             let wf_tys = f(&fcx, &mut CheckTypeWellFormedVisitor {
                 tcx: fcx.tcx.global_tcx(),
-                code: code
+                code,
             });
             fcx.select_all_obligations_or_error();
             fcx.regionck_item(id, span, &wf_tys);
@@ -66,7 +66,7 @@ impl<'a, 'gcx> CheckTypeWellFormedVisitor<'a, 'gcx> {
     pub fn new(tcx: TyCtxt<'a, 'gcx, 'gcx>)
                -> CheckTypeWellFormedVisitor<'a, 'gcx> {
         CheckTypeWellFormedVisitor {
-            tcx: tcx,
+            tcx,
             code: ObligationCauseCode::MiscObligation
         }
     }
@@ -211,8 +211,8 @@ fn for_id<'tcx>(&self, id: ast::NodeId, span: Span)
         CheckWfFcxBuilder {
             inherited: Inherited::build(self.tcx, def_id),
             code: self.code.clone(),
-            id: id,
-            span: span,
+            id,
+            span,
             param_env: self.tcx.param_env(def_id),
         }
     }
@@ -471,7 +471,7 @@ fn check_method_receiver<'fcx, 'tcx>(&mut self,
             ExplicitSelf::ByReference(region, mutbl) => {
                 fcx.tcx.mk_ref(region, ty::TypeAndMut {
                     ty: self_ty,
-                    mutbl: mutbl
+                    mutbl,
                 })
             }
             ExplicitSelf::ByBox => fcx.tcx.mk_box(self_ty)
index a363e47a14f2925d0d46a4a298d9a4b6212b022e..36c72fc4b19d60b5601023a03633c613fc90ea07 100644 (file)
@@ -80,9 +80,9 @@ fn new(fcx: &'cx FnCtxt<'cx, 'gcx, 'tcx>, body: &'gcx hir::Body)
         let owner = fcx.tcx.hir.definitions().node_to_hir_id(body.id().node_id);
 
         WritebackCx {
-            fcx: fcx,
+            fcx,
             tables: ty::TypeckTables::empty(Some(DefId::local(owner.owner))),
-            body: body
+            body,
         }
     }
 
@@ -445,8 +445,8 @@ fn new(fcx: &'cx FnCtxt<'cx, 'gcx, 'tcx>, span: &'cx Locatable, body: &'gcx hir:
         Resolver {
             tcx: fcx.tcx,
             infcx: fcx,
-            span: span,
-            body: body,
+            span,
+            body,
         }
     }
 
index 91b41eb33a17d71d6ac22baa06306d408e8a21da..ea86c570c82967db554ef10b161a23298f7bbe4a 100644 (file)
@@ -185,8 +185,8 @@ impl<'a, 'tcx> ItemCtxt<'a, 'tcx> {
     pub fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_def_id: DefId)
            -> ItemCtxt<'a,'tcx> {
         ItemCtxt {
-            tcx: tcx,
-            item_def_id: item_def_id,
+            tcx,
+            item_def_id,
         }
     }
 }
@@ -630,10 +630,10 @@ fn convert_struct_variant<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         }
     }).collect();
     ty::VariantDef {
-        did: did,
-        name: name,
-        discr: discr,
-        fields: fields,
+        did,
+        name,
+        discr,
+        fields,
         ctor_kind: CtorKind::from_hir(def),
     }
 }
@@ -1028,7 +1028,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             types.extend(fv.iter().enumerate().map(|(i, _)| ty::TypeParameterDef {
                 index: type_start + i as u32,
                 name: Symbol::intern("<upvar>"),
-                def_id: def_id,
+                def_id,
                 has_default: false,
                 object_lifetime_default: rl::Set1::Empty,
                 pure_wrt_drop: false,
@@ -1043,11 +1043,11 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
     tcx.alloc_generics(ty::Generics {
         parent: parent_def_id,
-        parent_regions: parent_regions,
-        parent_types: parent_types,
-        regions: regions,
-        types: types,
-        type_param_to_index: type_param_to_index,
+        parent_regions,
+        parent_types,
+        regions,
+        types,
+        type_param_to_index,
         has_self: has_self || parent_has_self,
         has_late_bound_regions: has_late_bound_regions(tcx, node),
     })
@@ -1382,7 +1382,7 @@ fn predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
                 ItemTrait(_, ref generics, .., ref items) => {
                     is_trait = Some((ty::TraitRef {
-                        def_id: def_id,
+                        def_id,
                         substs: Substs::identity_for_item(tcx, def_id)
                     }, items));
                     generics
@@ -1441,7 +1441,7 @@ fn predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     for param in early_bound_lifetimes_from_generics(tcx, ast_generics) {
         let region = tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion {
             def_id: tcx.hir.local_def_id(param.lifetime.id),
-            index: index,
+            index,
             name: param.lifetime.name
         }));
         index += 1;
@@ -1560,7 +1560,7 @@ fn predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
     ty::GenericPredicates {
         parent: generics.parent,
-        predicates: predicates
+        predicates,
     }
 }
 
@@ -1611,10 +1611,10 @@ pub fn compute_bounds<'gcx: 'tcx, 'tcx>(astconv: &AstConv<'gcx, 'tcx>,
     };
 
     Bounds {
-        region_bounds: region_bounds,
-        implicitly_sized: implicitly_sized,
-        trait_bounds: trait_bounds,
-        projection_bounds: projection_bounds,
+        region_bounds,
+        implicitly_sized,
+        trait_bounds,
+        projection_bounds,
     }
 }
 
index 37cb1f9280b61ea0c6858262c750092f1b77bffc..09c7487e635601924d223763cc3ab9dd3dd0615d 100644 (file)
@@ -48,7 +48,7 @@ pub fn parameters_for<'tcx, T>(t: &T,
 
     let mut collector = ParameterCollector {
         parameters: vec![],
-        include_nonconstraining: include_nonconstraining
+        include_nonconstraining,
     };
     t.visit_with(&mut collector);
     collector.parameters
index 4b0db749964ca6946ab8d22db359d028f2d553fd..40474a7933f80b701dcf68a27e68f2fe16f32028 100644 (file)
@@ -73,11 +73,11 @@ pub fn add_constraints_from_crate<'a, 'tcx>(terms_cx: TermsContext<'a, 'tcx>)
     let invariant = terms_cx.arena.alloc(ConstantTerm(ty::Invariant));
     let bivariant = terms_cx.arena.alloc(ConstantTerm(ty::Bivariant));
     let mut constraint_cx = ConstraintContext {
-        terms_cx: terms_cx,
-        covariant: covariant,
-        contravariant: contravariant,
-        invariant: invariant,
-        bivariant: bivariant,
+        terms_cx,
+        covariant,
+        contravariant,
+        invariant,
+        bivariant,
         constraints: Vec::new(),
         dependencies: TransitiveRelation::new(),
     };
@@ -213,7 +213,7 @@ fn add_constraint(&mut self,
         debug!("add_constraint(index={}, variance={:?})", index, variance);
         self.constraints.push(Constraint {
             inferred: InferredIndex(current.inferred_start.0 + index as usize),
-            variance: variance,
+            variance,
         });
     }
 
index 38457146a9714deebfa958aafa42959bed515e39..c624b11c5eca26179a0c1b8a3740fe1b890d8259 100644 (file)
@@ -79,8 +79,8 @@ pub fn determine_parameters_to_be_inferred<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>
                                                      arena: &'a mut TypedArena<VarianceTerm<'a>>)
                                                      -> TermsContext<'a, 'tcx> {
     let mut terms_cx = TermsContext {
-        tcx: tcx,
-        arena: arena,
+        tcx,
+        arena,
         inferred_starts: NodeMap(),
         inferred_terms: vec![],
 
index 9b4c4e479d046e17813a291b5bc33139a57c060a..5d39d1d27f4c321ee47ecc380cbffc2a828efe13 100644 (file)
@@ -102,7 +102,7 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name)
         source: cx.tcx.def_span(did).clean(cx),
         name: Some(name.clean(cx)),
         attrs: load_attrs(cx, did),
-        inner: inner,
+        inner,
         visibility: Some(clean::Public),
         stability: cx.tcx.lookup_stability(did).clean(cx),
         deprecation: cx.tcx.lookup_deprecation(did).clean(cx),
@@ -142,7 +142,7 @@ pub fn build_external_trait(cx: &DocContext, did: DefId) -> clean::Trait {
     let (generics, supertrait_bounds) = separate_supertrait_bounds(generics);
     clean::Trait {
         unsafety: cx.tcx.trait_def(did).unsafety,
-        generics: generics,
+        generics,
         items: trait_items,
         bounds: supertrait_bounds,
     }
@@ -162,7 +162,7 @@ fn build_external_function(cx: &DocContext, did: DefId) -> clean::Function {
         decl: (did, sig).clean(cx),
         generics: (cx.tcx.generics_of(did), &predicates).clean(cx),
         unsafety: sig.unsafety(),
-        constness: constness,
+        constness,
         abi: sig.abi(),
     }
 }
@@ -302,7 +302,7 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
             }),
             source: tcx.def_span(did).clean(cx),
             name: None,
-            attrs: attrs,
+            attrs,
             visibility: Some(clean::Inherited),
             stability: tcx.lookup_stability(did).clean(cx),
             deprecation: tcx.lookup_deprecation(did).clean(cx),
@@ -359,11 +359,11 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
                         };
 
                         clean::MethodItem(clean::Method {
-                            unsafety: unsafety,
-                            constness: constness,
-                            decl: decl,
-                            generics: generics,
-                            abi: abi
+                            unsafety,
+                            constness,
+                            decl,
+                            generics,
+                            abi,
                         })
                     }
                     ref r => panic!("not a tymethod: {:?}", r),
@@ -414,15 +414,15 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
         inner: clean::ImplItem(clean::Impl {
             unsafety: hir::Unsafety::Normal, // FIXME: this should be decoded
             provided_trait_methods: provided,
-            trait_: trait_,
-            for_: for_,
+            trait_,
+            for_,
             generics: (tcx.generics_of(did), &predicates).clean(cx),
             items: trait_items,
             polarity: Some(polarity.clean(cx)),
         }),
         source: tcx.def_span(did).clean(cx),
         name: None,
-        attrs: attrs,
+        attrs,
         visibility: Some(clean::Inherited),
         stability: tcx.lookup_stability(did).clean(cx),
         deprecation: tcx.lookup_deprecation(did).clean(cx),
@@ -434,7 +434,7 @@ fn build_module(cx: &DocContext, did: DefId) -> clean::Module {
     let mut items = Vec::new();
     fill_in(cx, did, &mut items);
     return clean::Module {
-        items: items,
+        items,
         is_crate: false,
     };
 
index 57e72c3a40bf520bd641ccea0d8cb4a9741eb633..f4aef8ab377c01f53d2421b4e61769386d730368 100644 (file)
@@ -156,7 +156,7 @@ fn clean(&self, cx: &DocContext) -> Crate {
                     visibility: Some(Public),
                     stability: get_stability(cx, def_id),
                     deprecation: get_deprecation(cx, def_id),
-                    def_id: def_id,
+                    def_id,
                     inner: PrimitiveItem(prim),
                 }
             }));
@@ -166,11 +166,11 @@ fn clean(&self, cx: &DocContext) -> Crate {
         let mut external_traits = cx.external_traits.borrow_mut();
 
         Crate {
-            name: name,
-            src: src,
+            name,
+            src,
             module: Some(module),
-            externs: externs,
-            primitives: primitives,
+            externs,
+            primitives,
             access_levels: Arc::new(mem::replace(&mut access_levels, Default::default())),
             external_traits: mem::replace(&mut external_traits, Default::default()),
         }
@@ -252,7 +252,7 @@ fn clean(&self, cx: &DocContext) -> ExternalCrate {
             name: cx.tcx.crate_name(*self).to_string(),
             src: PathBuf::from(krate_src),
             attrs: cx.tcx.get_attrs(root).clean(cx),
-            primitives: primitives,
+            primitives,
         }
     }
 }
@@ -474,7 +474,7 @@ fn clean(&self, cx: &DocContext) -> Item {
             def_id: cx.tcx.hir.local_def_id(self.id),
             inner: ModuleItem(Module {
                is_crate: self.is_crate,
-               items: items
+               items,
             })
         }
     }
@@ -519,7 +519,7 @@ fn lists<'a>(&'a self, name: &'a str) -> ListAttributesIter<'a> {
         ListAttributesIter {
             attrs: self.iter(),
             current_list: Vec::new().into_iter(),
-            name: name
+            name,
         }
     }
 }
@@ -673,9 +673,9 @@ fn maybe_sized(cx: &DocContext) -> TyParamBound {
         inline::record_extern_fqn(cx, did, TypeKind::Trait);
         TraitBound(PolyTrait {
             trait_: ResolvedPath {
-                path: path,
+                path,
                 typarams: None,
-                did: did,
+                did,
                 is_generic: false,
             },
             lifetimes: vec![]
@@ -715,9 +715,9 @@ fn external_path_params(cx: &DocContext, trait_did: Option<DefId>, has_self: boo
                 ty::TyTuple(ref tys, _) => tys.iter().map(|t| t.clean(cx)).collect(),
                 _ => {
                     return PathParameters::AngleBracketed {
-                        lifetimes: lifetimes,
+                        lifetimes,
                         types: types.clean(cx),
-                        bindings: bindings
+                        bindings,
                     }
                 }
             };
@@ -728,15 +728,15 @@ fn external_path_params(cx: &DocContext, trait_did: Option<DefId>, has_self: boo
             //     _ => Some(types[1].clean(cx))
             // };
             PathParameters::Parenthesized {
-                inputs: inputs,
-                output: output
+                inputs,
+                output,
             }
         },
         _ => {
             PathParameters::AngleBracketed {
-                lifetimes: lifetimes,
+                lifetimes,
                 types: types.clean(cx),
-                bindings: bindings
+                bindings,
             }
         }
     }
@@ -784,7 +784,7 @@ fn clean(&self, cx: &DocContext) -> TyParamBound {
         TraitBound(
             PolyTrait {
                 trait_: ResolvedPath {
-                    path: path,
+                    path,
                     typarams: None,
                     did: self.def_id,
                     is_generic: false,
@@ -1181,7 +1181,7 @@ fn clean(&self, cx: &DocContext) -> Arguments {
                     name = "_".to_string();
                 }
                 Argument {
-                    name: name,
+                    name,
                     type_: ty.clean(cx),
                 }
             }).collect()
@@ -1359,7 +1359,7 @@ fn clean(&self, cx: &DocContext) -> Item {
             visibility: None,
             stability: get_stability(cx, cx.tcx.hir.local_def_id(self.id)),
             deprecation: get_deprecation(cx, cx.tcx.hir.local_def_id(self.id)),
-            inner: inner
+            inner,
         }
     }
 }
@@ -1391,7 +1391,7 @@ fn clean(&self, cx: &DocContext) -> Item {
             visibility: self.vis.clean(cx),
             stability: get_stability(cx, cx.tcx.hir.local_def_id(self.id)),
             deprecation: get_deprecation(cx, cx.tcx.hir.local_def_id(self.id)),
-            inner: inner
+            inner,
         }
     }
 }
@@ -1438,8 +1438,8 @@ fn clean(&self, cx: &DocContext) -> Item {
                 if provided {
                     MethodItem(Method {
                         unsafety: sig.unsafety(),
-                        generics: generics,
-                        decl: decl,
+                        generics,
+                        decl,
                         abi: sig.abi(),
 
                         // trait methods cannot (currently, at least) be const
@@ -1448,8 +1448,8 @@ fn clean(&self, cx: &DocContext) -> Item {
                 } else {
                     TyMethodItem(TyMethod {
                         unsafety: sig.unsafety(),
-                        generics: generics,
-                        decl: decl,
+                        generics,
+                        decl,
                         abi: sig.abi(),
                     })
                 }
@@ -1515,7 +1515,7 @@ fn clean(&self, cx: &DocContext) -> Item {
             def_id: self.def_id,
             attrs: inline::load_attrs(cx, self.def_id),
             source: cx.tcx.def_span(self.def_id).clean(cx),
-            inner: inner,
+            inner,
         }
     }
 }
@@ -1835,7 +1835,7 @@ fn clean(&self, cx: &DocContext) -> Type {
                 }
                 let trait_path = hir::Path {
                     span: self.span,
-                    def: def,
+                    def,
                     segments: vec![].into(),
                 };
                 Type::QPath {
@@ -1854,10 +1854,10 @@ fn clean(&self, cx: &DocContext) -> Type {
                             bounds.push(RegionBound(lifetime.clean(cx)));
                         }
                         ResolvedPath {
-                            path: path,
+                            path,
                             typarams: Some(bounds),
-                            did: did,
-                            is_generic: is_generic,
+                            did,
+                            is_generic,
                         }
                     }
                     _ => Infer // shouldn't happen
@@ -1915,9 +1915,9 @@ fn clean(&self, cx: &DocContext) -> Type {
                 let path = external_path(cx, &cx.tcx.item_name(did).as_str(),
                                          None, false, vec![], substs);
                 ResolvedPath {
-                    path: path,
+                    path,
                     typarams: None,
-                    did: did,
+                    did,
                     is_generic: false,
                 }
             }
@@ -1935,9 +1935,9 @@ fn clean(&self, cx: &DocContext) -> Type {
                         inline::record_extern_fqn(cx, did, TypeKind::Trait);
                         let bound = TraitBound(PolyTrait {
                             trait_: ResolvedPath {
-                                path: path,
+                                path,
                                 typarams: None,
-                                did: did,
+                                did,
                                 is_generic: false,
                             },
                             lifetimes: vec![]
@@ -1956,9 +1956,9 @@ fn clean(&self, cx: &DocContext) -> Type {
                     let path = external_path(cx, &cx.tcx.item_name(did).as_str(), Some(did),
                         false, bindings, principal.0.substs);
                     ResolvedPath {
-                        path: path,
+                        path,
                         typarams: Some(typarams),
-                        did: did,
+                        did,
                         is_generic: false,
                     }
                 } else {
@@ -2274,7 +2274,7 @@ pub fn singleton(name: String) -> Path {
             global: false,
             def: Def::Err,
             segments: vec![PathSegment {
-                name: name,
+                name,
                 params: PathParameters::AngleBracketed {
                     lifetimes: Vec::new(),
                     types: Vec::new(),
@@ -2549,9 +2549,9 @@ fn clean(&self, cx: &DocContext) -> Vec<Item> {
                 unsafety: self.unsafety,
                 generics: self.generics.clean(cx),
                 provided_trait_methods: provided,
-                trait_: trait_,
+                trait_,
                 for_: self.for_.clean(cx),
-                items: items,
+                items,
                 polarity: Some(self.polarity.clean(cx)),
             }),
         });
@@ -2745,7 +2745,7 @@ fn clean(&self, cx: &DocContext) -> Item {
             visibility: self.vis.clean(cx),
             stability: get_stability(cx, cx.tcx.hir.local_def_id(self.id)),
             deprecation: get_deprecation(cx, cx.tcx.hir.local_def_id(self.id)),
-            inner: inner,
+            inner,
         }
     }
 }
@@ -2871,7 +2871,7 @@ fn resolve_use_source(cx: &DocContext, path: Path) -> ImportSource {
         } else {
             Some(register_def(cx, path.def))
         },
-        path: path,
+        path,
     }
 }
 
index 9bb7e4e3a09d51e859b5fd7a2a0bc170be71503b..58de0e1caecdbe0d563ade8bed6a4226f214e3e5 100644 (file)
@@ -121,18 +121,18 @@ pub fn run_core(search_paths: SearchPaths,
     let warning_lint = lint::builtin::WARNINGS.name_lower();
 
     let sessopts = config::Options {
-        maybe_sysroot: maybe_sysroot,
-        search_paths: search_paths,
+        maybe_sysroot,
+        search_paths,
         crate_types: vec![config::CrateTypeRlib],
         lint_opts: if !allow_warnings { vec![(warning_lint, lint::Allow)] } else { vec![] },
         lint_cap: Some(lint::Allow),
-        externs: externs,
+        externs,
         target_triple: triple.unwrap_or(config::host_triple().to_string()),
         // Ensure that rustdoc works even if rustc is feature-staged
         unstable_features: UnstableFeatures::Allow,
         actually_rustdoc: true,
         debugging_opts: config::DebuggingOptions {
-            force_unstable_if_unmarked: force_unstable_if_unmarked,
+            force_unstable_if_unmarked,
             ..config::basic_debugging_options()
         },
         ..config::basic_options().clone()
@@ -203,7 +203,7 @@ pub fn run_core(search_paths: SearchPaths,
         };
 
         let ctxt = DocContext {
-            tcx: tcx,
+            tcx,
             populated_all_crate_impls: Cell::new(false),
             access_levels: RefCell::new(access_levels),
             external_traits: Default::default(),
index e269d940bfabf8a79931f0b4a8869ca88f654da1..54c57c9ac6eebf727d2b0885a83642f56471aa31 100644 (file)
@@ -97,9 +97,8 @@ fn fold_item_recur(&mut self, item: Item) -> Option<Item> {
             _ => self.fold_inner_recur(inner),
         };
 
-        Some(Item { attrs: attrs, name: name, source: source, inner: inner,
-                    visibility: visibility, stability: stability, deprecation: deprecation,
-                    def_id: def_id })
+        Some(Item { attrs, name, source, inner, visibility,
+                    stability, deprecation, def_id })
     }
 
     fn fold_mod(&mut self, m: Module) -> Module {
index 89a40b0db9662f76bf34b23368fd4f6b72bba0af..dfbf435d74a51e2ab19c86ab2597cc08f6871e36 100644 (file)
@@ -164,8 +164,8 @@ fn exit_span(&mut self) -> io::Result<()> {
 impl<'a> Classifier<'a> {
     pub fn new(lexer: lexer::StringReader<'a>, codemap: &'a CodeMap) -> Classifier<'a> {
         Classifier {
-            lexer: lexer,
-            codemap: codemap,
+            lexer,
+            codemap,
             in_attribute: false,
             in_macro: false,
             in_macro_nonterminal: false,
index 82c252ae4d72675eb273b3478f84f89a49b28bb2..2d14c02bf8a592ad95f3ae3eff1140fa3e8a2cd3 100644 (file)
@@ -241,7 +241,7 @@ impl<'a, 'b, I: Iterator<Item = Event<'a>>> HeadingLinks<'a, 'b, I> {
     fn new(iter: I, toc: Option<&'b mut TocBuilder>) -> Self {
         HeadingLinks {
             inner: iter,
-            toc: toc,
+            toc,
             buf: VecDeque::new(),
         }
     }
@@ -1121,15 +1121,15 @@ fn t(s: &str,
             should_panic: bool, no_run: bool, ignore: bool, rust: bool, test_harness: bool,
             compile_fail: bool, allow_fail: bool, error_codes: Vec<String>) {
             assert_eq!(LangString::parse(s), LangString {
-                should_panic: should_panic,
-                no_run: no_run,
-                ignore: ignore,
-                rust: rust,
-                test_harness: test_harness,
-                compile_fail: compile_fail,
-                error_codes: error_codes,
+                should_panic,
+                no_run,
+                ignore,
+                rust,
+                test_harness,
+                compile_fail,
+                error_codes,
                 original: s.to_owned(),
-                allow_fail: allow_fail,
+                allow_fail,
             })
         }
 
index 4e3181759f999aafb26458776c5bebcf25bc0b2f..6593d6dfd6cff7ff105ff7cf425b5bd0b9bc725a 100644 (file)
@@ -443,8 +443,8 @@ pub fn run(mut krate: clean::Crate,
         None => PathBuf::new(),
     };
     let mut scx = SharedContext {
-        src_root: src_root,
-        passes: passes,
+        src_root,
+        passes,
         include_sources: true,
         local_sources: FxHashMap(),
         issue_tracker_base_url: None,
@@ -496,10 +496,10 @@ pub fn run(mut krate: clean::Crate,
     krate = render_sources(&dst, &mut scx, krate)?;
     let cx = Context {
         current: Vec::new(),
-        dst: dst,
+        dst,
         render_redirect_pages: false,
         shared: Arc::new(scx),
-        render_type: render_type,
+        render_type,
     };
 
     // Crawl the crate to build various caches used for the output
@@ -518,7 +518,7 @@ pub fn run(mut krate: clean::Crate,
 
     let mut cache = Cache {
         impls: FxHashMap(),
-        external_paths: external_paths,
+        external_paths,
         paths: FxHashMap(),
         implementors: FxHashMap(),
         stack: Vec::new(),
@@ -531,9 +531,9 @@ pub fn run(mut krate: clean::Crate,
         access_levels: krate.access_levels.clone(),
         orphan_impl_items: Vec::new(),
         traits: mem::replace(&mut krate.external_traits, FxHashMap()),
-        deref_trait_did: deref_trait_did,
-        deref_mut_trait_did: deref_mut_trait_did,
-        owned_box_did: owned_box_did,
+        deref_trait_did,
+        deref_mut_trait_did,
+        owned_box_did,
         typarams: external_typarams,
     };
 
@@ -823,8 +823,8 @@ fn render_sources(dst: &Path, scx: &mut SharedContext,
     let dst = dst.join("src").join(&krate.name);
     try_err!(fs::create_dir_all(&dst), &dst);
     let mut folder = SourceCollector {
-        dst: dst,
-        scx: scx,
+        dst,
+        scx,
     };
     Ok(folder.fold_crate(krate))
 }
@@ -1068,7 +1068,7 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
                             name: s.to_string(),
                             path: path.join("::").to_string(),
                             desc: plain_summary_line(item.doc_value()),
-                            parent: parent,
+                            parent,
                             parent_idx: None,
                             search_type: get_index_search_type(&item),
                         });
@@ -2038,7 +2038,7 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
            where_clause = WhereClause { gens: &f.generics, indent: 0, end_newline: true },
            decl = Method {
                decl: &f.decl,
-               name_len: name_len,
+               name_len,
                indent: 0,
            })?;
     document(w, cx, it)
@@ -2406,12 +2406,12 @@ fn method(w: &mut fmt::Formatter,
                decl = Method {
                    decl: d,
                    name_len: head_len,
-                   indent: indent,
+                   indent,
                },
                where_clause = WhereClause {
                    gens: g,
-                   indent: indent,
-                   end_newline: end_newline,
+                   indent,
+                   end_newline,
                })
     }
     match item.inner {
index 8ec9cd8660a80dfa9656f8ba83183f99db76a61c..fc5977f533cbbc263ddf854cca108b05593209ac 100644 (file)
             }
 
             return {
-                raw: raw,
-                query: query,
-                type: type,
+                raw,
+                query,
+                type,
                 id: query + type
             };
         }
 
                 searchWords.push(crate);
                 searchIndex.push({
-                    crate: crate,
+                    crate,
                     ty: 1, // == ExternCrate
                     name: crate,
                     path: "",
index a7da1c5cca48ce04f0b34976a9b34b299759da31..67f371313d0d63214ca9989c2dde596646f3a1d7 100644 (file)
@@ -161,10 +161,10 @@ pub fn push<'a>(&'a mut self, level: u32, name: String, id: String) -> &'a str {
         }
 
         self.chain.push(TocEntry {
-            level: level,
-            name: name,
-            sec_number: sec_number,
-            id: id,
+            level,
+            name,
+            sec_number,
+            id,
             children: Toc { entries: Vec::new() }
         });
 
index a38ef2b2518ed2e3f56bee7d5a43048f67098864..4fc5159588d86f7512c4fb75fd77b403c0afbace 100644 (file)
@@ -35,7 +35,7 @@ pub fn new(prefix: PathBuf) -> PluginManager {
         PluginManager {
             dylibs: Vec::new(),
             callbacks: Vec::new(),
-            prefix: prefix,
+            prefix,
         }
     }
 
index b1fb343b8bb9c5cddb8daa3d31914b4d3ecdf917..47e8d63f80aa0f08be6734929157aa993baa340e 100644 (file)
@@ -194,7 +194,7 @@ fn run_test(test: &str, cratename: &str, filename: &str, cfgs: Vec<String>, libs
         search_paths: libs,
         crate_types: vec![config::CrateTypeExecutable],
         output_types: outputs,
-        externs: externs,
+        externs,
         cg: config::CodegenOptions {
             prefer_dynamic: true,
             .. config::basic_codegen_options()
@@ -416,19 +416,19 @@ pub fn new(cratename: String, cfgs: Vec<String>, libs: SearchPaths, externs: Ext
             tests: Vec::new(),
             old_tests: HashMap::new(),
             names: Vec::new(),
-            cfgs: cfgs,
-            libs: libs,
-            externs: externs,
+            cfgs,
+            libs,
+            externs,
             cnt: 0,
-            use_headers: use_headers,
+            use_headers,
             current_header: None,
-            cratename: cratename,
-            opts: opts,
-            maybe_sysroot: maybe_sysroot,
+            cratename,
+            opts,
+            maybe_sysroot,
             position: DUMMY_SP,
-            codemap: codemap,
-            filename: filename,
-            render_type: render_type,
+            codemap,
+            filename,
+            render_type,
         }
     }
 
@@ -499,7 +499,7 @@ pub fn add_test(&mut self, test: String,
                 ignore: should_ignore,
                 // compiler failures are test failures
                 should_panic: testing::ShouldPanic::No,
-                allow_fail: allow_fail,
+                allow_fail,
             },
             testfn: testing::DynTestFn(box move |()| {
                 let panic = io::set_panic(None);
index 657aab958bb90dd1c81749f4af05557eb8afade8..e3426fba1bca18426e8aa8fd1e9bbb34216bedee 100644 (file)
@@ -58,7 +58,7 @@ pub fn new(cx: &'a core::DocContext<'a, 'tcx>) -> RustdocVisitor<'a, 'tcx> {
         RustdocVisitor {
             module: Module::new(None),
             attrs: hir::HirVec::new(),
-            cx: cx,
+            cx,
             view_item_stack: stack,
             inlining: false,
             inside_public_path: true,
@@ -99,8 +99,8 @@ pub fn visit_variant_data(&mut self, item: &hir::Item,
         let struct_type = struct_type_from_def(&*sd);
         Struct {
             id: item.id,
-            struct_type: struct_type,
-            name: name,
+            struct_type,
+            name,
             vis: item.vis.clone(),
             stab: self.stability(item.id),
             depr: self.deprecation(item.id),
@@ -118,8 +118,8 @@ pub fn visit_union_data(&mut self, item: &hir::Item,
         let struct_type = struct_type_from_def(&*sd);
         Union {
             id: item.id,
-            struct_type: struct_type,
-            name: name,
+            struct_type,
+            name,
             vis: item.vis.clone(),
             stab: self.stability(item.id),
             depr: self.deprecation(item.id),
@@ -135,7 +135,7 @@ pub fn visit_enum_def(&mut self, it: &hir::Item,
                           params: &hir::Generics) -> Enum {
         debug!("Visiting enum");
         Enum {
-            name: name,
+            name,
             variants: def.variants.iter().map(|v| Variant {
                 name: v.node.name,
                 attrs: v.node.attrs.clone(),
@@ -169,13 +169,13 @@ pub fn visit_fn(&mut self, item: &hir::Item,
             depr: self.deprecation(item.id),
             attrs: item.attrs.clone(),
             decl: fd.clone(),
-            name: name,
+            name,
             whence: item.span,
             generics: gen.clone(),
             unsafety: *unsafety,
-            constness: constness,
+            constness,
             abi: *abi,
-            body: body,
+            body,
         }
     }
 
@@ -221,11 +221,11 @@ pub fn visit_mod_contents(&mut self, span: Span, attrs: hir::HirVec<ast::Attribu
                     };
 
                     om.macros.push(Macro {
-                        def_id: def_id,
+                        def_id,
                         attrs: def.attrs.clone().into(),
                         name: def.ident.name,
                         whence: def.span,
-                        matchers: matchers,
+                        matchers,
                         stab: self.stability(def.id),
                         depr: self.deprecation(def.id),
                         imported_from: Some(imported_from),
@@ -374,7 +374,7 @@ pub fn visit_item(&mut self, item: &hir::Item,
                 om.extern_crates.push(ExternCrate {
                     cnum: cstore.extern_mod_stmt_cnum(item.id)
                                 .unwrap_or(LOCAL_CRATE),
-                    name: name,
+                    name,
                     path: p.map(|x|x.to_string()),
                     vis: item.vis.clone(),
                     attrs: item.attrs.clone(),
@@ -408,7 +408,7 @@ pub fn visit_item(&mut self, item: &hir::Item,
                 }
 
                 om.imports.push(Import {
-                    name: name,
+                    name,
                     id: item.id,
                     vis: item.vis.clone(),
                     attrs: item.attrs.clone(),
@@ -438,7 +438,7 @@ pub fn visit_item(&mut self, item: &hir::Item,
                 let t = Typedef {
                     ty: ty.clone(),
                     gen: gen.clone(),
-                    name: name,
+                    name,
                     id: item.id,
                     attrs: item.attrs.clone(),
                     whence: item.span,
@@ -454,7 +454,7 @@ pub fn visit_item(&mut self, item: &hir::Item,
                     mutability: mut_.clone(),
                     expr: exp.clone(),
                     id: item.id,
-                    name: name,
+                    name,
                     attrs: item.attrs.clone(),
                     whence: item.span,
                     vis: item.vis.clone(),
@@ -468,7 +468,7 @@ pub fn visit_item(&mut self, item: &hir::Item,
                     type_: ty.clone(),
                     expr: exp.clone(),
                     id: item.id,
-                    name: name,
+                    name,
                     attrs: item.attrs.clone(),
                     whence: item.span,
                     vis: item.vis.clone(),
@@ -482,9 +482,9 @@ pub fn visit_item(&mut self, item: &hir::Item,
                                     .map(|ti| self.cx.tcx.hir.trait_item(ti.id).clone())
                                     .collect();
                 let t = Trait {
-                    unsafety: unsafety,
-                    name: name,
-                    items: items,
+                    unsafety,
+                    name,
+                    items,
                     generics: gen.clone(),
                     bounds: b.iter().cloned().collect(),
                     id: item.id,
@@ -511,13 +511,13 @@ pub fn visit_item(&mut self, item: &hir::Item,
                                         .map(|ii| self.cx.tcx.hir.impl_item(ii.id).clone())
                                         .collect();
                     let i = Impl {
-                        unsafety: unsafety,
-                        polarity: polarity,
-                        defaultness: defaultness,
+                        unsafety,
+                        polarity,
+                        defaultness,
                         generics: gen.clone(),
                         trait_: tr.clone(),
                         for_: ty.clone(),
-                        items: items,
+                        items,
                         attrs: item.attrs.clone(),
                         id: item.id,
                         whence: item.span,
@@ -532,7 +532,7 @@ pub fn visit_item(&mut self, item: &hir::Item,
                 // See comment above about ItemImpl.
                 if !self.inlining {
                     let i = DefaultImpl {
-                        unsafety: unsafety,
+                        unsafety,
                         trait_: trait_ref.clone(),
                         id: item.id,
                         attrs: item.attrs.clone(),
@@ -555,7 +555,7 @@ fn visit_local_macro(&self, def: &hir::MacroDef) -> Macro {
             attrs: def.attrs.clone(),
             name: def.name,
             whence: def.span,
-            matchers: matchers,
+            matchers,
             stab: self.stability(def.id),
             depr: self.deprecation(def.id),
             imported_from: None,
index 5518d854348cda0c932101997ca171d6ecf4de88..7b5b27c5565cb3e456416471e12c41a26e617c66 100644 (file)
@@ -37,7 +37,7 @@ pub struct LibEmbargoVisitor<'a, 'b: 'a, 'tcx: 'b> {
 impl<'a, 'b, 'tcx> LibEmbargoVisitor<'a, 'b, 'tcx> {
     pub fn new(cx: &'a ::core::DocContext<'b, 'tcx>) -> LibEmbargoVisitor<'a, 'b, 'tcx> {
         LibEmbargoVisitor {
-            cx: cx,
+            cx,
             cstore: &*cx.sess().cstore,
             access_levels: cx.access_levels.borrow_mut(),
             prev_level: Some(AccessLevel::Public),
index dae0b5f01238b0525408faa45c4f14edfba22919..5e1c09641e183f14ceafd1d681155e4fc52c886f 100644 (file)
@@ -717,7 +717,7 @@ impl<'a> PrettyEncoder<'a> {
     /// Creates a new encoder whose output will be written to the specified writer
     pub fn new(writer: &'a mut fmt::Write) -> PrettyEncoder<'a> {
         PrettyEncoder {
-            writer: writer,
+            writer,
             curr_indent: 0,
             indent: 2,
             is_emitting_map_key: false,
@@ -1451,7 +1451,7 @@ impl<T: Iterator<Item=char>> Parser<T> {
     /// Creates the JSON parser.
     pub fn new(rdr: T) -> Parser<T> {
         let mut p = Parser {
-            rdr: rdr,
+            rdr,
             ch: Some('\x00'),
             line: 1,
             col: 0,
index 9c3db64d4d8639a66f3f4ceebdde0e710aec531e..f3475bd18ce693e88f1fccd8dfa063692a5670a7 100644 (file)
@@ -153,8 +153,8 @@ pub struct Decoder<'a> {
 impl<'a> Decoder<'a> {
     pub fn new(data: &'a [u8], position: usize) -> Decoder<'a> {
         Decoder {
-            data: data,
-            position: position,
+            data,
+            position,
         }
     }
 
index 7e2229a8f84a3bb014f169112c02eb40901c7e52..16b0c709986162dba88d59583067266a5042e156 100644 (file)
@@ -419,7 +419,7 @@ fn search_hashed<K, V, M, F>(table: M, hash: SafeHash, mut is_match: F) -> Inter
             Empty(bucket) => {
                 // Found a hole!
                 return InternalEntry::Vacant {
-                    hash: hash,
+                    hash,
                     elem: NoElem(bucket, displacement),
                 };
             }
@@ -433,7 +433,7 @@ fn search_hashed<K, V, M, F>(table: M, hash: SafeHash, mut is_match: F) -> Inter
             // We can finish the search early if we hit any bucket
             // with a lower distance to initial bucket than we've probed.
             return InternalEntry::Vacant {
-                hash: hash,
+                hash,
                 elem: NeqElem(full, probe_displacement),
             };
         }
@@ -646,7 +646,7 @@ impl<K, V, S> HashMap<K, V, S>
     #[stable(feature = "hashmap_build_hasher", since = "1.7.0")]
     pub fn with_hasher(hash_builder: S) -> HashMap<K, V, S> {
         HashMap {
-            hash_builder: hash_builder,
+            hash_builder,
             resize_policy: DefaultResizePolicy::new(),
             table: RawTable::new(0),
         }
@@ -679,8 +679,8 @@ pub fn with_capacity_and_hasher(capacity: usize, hash_builder: S) -> HashMap<K,
         let resize_policy = DefaultResizePolicy::new();
         let raw_cap = resize_policy.raw_capacity(capacity);
         HashMap {
-            hash_builder: hash_builder,
-            resize_policy: resize_policy,
+            hash_builder,
+            resize_policy,
             table: RawTable::new(raw_cap),
         }
     }
@@ -1496,14 +1496,14 @@ fn into_entry(self, key: K) -> Option<Entry<'a, K, V>> {
             InternalEntry::Occupied { elem } => {
                 Some(Occupied(OccupiedEntry {
                     key: Some(key),
-                    elem: elem,
+                    elem,
                 }))
             }
             InternalEntry::Vacant { hash, elem } => {
                 Some(Vacant(VacantEntry {
-                    hash: hash,
-                    key: key,
-                    elem: elem,
+                    hash,
+                    key,
+                    elem,
                 }))
             }
             InternalEntry::TableIsEmpty => None,
index 80a223c7d74eaae6dcf72231c747749c063afe4b..9771363d545cd41083caf0b3785a1dacf53db91f 100644 (file)
@@ -337,7 +337,7 @@ pub fn iter(&self) -> Iter<T> {
     pub fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S> {
         Difference {
             iter: self.iter(),
-            other: other,
+            other,
         }
     }
 
@@ -391,7 +391,7 @@ pub fn symmetric_difference<'a>(&'a self,
     pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S> {
         Intersection {
             iter: self.iter(),
-            other: other,
+            other,
         }
     }
 
index 6f7c5a5de42b37a90f75e70fa629219398bb7594..f1e8ff66af178c405ba326763f9d542dd9ed16b1 100644 (file)
@@ -353,14 +353,14 @@ pub fn at_index(table: M, ib_index: usize) -> Bucket<K, V, M> {
         let ib_index = ib_index & table.capacity_mask;
         Bucket {
             raw: table.raw_bucket_at(ib_index),
-            table: table,
+            table,
         }
     }
 
     pub fn first(table: M) -> Bucket<K, V, M> {
         Bucket {
             raw: table.raw_bucket_at(0),
-            table: table,
+            table,
         }
     }
 
@@ -455,7 +455,7 @@ pub fn gap_peek(self) -> Result<GapThenFull<K, V, M>, Bucket<K, V, M>> {
         match self.next().peek() {
             Full(bucket) => {
                 Ok(GapThenFull {
-                    gap: gap,
+                    gap,
                     full: bucket,
                 })
             }
@@ -860,8 +860,8 @@ pub fn into_iter(self) -> IntoIter<K, V> {
         // Replace the marker regardless of lifetime bounds on parameters.
         IntoIter {
             iter: RawBuckets {
-                raw: raw,
-                elems_left: elems_left,
+                raw,
+                elems_left,
                 marker: marker::PhantomData,
             },
             table: self,
@@ -873,8 +873,8 @@ pub fn drain(&mut self) -> Drain<K, V> {
         // Replace the marker regardless of lifetime bounds on parameters.
         Drain {
             iter: RawBuckets {
-                raw: raw,
-                elems_left: elems_left,
+                raw,
+                elems_left,
                 marker: marker::PhantomData,
             },
             table: Shared::from(self),
index d765dd227be695b4cccaa96a466fb5668b0200ed..4ebd3554fd1428fc60f2854d7e1bc709fac70382 100644 (file)
@@ -97,7 +97,7 @@ pub fn with_capacity(cap: usize, inner: R) -> BufReader<R> {
             buffer.set_len(cap);
             inner.initializer().initialize(&mut buffer);
             BufReader {
-                inner: inner,
+                inner,
                 buf: buffer.into_boxed_slice(),
                 pos: 0,
                 cap: 0,
index 68f55221a6c985f1fb7ee84718afcd9e9d97c52b..bb9383d3d6e02cb668740581d6c66393a8f6a6d6 100644 (file)
@@ -252,8 +252,8 @@ pub fn new<E>(kind: ErrorKind, error: E) -> Error
     fn _new(kind: ErrorKind, error: Box<error::Error+Send+Sync>) -> Error {
         Error {
             repr: Repr::Custom(Box::new(Custom {
-                kind: kind,
-                error: error,
+                kind,
+                error,
             }))
         }
     }
index ce205c3b11ca5ee14542e5c208189320152d20c1..9cef4e3cdf1ca971ae80f4cb83ef6b00533fe3f3 100644 (file)
@@ -27,7 +27,7 @@ pub const fn new(init: fn() -> Arc<T>) -> Lazy<T> {
         Lazy {
             lock: Mutex::new(),
             ptr: Cell::new(ptr::null_mut()),
-            init: init
+            init,
         }
     }
 
index 99567bd08bbf49c894285634abeee5ba511a2bed..739dc4163feb381b175fe1bc6641f3afe18275bd 100644 (file)
@@ -453,7 +453,7 @@ union Data<F, R> {
     let mut any_data = 0;
     let mut any_vtable = 0;
     let mut data = Data {
-        f: f,
+        f,
     };
 
     let r = __rust_maybe_catch_panic(do_call::<F, R>,
index c90a0c7852737b70066528c617ed707d83bd0df3..4496de09b259097a9b15b72cdb97e20dbeed9cee 100644 (file)
@@ -2049,7 +2049,7 @@ pub fn components(&self) -> Components {
         let prefix = parse_prefix(self.as_os_str());
         Components {
             path: self.as_u8_slice(),
-            prefix: prefix,
+            prefix,
             has_physical_root: has_physical_root(self.as_u8_slice(), prefix),
             front: State::Prefix,
             back: State::Body,
index a872e7eee0609b617caf9ce5dd2b6cf524792714..a3a7e91dd807d61c9fe43528e9a951981232d877 100644 (file)
@@ -126,7 +126,7 @@ fn as_inner(&self) -> &imp::Process { &self.handle }
 impl FromInner<(imp::Process, imp::StdioPipes)> for Child {
     fn from_inner((handle, io): (imp::Process, imp::StdioPipes)) -> Child {
         Child {
-            handle: handle,
+            handle,
             stdin: io.stdin.map(ChildStdin::from_inner),
             stdout: io.stdout.map(ChildStdout::from_inner),
             stderr: io.stderr.map(ChildStderr::from_inner),
@@ -1035,9 +1035,9 @@ pub fn wait_with_output(mut self) -> io::Result<Output> {
 
         let status = self.wait()?;
         Ok(Output {
-            status: status,
-            stdout: stdout,
-            stderr: stderr,
+            status,
+            stdout,
+            stderr,
         })
     }
 }
index 0f9ef6fabb005eb06f6f5fb307fed95c38b6a300..c08bd6d133d06726fb2f230761b98a80d0090ceb 100644 (file)
@@ -46,7 +46,7 @@ pub fn tokens() -> (WaitToken, SignalToken) {
         inner: inner.clone(),
     };
     let signal_token = SignalToken {
-        inner: inner
+        inner,
     };
     (wait_token, signal_token)
 }
index 8b4da532af6f00cd3df224b888bfefed7baabb31..e49f4cff024034488d44f156be95143366cf5ea3 100644 (file)
@@ -148,12 +148,12 @@ pub fn handle<'a, T: Send>(&'a self, rx: &'a Receiver<T>) -> Handle<'a, T> {
         let id = self.next_id.get();
         self.next_id.set(id + 1);
         Handle {
-            id: id,
+            id,
             selector: self.inner.get(),
             next: ptr::null_mut(),
             prev: ptr::null_mut(),
             added: false,
-            rx: rx,
+            rx,
             packet: rx,
         }
     }
index 1d16e002a2bef460ce2d1cdb16397606e49f035e..90f12c826d68e52417fcf1423e15a9b10b22f7b0 100644 (file)
@@ -177,7 +177,7 @@ pub fn new(cap: usize) -> Packet<T> {
             lock: Mutex::new(State {
                 disconnected: false,
                 blocker: NoneBlocked,
-                cap: cap,
+                cap,
                 canceled: None,
                 queue: Queue {
                     head: ptr::null_mut(),
index 49cde89dc0544f66f2a380342bc74ae54ff46dda..1a26257e4a7e2c6bcf774aa39eaf232c8ad76dbf 100644 (file)
@@ -206,10 +206,10 @@ macro_rules! pop_name {
         }
 
         Ok(Dns {
-            transaction_id: transaction_id,
-            flags: flags,
-            queries: queries,
-            answers: answers,
+            transaction_id,
+            flags,
+            queries,
+            answers,
         })
     }
 }
index cfeabaddda9859fea27aa88a3da3da5d40d7d50d..e3ffbe88acd45c2492d03e9c5eefb339e66efda4 100644 (file)
@@ -43,7 +43,7 @@ pub fn unwind_backtrace(frames: &mut [Frame])
 {
     let mut cx = Context {
         idx: 0,
-        frames: frames,
+        frames,
     };
     let result_unwind = unsafe {
         uw::_Unwind_Backtrace(trace_fn,
index 278534271281fe6996120085ac65c9684e04ee44..f454f1fc47902a543673b7df91e6fe31ebe21507 100644 (file)
@@ -141,8 +141,8 @@ fn from_parts(addr: libc::sockaddr_un, mut len: libc::socklen_t) -> io::Result<S
         }
 
         Ok(SocketAddr {
-            addr: addr,
-            len: len,
+            addr,
+            len,
         })
     }
 
index ab609126cdb544443c957f14fcfb03351b6f0666..bc20a74f11464b7149bc515ed967a1d046fd3169 100644 (file)
@@ -61,7 +61,7 @@ pub struct Handle {
 impl Handle {
     pub fn new(raw: mx_handle_t) -> Handle {
         Handle {
-            raw: raw,
+            raw,
         }
     }
 
index 839e2d88d6a0003cf89fab6251e215bfec7df6f2..689ccd78524a04f7ce12563170742198e0eb7c80 100644 (file)
@@ -94,14 +94,14 @@ pub fn new(program: &OsStr) -> Command {
         let program = os2c(program, &mut saw_nul);
         Command {
             argv: vec![program.as_ptr(), ptr::null()],
-            program: program,
+            program,
             args: Vec::new(),
             env: None,
             envp: None,
             cwd: None,
             uid: None,
             gid: None,
-            saw_nul: saw_nul,
+            saw_nul,
             closures: Vec::new(),
             stdin: None,
             stdout: None,
index 99ab8741159e39075825b1a4e01fab4f2dea9cf1..18944be58ee7e6d3fc0618fd6bc003a140a70d2b 100644 (file)
@@ -49,7 +49,7 @@ pub struct Weak<F> {
 impl<F> Weak<F> {
     pub const fn new(name: &'static str) -> Weak<F> {
         Weak {
-            name: name,
+            name,
             addr: AtomicUsize::new(1),
             _marker: marker::PhantomData,
         }
index 3c3fd8d3e4a9ccca29e159d64fbbbadf3d224509..26b4cb90e0a89c8f16536667eeb6b462d2894023 100644 (file)
@@ -68,8 +68,8 @@ pub fn unwind_backtrace(frames: &mut [Frame])
 
     let backtrace_context = BacktraceContext {
         handle: process,
-        SymCleanup: SymCleanup,
-        dbghelp: dbghelp,
+        SymCleanup,
+        dbghelp,
     };
 
     // Initialize this process's symbols
index be7482c4bb1b01738d412e17d7afc06ca4256e8e..452d720ce59333055bbeb374df16ea38e3d6440f 100644 (file)
@@ -239,10 +239,10 @@ fn new(pipe: Handle, dst: &'a mut Vec<u8>) -> io::Result<AsyncPipe<'a>> {
         };
         overlapped.hEvent = event.raw();
         Ok(AsyncPipe {
-            pipe: pipe,
-            overlapped: overlapped,
-            event: event,
-            dst: dst,
+            pipe,
+            overlapped,
+            event,
+            dst,
             state: State::NotReading,
         })
     }
index ad57f87dc1ff991b68b029c0884862d1c795142a..7ae9ed917bdba7c1d592af77246a2e576ebb6154 100644 (file)
@@ -122,8 +122,8 @@ struct Node {
 
 unsafe fn register_dtor(key: Key, dtor: Dtor) {
     let mut node = Box::new(Node {
-        key: key,
-        dtor: dtor,
+        key,
+        dtor,
         next: ptr::null_mut(),
     });
 
index 2abb8afa82848a5a8db1cddbc8c4c61589b06ba9..7970042b1d67ded6faaccfdebb8e4bc762bfba0e 100644 (file)
@@ -45,7 +45,7 @@ pub fn stack_guard() -> Option<usize> {
 pub fn set(stack_guard: Option<usize>, thread: Thread) {
     THREAD_INFO.with(|c| assert!(c.borrow().is_none()));
     THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{
-        stack_guard: stack_guard,
-        thread: thread,
+        stack_guard,
+        thread,
     }));
 }
index 1f889c7070719760a54874eef338634bd898265b..87ffd304e1a33b0bf2a44ccd602cdfc4e1ad8d1b 100644 (file)
@@ -128,7 +128,7 @@ impl StaticKey {
     pub const fn new(dtor: Option<unsafe extern fn(*mut u8)>) -> StaticKey {
         StaticKey {
             key: atomic::AtomicUsize::new(0),
-            dtor: dtor
+            dtor,
         }
     }
 
index 48f611a343941bb336300c56d0cd463acfffe2ad..7a9b642350fa62c10ae7f9174125baf53a07e691 100644 (file)
@@ -258,8 +258,8 @@ impl<T: 'static> LocalKey<T> {
     pub const unsafe fn new(inner: unsafe fn() -> Option<&'static UnsafeCell<Option<T>>>,
                             init: fn() -> T) -> LocalKey<T> {
         LocalKey {
-            inner: inner,
-            init: init,
+            inner,
+            init,
         }
     }
 
index 48819adb23e2ea03c2f5c194b176be1dd9e59846..d715a0d740b42a15ff4b75e19505aae384563e39 100644 (file)
@@ -197,8 +197,8 @@ pub fn checked_add(self, rhs: Duration) -> Option<Duration> {
             }
             debug_assert!(nanos < NANOS_PER_SEC);
             Some(Duration {
-                secs: secs,
-                nanos: nanos,
+                secs,
+                nanos,
             })
         } else {
             None
@@ -268,8 +268,8 @@ pub fn checked_mul(self, rhs: u32) -> Option<Duration> {
             .and_then(|s| s.checked_add(extra_secs)) {
             debug_assert!(nanos < NANOS_PER_SEC);
             Some(Duration {
-                secs: secs,
-                nanos: nanos,
+                secs,
+                nanos,
             })
         } else {
             None
index 54a5288a57c8b4c39c30a948efe7d729ec754121..1274b0625875bbf6199be96e1c1be4c71e90fba7 100644 (file)
@@ -87,7 +87,7 @@ pub fn new(chars: I) -> Utf16Encoder<I>
         where I: Iterator<Item = char>
     {
         Utf16Encoder {
-            chars: chars,
+            chars,
             extra: 0,
         }
     }
index 38ef79822c7b5dc6d68fd5e14607546cf7889a8f..4e6641f4c50ed88c76d6bf161e616f81b161f54f 100644 (file)
@@ -135,7 +135,7 @@ pub fn from_ident(ident: Ident, span: Span) -> Self {
     pub fn crate_root(span: Span) -> Self {
         PathSegment {
             identifier: Ident { ctxt: span.ctxt, ..keywords::CrateRoot.ident() },
-            span: span,
+            span,
             parameters: None,
         }
     }
@@ -1492,15 +1492,15 @@ pub fn from_self(eself: ExplicitSelf, eself_ident: SpannedIdent) -> Arg {
         let infer_ty = P(Ty {
             id: DUMMY_NODE_ID,
             node: TyKind::ImplicitSelf,
-            span: span,
+            span,
         });
         let arg = |mutbl, ty| Arg {
             pat: P(Pat {
                 id: DUMMY_NODE_ID,
                 node: PatKind::Ident(BindingMode::ByValue(mutbl), eself_ident, None),
-                span: span,
+                span,
             }),
-            ty: ty,
+            ty,
             id: DUMMY_NODE_ID,
         };
         match eself.node {
@@ -1509,7 +1509,7 @@ pub fn from_self(eself: ExplicitSelf, eself_ident: SpannedIdent) -> Arg {
             SelfKind::Region(lt, mutbl) => arg(Mutability::Immutable, P(Ty {
                 id: DUMMY_NODE_ID,
                 node: TyKind::Rptr(lt, MutTy { ty: infer_ty, mutbl: mutbl }),
-                span: span,
+                span,
             })),
         }
     }
@@ -1738,7 +1738,7 @@ pub fn new(lifetimes: Vec<LifetimeDef>, path: Path, span: Span) -> Self {
         PolyTraitRef {
             bound_lifetimes: lifetimes,
             trait_ref: TraitRef { path: path, ref_id: DUMMY_NODE_ID },
-            span: span,
+            span,
         }
     }
 }
index d5caf458fd762a233451db6b523a844f38376c76..a6c4c404d62b5af5e7460560eec9746ed68c9a53 100644 (file)
@@ -438,7 +438,7 @@ pub fn mk_attr_inner(span: Span, id: AttrId, item: MetaItem) -> Attribute {
 /// Returns an inner attribute with the given value and span.
 pub fn mk_spanned_attr_inner(sp: Span, id: AttrId, item: MetaItem) -> Attribute {
     Attribute {
-        id: id,
+        id,
         style: ast::AttrStyle::Inner,
         path: ast::Path::from_ident(item.span, ast::Ident::with_empty_ctxt(item.name)),
         tokens: item.node.tokens(item.span),
@@ -456,7 +456,7 @@ pub fn mk_attr_outer(span: Span, id: AttrId, item: MetaItem) -> Attribute {
 /// Returns an outer attribute with the given value and span.
 pub fn mk_spanned_attr_outer(sp: Span, id: AttrId, item: MetaItem) -> Attribute {
     Attribute {
-        id: id,
+        id,
         style: ast::AttrStyle::Outer,
         path: ast::Path::from_ident(item.span, ast::Ident::with_empty_ctxt(item.name)),
         tokens: item.node.tokens(item.span),
@@ -469,12 +469,12 @@ pub fn mk_sugared_doc_attr(id: AttrId, text: Symbol, span: Span) -> Attribute {
     let style = doc_comment_style(&text.as_str());
     let lit = respan(span, LitKind::Str(text, ast::StrStyle::Cooked));
     Attribute {
-        id: id,
-        style: style,
+        id,
+        style,
         path: ast::Path::from_ident(span, ast::Ident::from_str("doc")),
         tokens: MetaItemKind::NameValue(lit).tokens(span),
         is_sugared_doc: true,
-        span: span,
+        span,
     }
 }
 
@@ -718,8 +718,8 @@ fn find_stability_generic<'a, I>(diagnostic: &Handler,
                     match (since, reason) {
                         (Some(since), Some(reason)) => {
                             rustc_depr = Some(RustcDeprecation {
-                                since: since,
-                                reason: reason,
+                                since,
+                                reason,
                             })
                         }
                         (None, _) => {
@@ -763,7 +763,7 @@ fn find_stability_generic<'a, I>(diagnostic: &Handler,
                         (Some(feature), reason, Some(issue)) => {
                             stab = Some(Stability {
                                 level: Unstable {
-                                    reason: reason,
+                                    reason,
                                     issue: {
                                         if let Ok(issue) = issue.as_str().parse() {
                                             issue
@@ -774,7 +774,7 @@ fn find_stability_generic<'a, I>(diagnostic: &Handler,
                                         }
                                     }
                                 },
-                                feature: feature,
+                                feature,
                                 rustc_depr: None,
                             })
                         }
@@ -817,9 +817,9 @@ fn find_stability_generic<'a, I>(diagnostic: &Handler,
                         (Some(feature), Some(since)) => {
                             stab = Some(Stability {
                                 level: Stable {
-                                    since: since,
+                                    since,
                                 },
-                                feature: feature,
+                                feature,
                                 rustc_depr: None,
                             })
                         }
index 6c48b4cadd84fdcf9235cdd273738acc3a5c03a3..30ae7df93532e02bca75d4eac21d91cea980f3a1 100644 (file)
@@ -115,7 +115,7 @@ pub fn new(path_mapping: FilePathMapping) -> CodeMap {
         CodeMap {
             files: RefCell::new(Vec::new()),
             file_loader: Box::new(RealFileLoader),
-            path_mapping: path_mapping,
+            path_mapping,
         }
     }
 
@@ -124,8 +124,8 @@ pub fn with_file_loader(file_loader: Box<FileLoader>,
                             -> CodeMap {
         CodeMap {
             files: RefCell::new(Vec::new()),
-            file_loader: file_loader,
-            path_mapping: path_mapping,
+            file_loader,
+            path_mapping,
         }
     }
 
@@ -215,13 +215,13 @@ pub fn new_imported_filemap(&self,
 
         let filemap = Rc::new(FileMap {
             name: filename,
-            name_was_remapped: name_was_remapped,
-            crate_of_origin: crate_of_origin,
+            name_was_remapped,
+            crate_of_origin,
             src: None,
-            src_hash: src_hash,
+            src_hash,
             external_src: RefCell::new(ExternalSource::AbsentOk),
-            start_pos: start_pos,
-            end_pos: end_pos,
+            start_pos,
+            end_pos,
             lines: RefCell::new(file_local_lines),
             multibyte_chars: RefCell::new(file_local_multibyte_chars),
         });
@@ -255,7 +255,7 @@ pub fn lookup_char_pos(&self, pos: BytePos) -> Loc {
                 assert!(chpos >= linechpos);
                 Loc {
                     file: f,
-                    line: line,
+                    line,
                     col: chpos - linechpos,
                 }
             }
@@ -385,15 +385,15 @@ pub fn span_to_lines(&self, sp: Span) -> FileLinesResult {
             let line_len = lo.file.get_line(line_index)
                                   .map(|s| s.chars().count())
                                   .unwrap_or(0);
-            lines.push(LineInfo { line_index: line_index,
-                                  start_col: start_col,
+            lines.push(LineInfo { line_index,
+                                  start_col,
                                   end_col: CharPos::from_usize(line_len) });
             start_col = CharPos::from_usize(0);
         }
 
         // For the last line, it extends from `start_col` to `hi.col`:
         lines.push(LineInfo { line_index: hi.line - 1,
-                              start_col: start_col,
+                              start_col,
                               end_col: hi.col });
 
         Ok(FileLines {file: lo.file, lines: lines})
@@ -426,7 +426,7 @@ pub fn span_to_snippet(&self, sp: Span) -> Result<String, SpanSnippetError> {
                 return Err(SpanSnippetError::MalformedForCodemap(
                     MalformedCodemapPositions {
                         name: local_begin.fm.name.clone(),
-                        source_len: source_len,
+                        source_len,
                         begin_pos: local_begin.pos,
                         end_pos: local_end.pos,
                     }));
@@ -581,7 +581,7 @@ pub fn empty() -> FilePathMapping {
 
     pub fn new(mapping: Vec<(String, String)>) -> FilePathMapping {
         FilePathMapping {
-            mapping: mapping
+            mapping,
         }
     }
 
index 54e6dde41e6d48cacd63c1187cf55e1a91f74a57..14f1f8fbf8cb0f52acc78e2817f9cfdc076d2724 100644 (file)
@@ -32,8 +32,8 @@ pub fn features(mut krate: ast::Crate, sess: &ParseSess, should_test: bool)
     let features;
     {
         let mut strip_unconfigured = StripUnconfigured {
-            should_test: should_test,
-            sess: sess,
+            should_test,
+            sess,
             features: None,
         };
 
@@ -105,10 +105,10 @@ fn process_cfg_attr(&mut self, attr: ast::Attribute) -> Option<ast::Attribute> {
             self.process_cfg_attr(ast::Attribute {
                 id: attr::mk_attr_id(),
                 style: attr.style,
-                path: path,
-                tokens: tokens,
+                path,
+                tokens,
                 is_sugared_doc: false,
-                span: span,
+                span,
             })
         } else {
             None
index 855f4cd3557008ad1dca7a0a8a6f2a24cb487922..5224f52c49629e765cd5956c55412f4a9e03d3f9 100644 (file)
@@ -133,7 +133,7 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
     // Add the error to the map.
     with_registered_diagnostics(|diagnostics| {
         let info = ErrorInfo {
-            description: description,
+            description,
             use_site: None
         };
         if diagnostics.insert(code.name, info).is_some() {
@@ -235,7 +235,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
                 expr,
             ),
             vis: ast::Visibility::Public,
-            span: span,
+            span,
             tokens: None,
         })
     ]))
index 72b2552f64fc662295fc1108d21c04b89a98b4af..e57d9c6fe896ad8fc5d4b00bd71f782b893435d7 100644 (file)
@@ -677,10 +677,10 @@ pub fn new(parse_sess: &'a parse::ParseSess,
                resolver: &'a mut Resolver)
                -> ExtCtxt<'a> {
         ExtCtxt {
-            parse_sess: parse_sess,
-            ecfg: ecfg,
+            parse_sess,
+            ecfg,
             crate_root: None,
-            resolver: resolver,
+            resolver,
             resolve_err_count: 0,
             current_expansion: ExpansionData {
                 mark: Mark::root(),
index de0538e38b3ccaffcc194bec70c803149986f466..cbdd00135930ef4f26d998bf49f22325d5d2e00d 100644 (file)
@@ -366,7 +366,7 @@ fn qpath_all(&self,
         path.segments.push(ast::PathSegment {
             identifier: ident.node,
             span: ident.span,
-            parameters: parameters,
+            parameters,
         });
 
         (ast::QSelf {
@@ -377,15 +377,15 @@ fn qpath_all(&self,
 
     fn ty_mt(&self, ty: P<ast::Ty>, mutbl: ast::Mutability) -> ast::MutTy {
         ast::MutTy {
-            ty: ty,
-            mutbl: mutbl
+            ty,
+            mutbl,
         }
     }
 
     fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty> {
         P(ast::Ty {
             id: ast::DUMMY_NODE_ID,
-            span: span,
+            span,
             node: ty
         })
     }
@@ -444,15 +444,15 @@ fn typaram(&self,
             ident: id,
             id: ast::DUMMY_NODE_ID,
             attrs: attrs.into(),
-            bounds: bounds,
-            default: default,
-            span: span
+            bounds,
+            default,
+            span,
         }
     }
 
     fn trait_ref(&self, path: ast::Path) -> ast::TraitRef {
         ast::TraitRef {
-            path: path,
+            path,
             ref_id: ast::DUMMY_NODE_ID,
         }
     }
@@ -461,7 +461,7 @@ fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
         ast::PolyTraitRef {
             bound_lifetimes: Vec::new(),
             trait_ref: self.trait_ref(path),
-            span: span,
+            span,
         }
     }
 
@@ -482,7 +482,7 @@ fn lifetime_def(&self,
         ast::LifetimeDef {
             attrs: attrs.into(),
             lifetime: self.lifetime(span, ident),
-            bounds: bounds
+            bounds,
         }
     }
 
@@ -511,7 +511,7 @@ fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident,
             self.pat_ident(sp, ident)
         };
         let local = P(ast::Local {
-            pat: pat,
+            pat,
             ty: None,
             init: Some(ex),
             id: ast::DUMMY_NODE_ID,
@@ -539,7 +539,7 @@ fn stmt_let_typed(&self,
             self.pat_ident(sp, ident)
         };
         let local = P(ast::Local {
-            pat: pat,
+            pat,
             ty: Some(typ),
             init: Some(ex),
             id: ast::DUMMY_NODE_ID,
@@ -560,13 +560,13 @@ fn stmt_let_type_only(&self, span: Span, ty: P<ast::Ty>) -> ast::Stmt {
             ty: Some(ty),
             init: None,
             id: ast::DUMMY_NODE_ID,
-            span: span,
+            span,
             attrs: ast::ThinVec::new(),
         });
         ast::Stmt {
             id: ast::DUMMY_NODE_ID,
             node: ast::StmtKind::Local(local),
-            span: span,
+            span,
         }
     }
 
@@ -587,18 +587,18 @@ fn block_expr(&self, expr: P<ast::Expr>) -> P<ast::Block> {
     }
     fn block(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Block> {
         P(ast::Block {
-           stmts: stmts,
+           stmts,
            id: ast::DUMMY_NODE_ID,
            rules: BlockCheckMode::Default,
-           span: span,
+           span,
         })
     }
 
     fn expr(&self, span: Span, node: ast::ExprKind) -> P<ast::Expr> {
         P(ast::Expr {
             id: ast::DUMMY_NODE_ID,
-            node: node,
-            span: span,
+            node,
+            span,
             attrs: ast::ThinVec::new(),
         })
     }
@@ -672,7 +672,7 @@ fn field_imm(&self, span: Span, name: Ident, e: P<ast::Expr>) -> ast::Field {
         ast::Field {
             ident: respan(span, name),
             expr: e,
-            span: span,
+            span,
             is_shorthand: false,
             attrs: ast::ThinVec::new(),
         }
@@ -876,7 +876,7 @@ fn pat_err(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat> {
     fn arm(&self, _span: Span, pats: Vec<P<ast::Pat>>, expr: P<ast::Expr>) -> ast::Arm {
         ast::Arm {
             attrs: vec![],
-            pats: pats,
+            pats,
             guard: None,
             body: expr
         }
@@ -954,7 +954,7 @@ fn lambda_stmts_1(&self, span: Span, stmts: Vec<ast::Stmt>,
     fn arg(&self, span: Span, ident: ast::Ident, ty: P<ast::Ty>) -> ast::Arg {
         let arg_pat = self.pat_ident(span, ident);
         ast::Arg {
-            ty: ty,
+            ty,
             pat: arg_pat,
             id: ast::DUMMY_NODE_ID
         }
@@ -963,7 +963,7 @@ fn arg(&self, span: Span, ident: ast::Ident, ty: P<ast::Ty>) -> ast::Arg {
     // FIXME unused self
     fn fn_decl(&self, inputs: Vec<ast::Arg>, output: P<ast::Ty>) -> P<ast::FnDecl> {
         P(ast::FnDecl {
-            inputs: inputs,
+            inputs,
             output: ast::FunctionRetTy::Ty(output),
             variadic: false
         })
@@ -975,11 +975,11 @@ fn item(&self, span: Span, name: Ident,
         // Rust coding conventions
         P(ast::Item {
             ident: name,
-            attrs: attrs,
+            attrs,
             id: ast::DUMMY_NODE_ID,
-            node: node,
+            node,
             vis: ast::Visibility::Inherited,
-            span: span,
+            span,
             tokens: None,
         })
     }
@@ -1022,7 +1022,7 @@ fn variant(&self, span: Span, name: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Varian
         let fields: Vec<_> = tys.into_iter().map(|ty| {
             ast::StructField {
                 span: ty.span,
-                ty: ty,
+                ty,
                 ident: None,
                 vis: ast::Visibility::Inherited,
                 attrs: Vec::new(),
@@ -1038,7 +1038,7 @@ fn variant(&self, span: Span, name: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Varian
 
         respan(span,
                ast::Variant_ {
-                   name: name,
+                   name,
                    attrs: Vec::new(),
                    data: vdata,
                    disr_expr: None,
@@ -1081,7 +1081,7 @@ fn item_mod(&self, span: Span, inner_span: Span, name: Ident,
             attrs,
             ast::ItemKind::Mod(ast::Mod {
                 inner: inner_span,
-                items: items,
+                items,
             })
         )
     }
@@ -1147,7 +1147,7 @@ fn item_use(&self, sp: Span,
             ident: keywords::Invalid.ident(),
             attrs: vec![],
             node: ast::ItemKind::Use(vp),
-            vis: vis,
+            vis,
             span: sp,
             tokens: None,
         })
index 9625602fa4a5a02bcdf96b1101ef922d648a2ff5..d1172b1b2ce9468ebfc370a07cd25661ba7caeb7 100644 (file)
@@ -303,7 +303,7 @@ fn expand(&mut self, expansion: Expansion) -> Expansion {
                             kind: InvocationKind::Derive { path: path.clone(), item: item },
                             expansion_kind: invoc.expansion_kind,
                             expansion_data: ExpansionData {
-                                mark: mark,
+                                mark,
                                 ..invoc.expansion_data.clone()
                             },
                         });
@@ -579,7 +579,8 @@ fn expand_derive_invoc(&mut self, invoc: Invocation, ext: Rc<SyntaxExtension>) -
         let pretty_name = Symbol::intern(&format!("derive({})", path));
         let span = path.span;
         let attr = ast::Attribute {
-            path: path, tokens: TokenStream::empty(), span: span,
+            path, span,
+            tokens: TokenStream::empty(),
             // irrelevant:
             id: ast::AttrId(0), style: ast::AttrStyle::Outer, is_sugared_doc: false,
         };
@@ -714,10 +715,10 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
     fn collect(&mut self, expansion_kind: ExpansionKind, kind: InvocationKind) -> Expansion {
         let mark = Mark::fresh(self.cx.current_expansion.mark);
         self.invocations.push(Invocation {
-            kind: kind,
-            expansion_kind: expansion_kind,
+            kind,
+            expansion_kind,
             expansion_data: ExpansionData {
-                mark: mark,
+                mark,
                 depth: self.cx.current_expansion.depth + 1,
                 ..self.cx.current_expansion.clone()
             },
@@ -876,7 +877,7 @@ fn fold_item(&mut self, item: P<ast::Item>) -> SmallVector<P<ast::Item>> {
                 item.and_then(|item| match item.node {
                     ItemKind::Mac(mac) => {
                         self.collect(ExpansionKind::Items, InvocationKind::Bang {
-                            mac: mac,
+                            mac,
                             ident: Some(item.ident),
                             span: item.span,
                         }).make_items()
@@ -1035,7 +1036,7 @@ pub fn $getter(&self) -> bool {
 impl<'feat> ExpansionConfig<'feat> {
     pub fn default(crate_name: String) -> ExpansionConfig<'static> {
         ExpansionConfig {
-            crate_name: crate_name,
+            crate_name,
             features: None,
             recursion_limit: 1024,
             trace_mac: false,
index e3377c1d8deefa05b4428a528a349a03cc653e8a..4fc2b92d3cd5263cb53f8c4c786abbb815c04c80 100644 (file)
@@ -35,7 +35,7 @@ fn mac_placeholder() -> ast::Mac {
     let vis = ast::Visibility::Inherited;
     let span = DUMMY_SP;
     let expr_placeholder = || P(ast::Expr {
-        id: id, span: span,
+        id, span,
         attrs: ast::ThinVec::new(),
         node: ast::ExprKind::Mac(mac_placeholder()),
     });
@@ -44,30 +44,30 @@ fn mac_placeholder() -> ast::Mac {
         ExpansionKind::Expr => Expansion::Expr(expr_placeholder()),
         ExpansionKind::OptExpr => Expansion::OptExpr(Some(expr_placeholder())),
         ExpansionKind::Items => Expansion::Items(SmallVector::one(P(ast::Item {
-            id: id, span: span, ident: ident, vis: vis, attrs: attrs,
+            id, span, ident, vis, attrs,
             node: ast::ItemKind::Mac(mac_placeholder()),
             tokens: None,
         }))),
         ExpansionKind::TraitItems => Expansion::TraitItems(SmallVector::one(ast::TraitItem {
-            id: id, span: span, ident: ident, attrs: attrs,
+            id, span, ident, attrs,
             node: ast::TraitItemKind::Macro(mac_placeholder()),
             tokens: None,
         })),
         ExpansionKind::ImplItems => Expansion::ImplItems(SmallVector::one(ast::ImplItem {
-            id: id, span: span, ident: ident, vis: vis, attrs: attrs,
+            id, span, ident, vis, attrs,
             node: ast::ImplItemKind::Macro(mac_placeholder()),
             defaultness: ast::Defaultness::Final,
             tokens: None,
         })),
         ExpansionKind::Pat => Expansion::Pat(P(ast::Pat {
-            id: id, span: span, node: ast::PatKind::Mac(mac_placeholder()),
+            id, span, node: ast::PatKind::Mac(mac_placeholder()),
         })),
         ExpansionKind::Ty => Expansion::Ty(P(ast::Ty {
-            id: id, span: span, node: ast::TyKind::Mac(mac_placeholder()),
+            id, span, node: ast::TyKind::Mac(mac_placeholder()),
         })),
         ExpansionKind::Stmts => Expansion::Stmts(SmallVector::one({
             let mac = P((mac_placeholder(), ast::MacStmtStyle::Braces, ast::ThinVec::new()));
-            ast::Stmt { id: id, span: span, node: ast::StmtKind::Mac(mac) }
+            ast::Stmt { id, span, node: ast::StmtKind::Mac(mac) }
         })),
     }
 }
@@ -81,9 +81,9 @@ pub struct PlaceholderExpander<'a, 'b: 'a> {
 impl<'a, 'b> PlaceholderExpander<'a, 'b> {
     pub fn new(cx: &'a mut ExtCtxt<'b>, monotonic: bool) -> Self {
         PlaceholderExpander {
-            cx: cx,
+            cx,
             expansions: HashMap::new(),
-            monotonic: monotonic,
+            monotonic,
         }
     }
 
index 9907dfe341e75d4465789a2a1ef6316f992a3b9e..c3f3a59c30212d818168c7a2af3db36885ce9628 100644 (file)
@@ -383,7 +383,7 @@ pub fn unflatten(tts: Vec<TokenTree>) -> Vec<TokenTree> {
             }
             TokenTree::Token(span, token::CloseDelim(delim)) => {
                 let tree = TokenTree::Delimited(span, Delimited {
-                    delim: delim,
+                    delim,
                     tts: result.into_iter().map(TokenStream::from).collect::<TokenStream>().into(),
                 });
                 result = results.pop().unwrap();
index 146bd5d985699fead5fc4050eadc3f426752b4ca..aea48632d5dd6010ddeeb6a3f830ebdb108c474a 100644 (file)
@@ -178,7 +178,7 @@ fn initial_matcher_pos(ms: Vec<TokenTree>, lo: BytePos) -> Box<MatcherPos> {
         sep: None,
         idx: 0,
         up: None,
-        matches: matches,
+        matches,
         match_lo: 0,
         match_cur: 0,
         match_hi: match_idx_hi,
@@ -374,7 +374,7 @@ fn inner_parse_loop(sess: &ParseSess,
                         stack: vec![],
                         sep: seq.separator.clone(),
                         idx: 0,
-                        matches: matches,
+                        matches,
                         match_lo: item.match_cur,
                         match_cur: item.match_cur,
                         match_hi: item.match_cur + seq.num_captures,
@@ -400,7 +400,7 @@ fn inner_parse_loop(sess: &ParseSess,
                     let idx = item.idx;
                     item.stack.push(MatcherTtFrame {
                         elts: lower_elts,
-                        idx: idx,
+                        idx,
                     });
                     item.idx = 0;
                     cur_items.push(item);
index 7b3fe2bd993a9a6941232d00505a3cb4df39d448..983b19c5bf073f7c678f57db62f9e6e459472c82 100644 (file)
@@ -271,9 +271,9 @@ pub fn compile(sess: &ParseSess, features: &RefCell<Features>, def: &ast::Item)
 
     let expander: Box<_> = Box::new(MacroRulesMacroExpander {
         name: def.ident,
-        lhses: lhses,
-        rhses: rhses,
-        valid: valid,
+        lhses,
+        rhses,
+        valid,
     });
 
     if body.legacy {
index 6fdcadd1dde1e7a5a3078dfdedca558ff79654b4..012d4a54b36f7e0508e2ae1b645e549829fa11d1 100644 (file)
@@ -191,8 +191,8 @@ fn parse_tree<I>(tree: tokenstream::TokenTree,
                 let name_captures = macro_parser::count_names(&sequence);
                 TokenTree::Sequence(span, Rc::new(SequenceRepetition {
                     tts: sequence,
-                    separator: separator,
-                    op: op,
+                    separator,
+                    op,
                     num_captures: name_captures,
                 }))
             }
index 2b8a733b85243b92e6dc609c1e1da402efdaebd3..7b2a31b5705780cd2f085ed692727069ceb8cdb7 100644 (file)
@@ -1576,9 +1576,9 @@ pub fn check_crate(krate: &ast::Crate,
                    unstable: UnstableFeatures) {
     maybe_stage_features(&sess.span_diagnostic, krate, unstable);
     let ctx = Context {
-        features: features,
+        features,
         parse_sess: sess,
-        plugin_attributes: plugin_attributes,
+        plugin_attributes,
     };
     visit::walk_crate(&mut PostExpansionVisitor { context: &ctx }, krate);
 }
index a54e2573af40a7fe2e34858f94ec6146113139b3..6fd0a2eab42359d95c70b4baf3ea44a3b6e5725a 100644 (file)
@@ -375,8 +375,8 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> {
             TyKind::BareFn(f) => {
                 TyKind::BareFn(f.map(|BareFnTy {lifetimes, unsafety, abi, decl}| BareFnTy {
                     lifetimes: fld.fold_lifetime_defs(lifetimes),
-                    unsafety: unsafety,
-                    abi: abi,
+                    unsafety,
+                    abi,
                     decl: fld.fold_fn_decl(decl)
                 }))
             }
@@ -387,7 +387,7 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> {
                 let qself = qself.map(|QSelf { ty, position }| {
                     QSelf {
                         ty: fld.fold_ty(ty),
-                        position: position
+                        position,
                     }
                 });
                 TyKind::Path(qself, fld.fold_path(path))
@@ -415,7 +415,7 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> {
 pub fn noop_fold_foreign_mod<T: Folder>(ForeignMod {abi, items}: ForeignMod,
                                         fld: &mut T) -> ForeignMod {
     ForeignMod {
-        abi: abi,
+        abi,
         items: items.move_map(|x| fld.fold_foreign_item(x)),
     }
 }
@@ -658,7 +658,7 @@ pub fn noop_fold_fn_decl<T: Folder>(decl: P<FnDecl>, fld: &mut T) -> P<FnDecl> {
             FunctionRetTy::Ty(ty) => FunctionRetTy::Ty(fld.fold_ty(ty)),
             FunctionRetTy::Default(span) => FunctionRetTy::Default(fld.new_span(span)),
         },
-        variadic: variadic
+        variadic,
     })
 }
 
@@ -745,7 +745,7 @@ pub fn noop_fold_where_clause<T: Folder>(
         predicates: predicates.move_map(|predicate| {
             fld.fold_where_predicate(predicate)
         }),
-        span: span,
+        span,
     }
 }
 
@@ -846,7 +846,7 @@ pub fn noop_fold_field<T: Folder>(f: Field, folder: &mut T) -> Field {
 pub fn noop_fold_mt<T: Folder>(MutTy {ty, mutbl}: MutTy, folder: &mut T) -> MutTy {
     MutTy {
         ty: folder.fold_ty(ty),
-        mutbl: mutbl,
+        mutbl,
     }
 }
 
@@ -864,7 +864,7 @@ pub fn noop_fold_block<T: Folder>(b: P<Block>, folder: &mut T) -> P<Block> {
     b.map(|Block {id, stmts, rules, span}| Block {
         id: folder.new_id(id),
         stmts: stmts.move_flat_map(|s| folder.fold_stmt(s).into_iter()),
-        rules: rules,
+        rules,
         span: folder.new_span(span),
     })
 }
@@ -998,10 +998,10 @@ pub fn noop_fold_crate<T: Folder>(Crate {module, attrs, span}: Crate,
                                   folder: &mut T) -> Crate {
     let mut items = folder.fold_item(P(ast::Item {
         ident: keywords::Invalid.ident(),
-        attrs: attrs,
+        attrs,
         id: ast::DUMMY_NODE_ID,
         vis: ast::Visibility::Public,
-        span: span,
+        span,
         node: ast::ItemKind::Mod(module),
         tokens: None,
     })).into_iter();
@@ -1024,9 +1024,9 @@ pub fn noop_fold_crate<T: Folder>(Crate {module, attrs, span}: Crate,
     };
 
     Crate {
-        module: module,
-        attrs: attrs,
-        span: span,
+        module,
+        attrs,
+        span,
     }
 }
 
@@ -1048,7 +1048,7 @@ pub fn noop_fold_item_simple<T: Folder>(Item {id, ident, attrs, node, vis, span,
 
         // FIXME: if this is replaced with a call to `folder.fold_tts` it causes
         //        an ICE during resolve... odd!
-        tokens: tokens,
+        tokens,
     }
 }
 
@@ -1264,7 +1264,7 @@ pub fn noop_fold_expr<T: Folder>(Expr {id, node, span, attrs}: Expr, folder: &mu
                 let qself = qself.map(|QSelf { ty, position }| {
                     QSelf {
                         ty: folder.fold_ty(ty),
-                        position: position
+                        position,
                     }
                 });
                 ExprKind::Path(qself, folder.fold_path(path))
index 695c740f4052bd5b8110ef6cb05ece8a19cbf3fe..19238c30670cc10f2d7ad29ecdbb810dfa3f1ce0 100644 (file)
@@ -42,7 +42,7 @@ pub fn stderr(registry: Option<Registry>,
                   code_map: Rc<CodeMap>) -> JsonEmitter {
         JsonEmitter {
             dst: Box::new(io::stderr()),
-            registry: registry,
+            registry,
             cm: code_map,
         }
     }
@@ -56,8 +56,8 @@ pub fn new(dst: Box<Write + Send>,
                registry: Option<Registry>,
                code_map: Rc<CodeMap>) -> JsonEmitter {
         JsonEmitter {
-            dst: dst,
-            registry: registry,
+            dst,
+            registry,
             cm: code_map,
         }
     }
@@ -251,7 +251,7 @@ fn from_span_full(span: Span,
             Box::new(DiagnosticSpanMacroExpansion {
                 span: call_site,
                 macro_decl_name: bt.macro_decl_name,
-                def_site_span: def_site_span,
+                def_site_span,
             })
         });
         DiagnosticSpan {
@@ -262,11 +262,11 @@ fn from_span_full(span: Span,
             line_end: end.line,
             column_start: start.col.0 + 1,
             column_end: end.col.0 + 1,
-            is_primary: is_primary,
+            is_primary,
             text: DiagnosticSpanLine::from_span(span, je),
             suggested_replacement: suggestion.cloned(),
             expansion: backtrace_step,
-            label: label,
+            label,
         }
     }
 
@@ -351,7 +351,7 @@ fn map_opt_string(s: Option<String>, je: &JsonEmitter) -> Option<DiagnosticCode>
 
             DiagnosticCode {
                 code: s,
-                explanation: explanation,
+                explanation,
             }
         })
     }
index c99a09ab24e6b076ff12d4e9dc3312829c5c4bdc..5dc5a53e27907107ce389fe4840eb64accc997c7 100644 (file)
@@ -141,11 +141,11 @@ fn parse_attribute_with_inner_parse_policy(&mut self,
 
         Ok(ast::Attribute {
             id: attr::mk_attr_id(),
-            style: style,
-            path: path,
-            tokens: tokens,
+            style,
+            path,
+            tokens,
             is_sugared_doc: false,
-            span: span,
+            span,
         })
     }
 
index 8b545d3b909e823c472a1224219a723ce53731cf..f65fffebe337a21b2a4cb5b5d47b692b5f8575fb 100644 (file)
@@ -192,7 +192,7 @@ fn read_line_comments(rdr: &mut StringReader,
     if !lines.is_empty() {
         comments.push(Comment {
             style: if code_to_the_left { Trailing } else { Isolated },
-            lines: lines,
+            lines,
             pos: p,
         });
     }
@@ -306,8 +306,8 @@ fn read_block_comment(rdr: &mut StringReader,
     }
     debug!("<<< block comment");
     comments.push(Comment {
-        style: style,
-        lines: lines,
+        style,
+        lines,
         pos: p,
     });
 }
index 09cdf26bf1fff4390a6bd1508051efacf86b01c6..527d2e413969e4264fab62af600b624a029a3554 100644 (file)
@@ -160,18 +160,18 @@ fn new_raw_internal(sess: &'a ParseSess, filemap: Rc<syntax_pos::FileMap>) -> Se
         let source_text = (*filemap.src.as_ref().unwrap()).clone();
 
         StringReader {
-            sess: sess,
+            sess,
             next_pos: filemap.start_pos,
             pos: filemap.start_pos,
             col: CharPos(0),
             ch: Some('\n'),
-            filemap: filemap,
+            filemap,
             terminator: None,
             save_new_lines_and_multibyte: true,
             // dummy values; not read
             peek_tok: token::Eof,
             peek_span: syntax_pos::DUMMY_SP,
-            source_text: source_text,
+            source_text,
             fatal_errs: Vec::new(),
             token: token::Eof,
             span: syntax_pos::DUMMY_SP,
@@ -546,7 +546,7 @@ fn scan_comment(&mut self) -> Option<TokenAndSpan> {
                             };
 
                             Some(TokenAndSpan {
-                                tok: tok,
+                                tok,
                                 sp: self.mk_sp(start_bpos, self.pos),
                             })
                         })
@@ -675,7 +675,7 @@ fn scan_block_comment(&mut self) -> Option<TokenAndSpan> {
             };
 
             Some(TokenAndSpan {
-                tok: tok,
+                tok,
                 sp: self.mk_sp(start_bpos, self.pos),
             })
         })
index 63a396c14db858607ea1a17ba61564b894bff080..ad389ab510aaf070060dac472f0877d78c1cf17c 100644 (file)
@@ -114,7 +114,7 @@ fn parse_token_tree(&mut self) -> PResult<'a, TokenTree> {
                 }
 
                 Ok(TokenTree::Delimited(span, Delimited {
-                    delim: delim,
+                    delim,
                     tts: tts.into(),
                 }))
             },
index 957164bab79a708dcdb066371b4fb09c449ab082..67b4954a8f15b357a281b2c2d2b4ab3b0c4b1056 100644 (file)
@@ -69,7 +69,7 @@ pub fn with_span_handler(handler: Handler, code_map: Rc<CodeMap>) -> ParseSess {
             config: HashSet::new(),
             missing_fragment_specifiers: RefCell::new(HashSet::new()),
             included_mod_stack: RefCell::new(vec![]),
-            code_map: code_map
+            code_map,
         }
     }
 
index 15f05df58b5077fa8f54d83a33f75aa2c776fa23..e251d136f238aac62a8bbddd1634e36646cac56a 100644 (file)
@@ -465,17 +465,17 @@ fn from(expr: P<Expr>) -> Self {
 /// Create a placeholder argument.
 fn dummy_arg(span: Span) -> Arg {
     let spanned = Spanned {
-        span: span,
+        span,
         node: keywords::Invalid.ident()
     };
     let pat = P(Pat {
         id: ast::DUMMY_NODE_ID,
         node: PatKind::Ident(BindingMode::ByValue(Mutability::Immutable), spanned, None),
-        span: span
+        span,
     });
     let ty = Ty {
         node: TyKind::Err,
-        span: span,
+        span,
         id: ast::DUMMY_NODE_ID
     };
     Arg { ty: P(ty), pat: pat, id: ast::DUMMY_NODE_ID }
@@ -489,7 +489,7 @@ pub fn new(sess: &'a ParseSess,
                desugar_doc_comments: bool)
                -> Self {
         let mut parser = Parser {
-            sess: sess,
+            sess,
             token: token::Underscore,
             span: syntax_pos::DUMMY_SP,
             prev_span: syntax_pos::DUMMY_SP,
@@ -497,7 +497,7 @@ pub fn new(sess: &'a ParseSess,
             prev_token_kind: PrevTokenKind::Other,
             restrictions: Restrictions::empty(),
             obsolete_set: HashSet::new(),
-            recurse_into_file_modules: recurse_into_file_modules,
+            recurse_into_file_modules,
             directory: Directory { path: PathBuf::new(), ownership: DirectoryOwnership::Owned },
             root_module_name: None,
             expected_tokens: Vec::new(),
@@ -508,7 +508,7 @@ pub fn new(sess: &'a ParseSess,
                 }),
                 stack: Vec::new(),
             },
-            desugar_doc_comments: desugar_doc_comments,
+            desugar_doc_comments,
             cfg_mods: true,
         };
 
@@ -1216,15 +1216,15 @@ pub fn parse_ty_bare_fn(&mut self, lifetime_defs: Vec<LifetimeDef>)
         let (inputs, variadic) = self.parse_fn_args(false, true)?;
         let ret_ty = self.parse_ret_ty()?;
         let decl = P(FnDecl {
-            inputs: inputs,
+            inputs,
             output: ret_ty,
-            variadic: variadic
+            variadic,
         });
         Ok(TyKind::BareFn(P(BareFnTy {
-            abi: abi,
-            unsafety: unsafety,
+            abi,
+            unsafety,
             lifetimes: lifetime_defs,
-            decl: decl
+            decl,
         })))
     }
 
@@ -1312,11 +1312,11 @@ fn parse_trait_item_(&mut self,
 
             generics.where_clause = self.parse_where_clause()?;
             let sig = ast::MethodSig {
-                unsafety: unsafety,
-                constness: constness,
+                unsafety,
+                constness,
                 decl: d,
-                generics: generics,
-                abi: abi,
+                generics,
+                abi,
             };
 
             let body = match self.token {
@@ -1344,8 +1344,8 @@ fn parse_trait_item_(&mut self,
         Ok(TraitItem {
             id: ast::DUMMY_NODE_ID,
             ident: name,
-            attrs: attrs,
-            node: node,
+            attrs,
+            node,
             span: lo.to(self.prev_span),
             tokens: None,
         })
@@ -1625,7 +1625,7 @@ pub fn parse_arg_general(&mut self, require_name: bool) -> PResult<'a, Arg> {
 
         Ok(Arg {
             ty: t,
-            pat: pat,
+            pat,
             id: ast::DUMMY_NODE_ID,
         })
     }
@@ -1649,7 +1649,7 @@ pub fn parse_fn_block_arg(&mut self) -> PResult<'a, Arg> {
         };
         Ok(Arg {
             ty: t,
-            pat: pat,
+            pat,
             id: ast::DUMMY_NODE_ID
         })
     }
@@ -1934,8 +1934,8 @@ pub fn parse_field(&mut self) -> PResult<'a, Field> {
         Ok(ast::Field {
             ident: respan(lo.to(hi), fieldname),
             span: lo.to(expr.span),
-            expr: expr,
-            is_shorthand: is_shorthand,
+            expr,
+            is_shorthand,
             attrs: attrs.into(),
         })
     }
@@ -1943,8 +1943,8 @@ pub fn parse_field(&mut self) -> PResult<'a, Field> {
     pub fn mk_expr(&mut self, span: Span, node: ExprKind, attrs: ThinVec<Attribute>) -> P<Expr> {
         P(Expr {
             id: ast::DUMMY_NODE_ID,
-            node: node,
-            span: span,
+            node,
+            span,
             attrs: attrs.into(),
         })
     }
@@ -1990,8 +1990,8 @@ pub fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec<Attribute>) ->
         P(Expr {
             id: ast::DUMMY_NODE_ID,
             node: ExprKind::Mac(codemap::Spanned {node: m, span: span}),
-            span: span,
-            attrs: attrs,
+            span,
+            attrs,
         })
     }
 
@@ -2006,7 +2006,7 @@ pub fn mk_lit_u32(&mut self, i: u32, attrs: ThinVec<Attribute>) -> P<Expr> {
             id: ast::DUMMY_NODE_ID,
             node: ExprKind::Lit(lv_lit),
             span: *span,
-            attrs: attrs,
+            attrs,
         })
     }
 
@@ -3153,9 +3153,9 @@ pub fn parse_arm(&mut self) -> PResult<'a, Arm> {
         }
 
         Ok(ast::Arm {
-            attrs: attrs,
-            pats: pats,
-            guard: guard,
+            attrs,
+            pats,
+            guard,
             body: expr,
         })
     }
@@ -3361,7 +3361,7 @@ fn parse_pat_fields(&mut self) -> PResult<'a, (Vec<codemap::Spanned<ast::FieldPa
                                            node: ast::FieldPat {
                                                ident: fieldname,
                                                pat: subpat,
-                                               is_shorthand: is_shorthand,
+                                               is_shorthand,
                                                attrs: attrs.into(),
                                            }
             });
@@ -3597,12 +3597,12 @@ fn parse_local(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Local>> {
         };
         let init = self.parse_initializer()?;
         Ok(P(ast::Local {
-            ty: ty,
-            pat: pat,
-            init: init,
+            ty,
+            pat,
+            init,
             id: ast::DUMMY_NODE_ID,
             span: lo.to(self.prev_span),
-            attrs: attrs,
+            attrs,
         }))
     }
 
@@ -3618,10 +3618,10 @@ fn parse_name_and_ty(&mut self,
         Ok(StructField {
             span: lo.to(self.prev_span),
             ident: Some(name),
-            vis: vis,
+            vis,
             id: ast::DUMMY_NODE_ID,
-            ty: ty,
-            attrs: attrs,
+            ty,
+            attrs,
         })
     }
 
@@ -3929,7 +3929,7 @@ fn parse_stmt_without_recovery(&mut self,
                 Stmt {
                     id: ast::DUMMY_NODE_ID,
                     span: lo.to(hi),
-                    node: node,
+                    node,
                 }
             } else {
                 // if it has a special ident, it's definitely an item
@@ -3946,7 +3946,7 @@ fn parse_stmt_without_recovery(&mut self,
                 let span = lo.to(hi);
                 Stmt {
                     id: ast::DUMMY_NODE_ID,
-                    span: span,
+                    span,
                     node: StmtKind::Item({
                         self.mk_item(
                             span, id /*id is good here*/,
@@ -4083,7 +4083,7 @@ fn parse_block_tail(&mut self, lo: Span, s: BlockCheckMode) -> PResult<'a, P<Blo
         }
 
         Ok(P(ast::Block {
-            stmts: stmts,
+            stmts,
             id: ast::DUMMY_NODE_ID,
             rules: s,
             span: lo.to(self.prev_span),
@@ -4227,11 +4227,11 @@ fn parse_ty_param(&mut self, preceding_attrs: Vec<Attribute>) -> PResult<'a, TyP
 
         Ok(TyParam {
             attrs: preceding_attrs.into(),
-            ident: ident,
+            ident,
             id: ast::DUMMY_NODE_ID,
-            bounds: bounds,
-            default: default,
-            span: span,
+            bounds,
+            default,
+            span,
         })
     }
 
@@ -4253,8 +4253,8 @@ pub fn parse_generic_params(&mut self) -> PResult<'a, (Vec<LifetimeDef>, Vec<TyP
                 };
                 lifetime_defs.push(LifetimeDef {
                     attrs: attrs.into(),
-                    lifetime: lifetime,
-                    bounds: bounds,
+                    lifetime,
+                    bounds,
                 });
                 if seen_ty_param {
                     self.span_err(self.prev_span,
@@ -4297,7 +4297,7 @@ pub fn parse_generics(&mut self) -> PResult<'a, ast::Generics> {
             self.expect_gt()?;
             Ok(ast::Generics {
                 lifetimes: lifetime_defs,
-                ty_params: ty_params,
+                ty_params,
                 where_clause: WhereClause {
                     id: ast::DUMMY_NODE_ID,
                     predicates: Vec::new(),
@@ -4334,8 +4334,8 @@ fn parse_generic_args(&mut self) -> PResult<'a, (Vec<Lifetime>, Vec<P<Ty>>, Vec<
                 let ty = self.parse_ty()?;
                 bindings.push(TypeBinding {
                     id: ast::DUMMY_NODE_ID,
-                    ident: ident,
-                    ty: ty,
+                    ident,
+                    ty,
                     span: lo.to(self.prev_span),
                 });
                 seen_binding = true;
@@ -4404,8 +4404,8 @@ pub fn parse_where_clause(&mut self) -> PResult<'a, WhereClause> {
                 where_clause.predicates.push(ast::WherePredicate::RegionPredicate(
                     ast::WhereRegionPredicate {
                         span: lo.to(self.prev_span),
-                        lifetime: lifetime,
-                        bounds: bounds,
+                        lifetime,
+                        bounds,
                     }
                 ));
             } else if self.check_type() {
@@ -4427,7 +4427,7 @@ pub fn parse_where_clause(&mut self) -> PResult<'a, WhereClause> {
                             span: lo.to(self.prev_span),
                             bound_lifetimes: lifetime_defs,
                             bounded_ty: ty,
-                            bounds: bounds,
+                            bounds,
                         }
                     ));
                 // FIXME: Decide what should be used here, `=` or `==`.
@@ -4437,7 +4437,7 @@ pub fn parse_where_clause(&mut self) -> PResult<'a, WhereClause> {
                         ast::WhereEqPredicate {
                             span: lo.to(self.prev_span),
                             lhs_ty: ty,
-                            rhs_ty: rhs_ty,
+                            rhs_ty,
                             id: ast::DUMMY_NODE_ID,
                         }
                     ));
@@ -4518,7 +4518,7 @@ pub fn parse_fn_decl(&mut self, allow_variadic: bool) -> PResult<'a, P<FnDecl>>
         Ok(P(FnDecl {
             inputs: args,
             output: ret_ty,
-            variadic: variadic
+            variadic,
         }))
     }
 
@@ -4679,7 +4679,7 @@ fn parse_fn_block_decl(&mut self) -> PResult<'a, P<FnDecl>> {
 
         Ok(P(FnDecl {
             inputs: inputs_captures,
-            output: output,
+            output,
             variadic: false
         }))
     }
@@ -4694,12 +4694,12 @@ fn parse_fn_header(&mut self) -> PResult<'a, (Ident, ast::Generics)> {
     fn mk_item(&mut self, span: Span, ident: Ident, node: ItemKind, vis: Visibility,
                attrs: Vec<Attribute>) -> P<Item> {
         P(Item {
-            ident: ident,
-            attrs: attrs,
+            ident,
+            attrs,
             id: ast::DUMMY_NODE_ID,
-            node: node,
-            vis: vis,
-            span: span,
+            node,
+            vis,
+            span,
             tokens: None,
         })
     }
@@ -4799,10 +4799,10 @@ fn parse_impl_item_(&mut self,
             id: ast::DUMMY_NODE_ID,
             span: lo.to(self.prev_span),
             ident: name,
-            vis: vis,
-            defaultness: defaultness,
-            attrs: attrs,
-            node: node,
+            vis,
+            defaultness,
+            attrs,
+            node,
             tokens: None,
         })
     }
@@ -4896,11 +4896,11 @@ fn parse_impl_method(&mut self, vis: &Visibility, at_end: &mut bool)
             *at_end = true;
             let (inner_attrs, body) = self.parse_inner_attrs_and_block()?;
             Ok((ident, inner_attrs, ast::ImplItemKind::Method(ast::MethodSig {
-                generics: generics,
-                abi: abi,
-                unsafety: unsafety,
-                constness: constness,
-                decl: decl
+                generics,
+                abi,
+                unsafety,
+                constness,
+                decl,
              }, body)))
         }
     }
@@ -5151,11 +5151,11 @@ pub fn parse_tuple_struct_body(&mut self) -> PResult<'a, Vec<StructField>> {
                 let ty = p.parse_ty()?;
                 Ok(StructField {
                     span: lo.to(p.span),
-                    vis: vis,
+                    vis,
                     ident: None,
                     id: ast::DUMMY_NODE_ID,
-                    ty: ty,
-                    attrs: attrs,
+                    ty,
+                    attrs,
                 })
             })?;
 
@@ -5281,7 +5281,7 @@ fn parse_mod_items(&mut self, term: &token::Token, inner_lo: Span) -> PResult<'a
 
         Ok(ast::Mod {
             inner: inner_lo.to(hi),
-            items: items
+            items,
         })
     }
 
@@ -5403,7 +5403,7 @@ pub fn default_submod_path(id: ast::Ident, dir_path: &Path, codemap: &CodeMap) -
         ModulePath {
             name: mod_name,
             path_exists: default_exists || secondary_exists,
-            result: result,
+            result,
         }
     }
 
@@ -5418,7 +5418,7 @@ fn submod_path(&mut self,
                     Some("mod.rs") => DirectoryOwnership::Owned,
                     _ => DirectoryOwnership::UnownedViaMod(true),
                 },
-                path: path,
+                path,
                 warn: false,
             });
         }
@@ -5509,12 +5509,12 @@ fn parse_item_foreign_fn(&mut self, vis: ast::Visibility, lo: Span, attrs: Vec<A
         let hi = self.span;
         self.expect(&token::Semi)?;
         Ok(ast::ForeignItem {
-            ident: ident,
-            attrs: attrs,
+            ident,
+            attrs,
             node: ForeignItemKind::Fn(decl, generics),
             id: ast::DUMMY_NODE_ID,
             span: lo.to(hi),
-            vis: vis
+            vis,
         })
     }
 
@@ -5529,12 +5529,12 @@ fn parse_item_foreign_static(&mut self, vis: ast::Visibility, lo: Span, attrs: V
         let hi = self.span;
         self.expect(&token::Semi)?;
         Ok(ForeignItem {
-            ident: ident,
-            attrs: attrs,
+            ident,
+            attrs,
             node: ForeignItemKind::Static(ty, mutbl),
             id: ast::DUMMY_NODE_ID,
             span: lo.to(hi),
-            vis: vis
+            vis,
         })
     }
 
@@ -5596,7 +5596,7 @@ fn parse_item_foreign_mod(&mut self,
 
         let prev_span = self.prev_span;
         let m = ast::ForeignMod {
-            abi: abi,
+            abi,
             items: foreign_items
         };
         let invalid = keywords::Invalid.ident();
@@ -5647,7 +5647,7 @@ fn parse_enum_def(&mut self, _generics: &ast::Generics) -> PResult<'a, EnumDef>
                 name: ident,
                 attrs: variant_attrs,
                 data: struct_def,
-                disr_expr: disr_expr,
+                disr_expr,
             };
             variants.push(respan(vlo.to(self.prev_span), vr));
 
@@ -6162,7 +6162,7 @@ fn parse_path_list_items(&mut self) -> PResult<'a, Vec<ast::PathListItem>> {
             let rename = this.parse_rename()?;
             let node = ast::PathListItem_ {
                 name: ident,
-                rename: rename,
+                rename,
                 id: ast::DUMMY_NODE_ID
             };
             Ok(respan(lo.to(this.prev_span), node))
index 3ce9e9d07b30cfa198cb43d48f3fba19688e436e..5c4bf47a6db435db4aea40cbe348becf76900618 100644 (file)
@@ -246,7 +246,7 @@ pub fn mk_printer<'a>(out: Box<io::Write+'a>, linewidth: usize) -> Printer<'a> {
     let n: usize = 55 * linewidth;
     debug!("mk_printer {}", linewidth);
     Printer {
-        out: out,
+        out,
         buf_len: n,
         margin: linewidth as isize,
         space: linewidth as isize,
index e9d11e73837aa7d32c0f9c21fad8207e6741b616..3be831e828c72138c1b7aff5c8615cbd28915c9a 100644 (file)
@@ -72,7 +72,7 @@ fn rust_printer<'a>(writer: Box<Write+'a>, ann: &'a PpAnn) -> State<'a> {
         literals: vec![].into_iter().peekable(),
         cur_cmnt: 0,
         boxes: Vec::new(),
-        ann: ann,
+        ann,
     }
 }
 
@@ -145,11 +145,11 @@ pub fn new(cm: &'a CodeMap,
         State {
             s: pp::mk_printer(out, DEFAULT_COLUMNS),
             cm: Some(cm),
-            comments: comments,
+            comments,
             literals: literals.unwrap_or_default().into_iter().peekable(),
             cur_cmnt: 0,
             boxes: Vec::new(),
-            ann: ann,
+            ann,
         }
     }
 }
index 263a4f13c1b290b69d4ba0746b8a60493147174c..8ab2ba71ec1fab9daf3c9c656f82f0ddc22ee6f4 100644 (file)
@@ -79,8 +79,8 @@ pub fn run(span_diagnostic: &errors::Handler,
         None => return
     };
     let mut v = ShowSpanVisitor {
-        span_diagnostic: span_diagnostic,
-        mode: mode,
+        span_diagnostic,
+        mode,
     };
     visit::walk_crate(&mut v, krate);
 }
index 430976e7d3ce4e98a29b25a0185a29daa6b03005..8977d701e5a2ba32e862903b26c8b7f5f0ae0a90 100644 (file)
@@ -72,18 +72,18 @@ pub fn maybe_inject_crates_ref(mut krate: ast::Crate, alt_std_name: Option<Strin
             tokens: TokenStream::empty(),
             id: attr::mk_attr_id(),
             is_sugared_doc: false,
-            span: span,
+            span,
         }],
         vis: ast::Visibility::Inherited,
         node: ast::ItemKind::Use(P(codemap::dummy_spanned(ast::ViewPathGlob(ast::Path {
             segments: ["{{root}}", name, "prelude", "v1"].into_iter().map(|name| {
                 ast::PathSegment::from_ident(ast::Ident::from_str(name), DUMMY_SP)
             }).collect(),
-            span: span,
+            span,
         })))),
         id: ast::DUMMY_NODE_ID,
         ident: keywords::Invalid.ident(),
-        span: span,
+        span,
         tokens: None,
     }));
 
index c05e166e01331ef8a875bc12f3aec414f9ccc033..eeb8bf7214467874957163134ec74703525066a3 100644 (file)
@@ -202,18 +202,18 @@ fn fold_item(&mut self, i: P<ast::Item>) -> SmallVector<P<ast::Item>> {
                                                               allow_dead_code_item);
 
                     ast::Item {
-                        id: id,
-                        ident: ident,
+                        id,
+                        ident,
                         attrs: attrs.into_iter()
                             .filter(|attr| {
                                 !attr.check_name("main") && !attr.check_name("start")
                             })
                             .chain(iter::once(allow_dead_code))
                             .collect(),
-                        node: node,
-                        vis: vis,
-                        span: span,
-                        tokens: tokens,
+                        node,
+                        vis,
+                        span,
+                        tokens,
                     }
                 }),
             EntryPointType::None |
@@ -243,7 +243,7 @@ fn mk_reexport_mod(cx: &mut TestCtxt,
 
     let reexport_mod = ast::Mod {
         inner: DUMMY_SP,
-        items: items,
+        items,
     };
 
     let sym = Ident::with_empty_ctxt(Symbol::gensym("__test_reexports"));
@@ -273,12 +273,12 @@ fn generate_test_harness(sess: &ParseSess,
 
     let mark = Mark::fresh(Mark::root());
     let mut cx: TestCtxt = TestCtxt {
-        sess: sess,
+        sess,
         span_diagnostic: sd,
         ext_cx: ExtCtxt::new(sess, ExpansionConfig::default("test".to_string()), resolver),
         path: Vec::new(),
         testfns: Vec::new(),
-        reexport_test_harness_main: reexport_test_harness_main,
+        reexport_test_harness_main,
         is_test_crate: is_test_crate(&krate),
         toplevel_reexport: None,
         ctxt: SyntaxContext::empty().apply_mark(mark),
@@ -296,7 +296,7 @@ fn generate_test_harness(sess: &ParseSess,
     });
 
     TestHarnessGenerator {
-        cx: cx,
+        cx,
         tests: Vec::new(),
         tested_submods: Vec::new(),
     }.fold_crate(krate)
@@ -464,10 +464,10 @@ fn mk_std(cx: &TestCtxt) -> P<ast::Item> {
     };
     P(ast::Item {
         id: ast::DUMMY_NODE_ID,
-        ident: ident,
+        ident,
         node: vi,
         attrs: vec![],
-        vis: vis,
+        vis,
         span: sp,
         tokens: None,
     })
index 923e8072f43462ba10ab69acd40f2c935948d877..3742fb8c804d71993498fd7df05bd54d41be3b26 100644 (file)
@@ -152,8 +152,8 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt,
                     outputs.push(ast::InlineAsmOutput {
                         constraint: output.unwrap_or(constraint),
                         expr: out,
-                        is_rw: is_rw,
-                        is_indirect: is_indirect,
+                        is_rw,
+                        is_indirect,
                     });
                 }
             }
@@ -242,14 +242,14 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt,
     MacEager::expr(P(ast::Expr {
         id: ast::DUMMY_NODE_ID,
         node: ast::ExprKind::InlineAsm(P(ast::InlineAsm {
-            asm: asm,
+            asm,
             asm_str_style: asm_str_style.unwrap(),
-            outputs: outputs,
-            inputs: inputs,
+            outputs,
+            inputs,
             clobbers: clobs,
-            volatile: volatile,
-            alignstack: alignstack,
-            dialect: dialect,
+            volatile,
+            alignstack,
+            dialect,
             ctxt: cx.backtrace(),
         })),
         span: sp,
index efb2fe5eb3b0feb5b627c1ac991f02979e03b116..0bc802283fb680b64d588ff72b9fc987aca9fcd7 100644 (file)
@@ -34,9 +34,9 @@ pub fn expand_deriving_copy(cx: &mut ExtCtxt,
     let path = Path::new(v);
 
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
-        path: path,
+        path,
         additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
         is_unsafe: false,
index 35a2a2513f4e250264e2e8642bb18c8e9b2bc5ce..71dd7abfab04a8499dfb1216dd1245d7cc1093f4 100644 (file)
@@ -77,7 +77,7 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt,
     let inline = cx.meta_word(span, Symbol::intern("inline"));
     let attrs = vec![cx.attribute(span, inline)];
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
         path: path_std!(cx, core::clone::Clone),
         additional_bounds: bounds,
index eef21492debc32440790ae38cb4049a745e48ba6..0b57beeae858b687061214e855fa44fe887de8cb 100644 (file)
@@ -28,7 +28,7 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
     let doc = cx.meta_list(span, Symbol::intern("doc"), vec![hidden]);
     let attrs = vec![cx.attribute(span, inline), cx.attribute(span, doc)];
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
         path: path_std!(cx, core::cmp::Eq),
         additional_bounds: Vec::new(),
index 9fc3d997585d711abfbc3fb2403a554c0bfc1deb..9b057aaceceb55cafec362ff7e1782a80b611ace 100644 (file)
@@ -26,7 +26,7 @@ pub fn expand_deriving_ord(cx: &mut ExtCtxt,
     let inline = cx.meta_word(span, Symbol::intern("inline"));
     let attrs = vec![cx.attribute(span, inline)];
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
         path: path_std!(cx, core::cmp::Ord),
         additional_bounds: Vec::new(),
index f2a050ce971edc76d414d9998ccfaa70d0a414f7..e635c6bebcd6dd80d704f1ed2d86b382b0d14600 100644 (file)
@@ -91,14 +91,14 @@ macro_rules! md {
     }
 
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
         path: path_std!(cx, core::cmp::PartialEq),
         additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
         is_unsafe: false,
         supports_unions: false,
-        methods: methods,
+        methods,
         associated_types: Vec::new(),
     };
     trait_def.expand(cx, mitem, item, push)
index ce4d549d696f4d344fb3f2e938f9e370db456fb8..e7e1c108760ab5fb7a91a46bf4e2a0b97979b770 100644 (file)
@@ -59,7 +59,7 @@ macro_rules! md {
         generics: LifetimeBounds::empty(),
         explicit_self: borrowed_explicit_self(),
         args: vec![borrowed_self()],
-        ret_ty: ret_ty,
+        ret_ty,
         attributes: attrs,
         is_unsafe: false,
         unify_fieldless_variants: true,
@@ -82,14 +82,14 @@ macro_rules! md {
     };
 
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: vec![],
         path: path_std!(cx, core::cmp::PartialOrd),
         additional_bounds: vec![],
         generics: LifetimeBounds::empty(),
         is_unsafe: false,
         supports_unions: false,
-        methods: methods,
+        methods,
         associated_types: Vec::new(),
     };
     trait_def.expand(cx, mitem, item, push)
index 38ed596098b2123e83618ca7b296c0e137ccb250..54d71dd4b48e3a16c3dad8237f8291c026fc5da0 100644 (file)
@@ -28,7 +28,7 @@ pub fn expand_deriving_debug(cx: &mut ExtCtxt,
                    Borrowed(None, ast::Mutability::Mutable));
 
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
         path: path_std!(cx, core::fmt::Debug),
         additional_bounds: Vec::new(),
index 498f2348b80f109157f55992e684e7e91111b864..517221af1d4bab574b76cc6c4d234223bec5fa2a 100644 (file)
@@ -57,7 +57,7 @@ fn expand_deriving_decodable_imp(cx: &mut ExtCtxt,
     let typaram = &*deriving::hygienic_type_parameter(item, "__D");
 
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
         path: Path::new_(vec![krate, "Decodable"], None, vec![], true),
         additional_bounds: Vec::new(),
index 69391f48c2288dd512119c79d23412b5423b53ba..0c8e3c3939576c331e66616a311fa5723da846c4 100644 (file)
@@ -26,7 +26,7 @@ pub fn expand_deriving_default(cx: &mut ExtCtxt,
     let inline = cx.meta_word(span, Symbol::intern("inline"));
     let attrs = vec![cx.attribute(span, inline)];
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
         path: path_std!(cx, core::default::Default),
         additional_bounds: Vec::new(),
index 1e19cd994192e15a9b3ef634ebcfbde63122b35d..c2c862f043f24dc17f1f2f0fecf9533d6a5abff8 100644 (file)
@@ -138,7 +138,7 @@ fn expand_deriving_encodable_imp(cx: &mut ExtCtxt,
     let typaram = &*deriving::hygienic_type_parameter(item, "__S");
 
     let trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
         path: Path::new_(vec![krate, "Encodable"], None, vec![], true),
         additional_bounds: Vec::new(),
index 3cbc7938bde0c0a46362f679d205d19cf47f5f9d..674facd05fdc0bab34ed6a21282ff54e2b52bd72 100644 (file)
@@ -381,10 +381,10 @@ fn visit_mac(&mut self, mac: &ast::Mac) {
     }
 
     let mut visitor = Visitor {
-        ty_param_names: ty_param_names,
+        ty_param_names,
         types: Vec::new(),
-        span: span,
-        cx: cx,
+        span,
+        cx,
     };
 
     visit::Visitor::visit_ty(&mut visitor, ty);
@@ -499,7 +499,7 @@ fn create_derived_impl(&self,
             ast::ImplItem {
                 id: ast::DUMMY_NODE_ID,
                 span: self.span,
-                ident: ident,
+                ident,
                 vis: ast::Visibility::Inherited,
                 defaultness: ast::Defaultness::Final,
                 attrs: Vec::new(),
@@ -596,7 +596,7 @@ fn create_derived_impl(&self,
                         span: self.span,
                         bound_lifetimes: vec![],
                         bounded_ty: ty,
-                        bounds: bounds,
+                        bounds,
                     };
 
                     let predicate = ast::WherePredicate::BoundPredicate(predicate);
@@ -606,10 +606,10 @@ fn create_derived_impl(&self,
         }
 
         let trait_generics = Generics {
-            lifetimes: lifetimes,
-            ty_params: ty_params,
-            where_clause: where_clause,
-            span: span,
+            lifetimes,
+            ty_params,
+            where_clause,
+            span,
         };
 
         // Create the reference to the trait.
@@ -807,11 +807,11 @@ fn call_substructure_method(&self,
                                 fields: &SubstructureFields)
                                 -> P<Expr> {
         let substructure = Substructure {
-            type_ident: type_ident,
+            type_ident,
             method_ident: cx.ident_of(self.name),
-            self_args: self_args,
-            nonself_args: nonself_args,
-            fields: fields,
+            self_args,
+            nonself_args,
+            fields,
         };
         let mut f = self.combine_substructure.borrow_mut();
         let f: &mut CombineSubstructureFunc = &mut *f;
@@ -924,8 +924,8 @@ fn create_method(&self,
             ident: method_ident,
             node: ast::ImplItemKind::Method(ast::MethodSig {
                                                 generics: fn_generics,
-                                                abi: abi,
-                                                unsafety: unsafety,
+                                                abi,
+                                                unsafety,
                                                 constness:
                                                     dummy_spanned(ast::Constness::NotConst),
                                                 decl: fn_decl,
@@ -985,7 +985,7 @@ fn expand_struct_method_body<'b>(&self,
             let mut other_fields: Vec<vec::IntoIter<_>> = raw_fields.collect();
             first_field.map(|(span, opt_id, field, attrs)| {
                     FieldInfo {
-                        span: span,
+                        span,
                         name: opt_id,
                         self_: field,
                         other: other_fields.iter_mut()
@@ -995,7 +995,7 @@ fn expand_struct_method_body<'b>(&self,
                                 }
                             })
                             .collect(),
-                        attrs: attrs,
+                        attrs,
                     }
                 })
                 .collect()
@@ -1246,7 +1246,7 @@ fn build_enum_match_tuple<'b>(&self,
                                     name: opt_ident,
                                     self_: self_getter_expr,
                                     other: others,
-                                    attrs: attrs,
+                                    attrs,
                         }
                     }).collect::<Vec<FieldInfo>>();
 
@@ -1553,7 +1553,7 @@ fn create_struct_pattern
                             span: Span { ctxt: self.span.ctxt, ..pat.span },
                             node: ast::FieldPat {
                                 ident: ident.unwrap(),
-                                pat: pat,
+                                pat,
                                 is_shorthand: false,
                                 attrs: ast::ThinVec::new(),
                             },
index f5ac1743920c11874eabf7164b7458840d868ec2..47b5f40832ac037796ebeeaa71278f4f70bb4f8d 100644 (file)
@@ -55,10 +55,10 @@ pub fn new_<'r>(path: Vec<&'r str>,
                     global: bool)
                     -> Path<'r> {
         Path {
-            path: path,
-            lifetime: lifetime,
-            params: params,
-            global: global,
+            path,
+            lifetime,
+            params,
+            global,
         }
     }
 
@@ -211,14 +211,14 @@ fn mk_ty_param(cx: &ExtCtxt,
 fn mk_generics(lifetimes: Vec<ast::LifetimeDef>, ty_params: Vec<ast::TyParam>, span: Span)
                -> Generics {
     Generics {
-        lifetimes: lifetimes,
-        ty_params: ty_params,
+        lifetimes,
+        ty_params,
         where_clause: ast::WhereClause {
             id: ast::DUMMY_NODE_ID,
             predicates: Vec::new(),
-            span: span,
+            span,
         },
-        span: span,
+        span,
     }
 }
 
index a341c21d0a126cbc5667a74fd58e7358c6a10993..6c78eea186d61fb7cb7d865f1cb4ae93c5c72b2a 100644 (file)
@@ -30,9 +30,9 @@ pub fn expand_deriving_hash(cx: &mut ExtCtxt,
 
     let arg = Path::new_local(typaram);
     let hash_trait_def = TraitDef {
-        span: span,
+        span,
         attributes: Vec::new(),
-        path: path,
+        path,
         additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
         is_unsafe: false,
index 00dcfc7a587069a2294d750d2a92a2a2ecba14ae..cd706f14a680dde01b80b4bb4fd2d1fac49f1aaa 100644 (file)
@@ -173,6 +173,6 @@ fn call_intrinsic(cx: &ExtCtxt,
         stmts: vec![cx.stmt_expr(call)],
         id: ast::DUMMY_NODE_ID,
         rules: ast::BlockCheckMode::Unsafe(ast::CompilerGenerated),
-        span: span,
+        span,
     }))
 }
index 16b06424c92fc847acb0ec7b6ea2ab0f63319ca1..764cedfcf2061924fb3edb8e25ba37a49decbfda 100644 (file)
@@ -709,11 +709,11 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt,
     };
 
     let mut cx = Context {
-        ecx: ecx,
-        args: args,
-        arg_types: arg_types,
-        arg_unique_types: arg_unique_types,
-        names: names,
+        ecx,
+        args,
+        arg_types,
+        arg_unique_types,
+        names,
         curarg: 0,
         arg_index_map: Vec::new(),
         count_args: Vec::new(),
@@ -724,7 +724,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt,
         pieces: Vec::new(),
         str_pieces: Vec::new(),
         all_pieces_simple: true,
-        macsp: macsp,
+        macsp,
         fmtsp: fmt.span,
     };
 
index 3c802e8334dafd8c96197823f535bf3998647f47..99dae29d606b352c26daefeed51b223ba3036610 100644 (file)
@@ -265,7 +265,7 @@ fn translate(&self, s: &mut String) -> ::std::fmt::Result {
     /// Returns an iterator over all substitutions in a given string.
     pub fn iter_subs(s: &str) -> Substitutions {
         Substitutions {
-            s: s,
+            s,
         }
     }
 
@@ -553,12 +553,12 @@ macro_rules! move_to {
 
         let f = Format {
             span: start.slice_between(end).unwrap(),
-            parameter: parameter,
-            flags: flags,
-            width: width,
-            precision: precision,
-            length: length,
-            type_: type_,
+            parameter,
+            flags,
+            width,
+            precision,
+            length,
+            type_,
         };
         Some((Substitution::Format(f), end.slice_after()))
     }
@@ -776,7 +776,7 @@ pub fn translate(&self) -> Option<String> {
     /// Returns an iterator over all substitutions in a given string.
     pub fn iter_subs(s: &str) -> Substitutions {
         Substitutions {
-            s: s,
+            s,
         }
     }
 
@@ -933,7 +933,7 @@ pub struct StrCursor<'a> {
     impl<'a> StrCursor<'a> {
         pub fn new_at_start(s: &'a str) -> StrCursor<'a> {
             StrCursor {
-                s: s,
+                s,
                 at: 0,
             }
         }
index 8b0bb8cb891ee5267bf1a3a39a5089d475f0adfc..81226ba599ae64c7b57f53f26ca707585b1aaa59 100644 (file)
@@ -56,7 +56,7 @@ pub fn expand_global_asm<'cx>(cx: &'cx mut ExtCtxt,
         attrs: Vec::new(),
         id: ast::DUMMY_NODE_ID,
         node: ast::ItemKind::GlobalAsm(P(ast::GlobalAsm {
-            asm: asm,
+            asm,
             ctxt: cx.backtrace(),
         })),
         vis: ast::Visibility::Inherited,
index 700386f68fee047e6b57a5f7fcf806fd6090fa0f..a8a54a97ac3686ea034aecd831726c77eb8051fb 100644 (file)
@@ -69,9 +69,9 @@ pub fn modify(sess: &ParseSess,
             attr_macros: Vec::new(),
             bang_macros: Vec::new(),
             in_root: true,
-            handler: handler,
-            is_proc_macro_crate: is_proc_macro_crate,
-            is_test_crate: is_test_crate,
+            handler,
+            is_proc_macro_crate,
+            is_test_crate,
         };
         visit::walk_crate(&mut collect, &krate);
         (collect.derives, collect.attr_macros, collect.bang_macros)
@@ -183,7 +183,7 @@ fn collect_custom_derive(&mut self, item: &'a ast::Item, attr: &'a ast::Attribut
         if self.in_root && item.vis == ast::Visibility::Public {
             self.derives.push(ProcMacroDerive {
                 span: item.span,
-                trait_name: trait_name,
+                trait_name,
                 function_name: item.ident,
                 attrs: proc_attrs,
             });
index 514cc26666e39444d130fb56f3b4d9738b462ed7..296a3b11aedc17397b9889a80b611587fdd67e65 100644 (file)
@@ -161,7 +161,7 @@ pub fn apply_mark(self, mark: Mark) -> SyntaxContext {
                 syntax_contexts.push(SyntaxContextData {
                     outer_mark: mark,
                     prev_ctxt: self,
-                    modern: modern,
+                    modern,
                 });
                 SyntaxContext(syntax_contexts.len() as u32 - 1)
             })
index e162bc26412f2c9f8e61a8c326d1eeae8bcf0a21..f5449061b87fabed7eb3d096ebb3c3b5945823b7 100644 (file)
@@ -184,8 +184,8 @@ pub fn macro_backtrace(mut self) -> Vec<MacroBacktrace> {
             if !info.call_site.source_equal(&prev_span) {
                 result.push(MacroBacktrace {
                     call_site: info.call_site,
-                    macro_decl_name: macro_decl_name,
-                    def_site_span: def_site_span,
+                    macro_decl_name,
+                    def_site_span,
                 });
             }
 
@@ -358,7 +358,7 @@ pub fn span_labels(&self) -> Vec<SpanLabel> {
 
         for &(span, ref label) in &self.span_labels {
             span_labels.push(SpanLabel {
-                span: span,
+                span,
                 is_primary: is_primary(span),
                 label: Some(label.clone())
             });
@@ -367,7 +367,7 @@ pub fn span_labels(&self) -> Vec<SpanLabel> {
         for &span in &self.primary_spans {
             if !span_labels.iter().any(|sl| sl.span == span) {
                 span_labels.push(SpanLabel {
-                    span: span,
+                    span,
                     is_primary: true,
                     label: None
                 });
@@ -556,16 +556,16 @@ fn decode<D: Decoder>(d: &mut D) -> Result<FileMap, D::Error> {
             let multibyte_chars: Vec<MultiByteChar> =
                 d.read_struct_field("multibyte_chars", 5, |d| Decodable::decode(d))?;
             Ok(FileMap {
-                name: name,
-                name_was_remapped: name_was_remapped,
+                name,
+                name_was_remapped,
                 // `crate_of_origin` has to be set by the importer.
                 // This value matches up with rustc::hir::def_id::INVALID_CRATE.
                 // That constant is not available here unfortunately :(
                 crate_of_origin: ::std::u32::MAX - 1,
-                start_pos: start_pos,
-                end_pos: end_pos,
+                start_pos,
+                end_pos,
                 src: None,
-                src_hash: src_hash,
+                src_hash,
                 external_src: RefCell::new(ExternalSource::AbsentOk),
                 lines: RefCell::new(lines),
                 multibyte_chars: RefCell::new(multibyte_chars)
@@ -594,13 +594,13 @@ pub fn new(name: FileName,
         let end_pos = start_pos.to_usize() + src.len();
 
         FileMap {
-            name: name,
-            name_was_remapped: name_was_remapped,
+            name,
+            name_was_remapped,
             crate_of_origin: 0,
             src: Some(Rc::new(src)),
-            src_hash: src_hash,
+            src_hash,
             external_src: RefCell::new(ExternalSource::Unneeded),
-            start_pos: start_pos,
+            start_pos,
             end_pos: Pos::from_usize(end_pos),
             lines: RefCell::new(Vec::new()),
             multibyte_chars: RefCell::new(Vec::new()),
@@ -687,8 +687,8 @@ fn get_until_newline(src: &str, begin: usize) -> &str {
     pub fn record_multibyte_char(&self, pos: BytePos, bytes: usize) {
         assert!(bytes >=2 && bytes <= 4);
         let mbc = MultiByteChar {
-            pos: pos,
-            bytes: bytes,
+            pos,
+            bytes,
         };
         self.multibyte_chars.borrow_mut().push(mbc);
     }
index 68cfc7033ef5afa9938e483b13e6603a29e99954..c5e68eed4072541a2e81630dcc15345a8bd09122 100644 (file)
@@ -231,7 +231,7 @@ pub fn new_with_terminfo(out: T, terminfo: TermInfo) -> TerminfoTerminal<T> {
         };
 
         TerminfoTerminal {
-            out: out,
+            out,
             ti: terminfo,
             num_colors: nc,
         }
index 8d1ba378521529ac87043a85dc698975ec14bcb1..0cdea64db8bc09c74bf8d35d883130da52ab76f5 100644 (file)
@@ -337,8 +337,8 @@ pub fn msys_terminfo() -> TermInfo {
     TermInfo {
         names: vec!["cygwin".to_string()], // msys is a fork of an older cygwin version
         bools: HashMap::new(),
-        numbers: numbers,
-        strings: strings,
+        numbers,
+        strings,
     }
 }
 
index bf71b11fc776637288ec252230d274d24c79b070..5451ec24aa8fca5021e7990eb01fe2a51010290b 100644 (file)
@@ -235,8 +235,8 @@ pub struct Metric {
 impl Metric {
     pub fn new(value: f64, noise: f64) -> Metric {
         Metric {
-            value: value,
-            noise: noise,
+            value,
+            noise,
         }
     }
 }
@@ -492,17 +492,17 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
     };
 
     let test_opts = TestOpts {
-        list: list,
-        filter: filter,
+        list,
+        filter,
         filter_exact: exact,
-        run_ignored: run_ignored,
-        run_tests: run_tests,
-        bench_benchmarks: bench_benchmarks,
-        logfile: logfile,
-        nocapture: nocapture,
-        color: color,
-        quiet: quiet,
-        test_threads: test_threads,
+        run_ignored,
+        run_tests,
+        bench_benchmarks,
+        logfile,
+        nocapture,
+        color,
+        quiet,
+        test_threads,
         skip: matches.opt_strs("skip"),
         options: Options::new(),
     };
@@ -565,8 +565,8 @@ pub fn new(opts: &TestOpts, _: Option<T>) -> io::Result<ConsoleTestState<io::Std
         };
 
         Ok(ConsoleTestState {
-            out: out,
-            log_out: log_out,
+            out,
+            log_out,
             use_color: use_color(opts),
             quiet: opts.quiet,
             total: 0,
@@ -1330,7 +1330,7 @@ fn filter(test: TestDescAndFn) -> Option<TestDescAndFn> {
                 let TestDescAndFn {desc, testfn} = test;
                 Some(TestDescAndFn {
                     desc: TestDesc { ignore: false, ..desc },
-                    testfn: testfn,
+                    testfn,
                 })
             } else {
                 None
@@ -1367,7 +1367,7 @@ pub fn convert_benchmarks_to_tests(tests: Vec<TestDescAndFn>) -> Vec<TestDescAnd
         };
         TestDescAndFn {
             desc: x.desc,
-            testfn: testfn,
+            testfn,
         }
     }).collect()
 }
@@ -1527,8 +1527,8 @@ pub fn new() -> MetricMap {
     /// negative direction represents a regression.
     pub fn insert_metric(&mut self, name: &str, value: f64, noise: f64) {
         let m = Metric {
-            value: value,
-            noise: noise,
+            value,
+            noise,
         };
         let MetricMap(ref mut map) = *self;
         map.insert(name.to_owned(), m);
@@ -1689,7 +1689,7 @@ pub fn benchmark<F>(f: F) -> BenchSamples
                 let mb_s = bs.bytes * 1000 / ns_iter;
 
                 BenchSamples {
-                    ns_iter_summ: ns_iter_summ,
+                    ns_iter_summ,
                     mb_s: mb_s as usize,
                 }
             }
index b8efb88acfbdce3de9fc1ac64269ca5c56dcc87c..71e7d6d3477abfb3a317753d39f384f373f6b753 100644 (file)
@@ -181,15 +181,15 @@ fn main() {
     t!(io::stdin().read_to_string(&mut passphrase));
 
     Builder {
-        rust_release: rust_release,
-        cargo_release: cargo_release,
-        rls_release: rls_release,
-        input: input,
-        output: output,
+        rust_release,
+        cargo_release,
+        rls_release,
+        input,
+        output,
         gpg_passphrase: passphrase,
         digests: BTreeMap::new(),
-        s3_address: s3_address,
-        date: date,
+        s3_address,
+        date,
         rust_version: String::new(),
         cargo_version: String::new(),
         rls_version: String::new(),
index 0b9b9599be6035388836cb34dd309f9b8f1063a2..b7fb3670165d6d928e5c1adaa2953edbdd320fcb 100644 (file)
@@ -175,8 +175,8 @@ fn parse_expected(last_nonfollow_error: Option<usize>,
            msg);
     Some((which,
           Error {
-        line_num: line_num,
-        kind: kind,
-        msg: msg,
+        line_num,
+        kind,
+        msg,
     }))
 }
index 23782c3ccc9bb62661850220a5b3829d0bba903d..77ee93c30078b3b0d8908dfadc46c813cb67b40f 100644 (file)
@@ -148,8 +148,8 @@ fn push_expected_errors(expected_errors: &mut Vec<Error>,
             let kind = ErrorKind::from_str(&diagnostic.level).ok();
             expected_errors.push(Error {
                 line_num: span.line_start,
-                kind: kind,
-                msg: msg,
+                kind,
+                msg,
             });
         }
     }
index 6fa758aeabe4d4b853e7604f7269a7f6f37a6dd8..384ae3f45f60cced4636e9b85191662e48206e22 100644 (file)
@@ -176,9 +176,9 @@ fn make_absolute(path: PathBuf) -> PathBuf {
         target_rustcflags: matches.opt_str("target-rustcflags"),
         target: opt_str2(matches.opt_str("target")),
         host: opt_str2(matches.opt_str("host")),
-        gdb: gdb,
-        gdb_version: gdb_version,
-        gdb_native_rust: gdb_native_rust,
+        gdb,
+        gdb_version,
+        gdb_native_rust,
         lldb_version: extract_lldb_version(matches.opt_str("lldb-version")),
         llvm_version: matches.opt_str("llvm-version"),
         system_llvm: matches.opt_present("system-llvm"),
@@ -192,7 +192,7 @@ fn make_absolute(path: PathBuf) -> PathBuf {
         lldb_python_dir: matches.opt_str("lldb-python-dir"),
         verbose: matches.opt_present("verbose"),
         quiet: matches.opt_present("quiet"),
-        color: color,
+        color,
         remote_test_client: matches.opt_str("remote-test-client").map(PathBuf::from),
 
         cc: matches.opt_str("cc").unwrap(),
@@ -470,8 +470,8 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> test::TestDescAndFn
     test::TestDescAndFn {
         desc: test::TestDesc {
             name: make_test_name(config, testpaths),
-            ignore: ignore,
-            should_panic: should_panic,
+            ignore,
+            should_panic,
             allow_fail: false,
         },
         testfn: make_test_closure(config, testpaths),
index b6d89c1f51ae68183780faffece20318e8b5b206..ffcc60e78529247e1cd3ccd97a78c02d4a10b38f 100644 (file)
@@ -97,7 +97,7 @@ pub fn run(lib_path: &str,
     let Output { status, stdout, stderr } = process.wait_with_output().unwrap();
 
     Ok(Result {
-        status: status,
+        status,
         out: String::from_utf8(stdout).unwrap(),
         err: String::from_utf8(stderr).unwrap(),
     })
index 769748c63c02ddb52000fc01d3d3e65909e6dea3..02511ac6d98bc6d01e2398b7c3eb8158ed2b160d 100644 (file)
@@ -59,7 +59,7 @@ pub fn run(config: Config, testpaths: &TestPaths) {
 
     let base_cx = TestCx { config: &config,
                            props: &base_props,
-                           testpaths: testpaths,
+                           testpaths,
                            revision: None };
     base_cx.init_all();
 
@@ -72,7 +72,7 @@ pub fn run(config: Config, testpaths: &TestPaths) {
             let rev_cx = TestCx {
                 config: &config,
                 props: &revision_props,
-                testpaths: testpaths,
+                testpaths,
                 revision: Some(revision)
             };
             rev_cx.run_revision();
@@ -354,7 +354,7 @@ fn make_pp_args(&self,
         args.extend(self.props.compile_flags.iter().cloned());
         ProcArgs {
             prog: self.config.rustc_path.to_str().unwrap().to_owned(),
-            args: args,
+            args,
         }
     }
 
@@ -416,7 +416,7 @@ fn make_typecheck_args(&self) -> ProcArgs {
         // FIXME (#9639): This needs to handle non-utf8 paths
         ProcArgs {
             prog: self.config.rustc_path.to_str().unwrap().to_owned(),
-            args: args,
+            args,
         }
     }
 
@@ -595,10 +595,10 @@ fn run_debuginfo_gdb_test_no_opt(&self) {
                 };
 
                 debugger_run_result = ProcRes {
-                    status: status,
+                    status,
                     stdout: out,
                     stderr: err,
-                    cmdline: cmdline
+                    cmdline,
                 };
                 if process.kill().is_err() {
                     println!("Adb process is already finished.");
@@ -852,7 +852,7 @@ fn cmd2procres(&self, cmd: &mut Command) -> ProcRes {
 
         self.dump_output(&out, &err);
         ProcRes {
-            status: status,
+            status,
             stdout: out,
             stderr: err,
             cmdline: format!("{:?}", cmd)
@@ -899,9 +899,9 @@ fn parse_debugger_commands(&self, debugger_prefixes: &[&str]) -> DebuggerCommand
         }
 
         DebuggerCommands {
-            commands: commands,
-            check_lines: check_lines,
-            breakpoint_lines: breakpoint_lines,
+            commands,
+            check_lines,
+            breakpoint_lines,
         }
     }
 
@@ -1206,7 +1206,7 @@ fn document(&self, out_dir: &Path) -> ProcRes {
         let args = ProcArgs {
             prog: self.config.rustdoc_path
                 .as_ref().expect("--rustdoc-path passed").to_str().unwrap().to_owned(),
-            args: args,
+            args,
         };
         self.compose_and_run_compiler(args, None)
     }
@@ -1482,7 +1482,7 @@ fn make_compile_args(&self,
         args.extend(self.props.compile_flags.iter().cloned());
         ProcArgs {
             prog: self.config.rustc_path.to_str().unwrap().to_owned(),
-            args: args,
+            args,
         }
     }
 
@@ -1532,8 +1532,8 @@ fn make_run_args(&self) -> ProcArgs {
 
         let prog = args.remove(0);
          ProcArgs {
-            prog: prog,
-            args: args,
+            prog,
+            args,
         }
     }
 
@@ -1585,10 +1585,10 @@ fn program_output(&self,
                          working_dir).expect(&format!("failed to exec `{}`", prog));
         self.dump_output(&out, &err);
         ProcRes {
-            status: status,
+            status,
             stdout: out,
             stderr: err,
-            cmdline: cmdline,
+            cmdline,
         }
     }