Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use field init shorthand EVERYWHERE #43710

Merged
merged 1 commit into from
Aug 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
@@ -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 @@ impl<'a> Builder<'a> {
};

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 @@ impl<'a> Builder<'a> {
};

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()),
};
6 changes: 3 additions & 3 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
@@ -872,7 +872,7 @@ impl Step for CrateLibrustc {
builder.ensure(CrateLibrustc {
compiler,
target: run.target,
test_kind: test_kind,
test_kind,
krate: name,
});
};
@@ -934,8 +934,8 @@ impl Step for Crate {
builder.ensure(Crate {
compiler,
target: run.target,
mode: mode,
test_kind: test_kind,
mode,
test_kind,
krate: name,
});
};
20 changes: 10 additions & 10 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
@@ -74,13 +74,13 @@ impl Step for Std {
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 @@ impl Step for Std {
builder.ensure(StdLink {
compiler: builder.compiler(compiler.stage, build.build),
target_compiler: compiler,
target: target,
target,
});
}
}
@@ -202,7 +202,7 @@ impl Step for StdLink {

builder.ensure(tool::CleanTools {
compiler: target_compiler,
target: target,
target,
mode: Mode::Libstd,
});
}
@@ -326,13 +326,13 @@ impl Step for Test {
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 @@ impl Step for Test {
builder.ensure(TestLink {
compiler: builder.compiler(compiler.stage, build.build),
target_compiler: compiler,
target: target,
target,
});
}
}
@@ -398,7 +398,7 @@ impl Step for TestLink {
&libtest_stamp(build, compiler, target));
builder.ensure(tool::CleanTools {
compiler: target_compiler,
target: target,
target,
mode: Mode::Libtest,
});
}
@@ -445,7 +445,7 @@ impl Step for Rustc {
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 @@ impl Step for RustcLink {
&librustc_stamp(build, compiler, target));
builder.ensure(tool::CleanTools {
compiler: target_compiler,
target: target,
target,
mode: Mode::Librustc,
});
}
4 changes: 2 additions & 2 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
@@ -213,13 +213,13 @@ impl Step for TheBook {
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)),
});

14 changes: 7 additions & 7 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
@@ -274,14 +274,14 @@ Arguments:
}
"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 @@ Arguments:
}
"dist" => {
Subcommand::Dist {
paths: paths,
paths,
}
}
"install" => {
Subcommand::Install {
paths: paths,
paths,
}
}
_ => {
@@ -324,7 +324,7 @@ Arguments:

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 @@ Arguments:
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"),
}
}
14 changes: 7 additions & 7 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
@@ -314,19 +314,19 @@ impl 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),
}
4 changes: 2 additions & 2 deletions src/bootstrap/metadata.rs
Original file line number Diff line number Diff line change
@@ -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,
});
}
}
2 changes: 1 addition & 1 deletion src/liballoc/arc.rs
Original file line number Diff line number Diff line change
@@ -278,7 +278,7 @@ impl<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)) }
}
6 changes: 3 additions & 3 deletions src/liballoc/binary_heap.rs
Original file line number Diff line number Diff line change
@@ -853,9 +853,9 @@ impl<'a, T> Hole<'a, T> {
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 @@ where T: Clone + Ord {
let place = Placer::make_place(self.data.place_back());
BinaryHeapPlace {
heap: ptr,
place: place,
place,
}
}
}
2 changes: 1 addition & 1 deletion src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ fn make_place<T>() -> IntermediateBox<T> {

IntermediateBox {
ptr: p,
layout: layout,
layout,
marker: marker::PhantomData,
}
}
14 changes: 7 additions & 7 deletions src/liballoc/btree/map.rs
Original file line number Diff line number Diff line change
@@ -234,7 +234,7 @@ impl<K, Q: ?Sized> super::Recover<Q> for BTreeMap<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 @@ impl<K, Q: ?Sized> super::Recover<Q> for BTreeMap<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 @@ impl<K: Ord, V> BTreeMap<K, 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 @@ impl<K: Ord, V> BTreeMap<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,
})
14 changes: 7 additions & 7 deletions src/liballoc/btree/node.rs
Original file line number Diff line number Diff line change
@@ -776,8 +776,8 @@ impl<BorrowType, K, V, NodeType> Handle<NodeRef<BorrowType, K, V, NodeType>, mar
debug_assert!(idx < node.len());

Handle {
node: node,
idx: idx,
node,
idx,
_marker: PhantomData
}
}
@@ -850,8 +850,8 @@ impl<BorrowType, K, V, NodeType>
debug_assert!(idx <= node.len());

Handle {
node: node,
idx: idx,
node,
idx,
_marker: PhantomData
}
}
@@ -1149,7 +1149,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::

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 @@ impl<BorrowType, K, V, HandleType>
> {
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
})
4 changes: 2 additions & 2 deletions src/liballoc/linked_list.rs
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ impl<T> Node<T> {
Node {
next: None,
prev: None,
element: element,
element,
}
}

@@ -924,7 +924,7 @@ impl<'a, T> IterMut<'a, 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;
Loading