Skip to content

Commit 75dbbba

Browse files
committed
Run x.py fmt
1 parent 756d4bb commit 75dbbba

File tree

24 files changed

+228
-213
lines changed

24 files changed

+228
-213
lines changed

compiler/rustc_builtin_macros/src/deriving/clone.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ pub fn expand_deriving_clone(
4545
{
4646
bounds = vec![];
4747
is_shallow = true;
48-
substructure = combine_substructure(box (|c, s, sub| {
49-
cs_clone_shallow("Clone", c, s, sub, false)
50-
}));
48+
substructure = combine_substructure(
49+
box (|c, s, sub| cs_clone_shallow("Clone", c, s, sub, false)),
50+
);
5151
} else {
5252
bounds = vec![];
5353
is_shallow = false;
@@ -58,15 +58,14 @@ pub fn expand_deriving_clone(
5858
ItemKind::Union(..) => {
5959
bounds = vec![Literal(path_std!(marker::Copy))];
6060
is_shallow = true;
61-
substructure = combine_substructure(box (|c, s, sub| {
62-
cs_clone_shallow("Clone", c, s, sub, true)
63-
}));
61+
substructure = combine_substructure(
62+
box (|c, s, sub| cs_clone_shallow("Clone", c, s, sub, true)),
63+
);
6464
}
6565
_ => {
6666
bounds = vec![];
6767
is_shallow = false;
68-
substructure =
69-
combine_substructure(box (|c, s, sub| cs_clone("Clone", c, s, sub)));
68+
substructure = combine_substructure(box (|c, s, sub| cs_clone("Clone", c, s, sub)));
7069
}
7170
},
7271

compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ pub fn expand_deriving_eq(
3838
attributes: attrs,
3939
is_unsafe: false,
4040
unify_fieldless_variants: true,
41-
combine_substructure: combine_substructure(box (|a, b, c| {
42-
cs_total_eq_assert(a, b, c)
43-
})),
41+
combine_substructure: combine_substructure(box (|a, b, c| cs_total_eq_assert(a, b, c))),
4442
}],
4543
associated_types: Vec::new(),
4644
};

compiler/rustc_builtin_macros/src/deriving/cmp/partial_ord.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ pub fn expand_deriving_partial_ord(
3535
attributes: attrs,
3636
is_unsafe: false,
3737
unify_fieldless_variants: true,
38-
combine_substructure: combine_substructure(box (|cx, span, substr| {
39-
cs_partial_cmp(cx, span, substr)
40-
})),
38+
combine_substructure: combine_substructure(
39+
box (|cx, span, substr| cs_partial_cmp(cx, span, substr)),
40+
),
4141
};
4242

4343
let trait_def = TraitDef {

compiler/rustc_builtin_macros/src/deriving/debug.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ pub fn expand_deriving_debug(
2020
push: &mut dyn FnMut(Annotatable),
2121
) {
2222
// &mut ::std::fmt::Formatter
23-
let fmtr =
24-
Ptr(box (Literal(path_std!(fmt::Formatter))), Borrowed(None, ast::Mutability::Mut));
23+
let fmtr = Ptr(box (Literal(path_std!(fmt::Formatter))), Borrowed(None, ast::Mutability::Mut));
2524

2625
let trait_def = TraitDef {
2726
span,
@@ -40,9 +39,7 @@ pub fn expand_deriving_debug(
4039
attributes: Vec::new(),
4140
is_unsafe: false,
4241
unify_fieldless_variants: false,
43-
combine_substructure: combine_substructure(box (|a, b, c| {
44-
show_substructure(a, b, c)
45-
})),
42+
combine_substructure: combine_substructure(box (|a, b, c| show_substructure(a, b, c))),
4643
}],
4744
associated_types: Vec::new(),
4845
};

compiler/rustc_builtin_macros/src/deriving/decodable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ pub fn expand_deriving_rustc_decodable(
5858
attributes: Vec::new(),
5959
is_unsafe: false,
6060
unify_fieldless_variants: false,
61-
combine_substructure: combine_substructure(box (|a, b, c| {
62-
decodable_substructure(a, b, c, krate)
63-
})),
61+
combine_substructure: combine_substructure(
62+
box (|a, b, c| decodable_substructure(a, b, c, krate)),
63+
),
6464
}],
6565
associated_types: Vec::new(),
6666
};

compiler/rustc_builtin_macros/src/deriving/default.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ pub fn expand_deriving_default(
4141
attributes: attrs,
4242
is_unsafe: false,
4343
unify_fieldless_variants: false,
44-
combine_substructure: combine_substructure(box (|cx, trait_span, substr| {
45-
match substr.fields {
44+
combine_substructure: combine_substructure(
45+
box (|cx, trait_span, substr| match substr.fields {
4646
StaticStruct(_, fields) => {
4747
default_struct_substructure(cx, trait_span, substr, fields)
4848
}
@@ -59,8 +59,8 @@ pub fn expand_deriving_default(
5959
default_enum_substructure(cx, trait_span, enum_def)
6060
}
6161
_ => cx.span_bug(trait_span, "method in `derive(Default)`"),
62-
}
63-
})),
62+
}),
63+
),
6464
}],
6565
associated_types: Vec::new(),
6666
};

compiler/rustc_builtin_macros/src/deriving/encodable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ pub fn expand_deriving_rustc_encodable(
143143
attributes: Vec::new(),
144144
is_unsafe: false,
145145
unify_fieldless_variants: false,
146-
combine_substructure: combine_substructure(box (|a, b, c| {
147-
encodable_substructure(a, b, c, krate)
148-
})),
146+
combine_substructure: combine_substructure(
147+
box (|a, b, c| encodable_substructure(a, b, c, krate)),
148+
),
149149
}],
150150
associated_types: Vec::new(),
151151
};

compiler/rustc_builtin_macros/src/deriving/hash.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ pub fn expand_deriving_hash(
3737
attributes: vec![],
3838
is_unsafe: false,
3939
unify_fieldless_variants: true,
40-
combine_substructure: combine_substructure(box (|a, b, c| {
41-
hash_substructure(a, b, c)
42-
})),
40+
combine_substructure: combine_substructure(box (|a, b, c| hash_substructure(a, b, c))),
4341
}],
4442
associated_types: Vec::new(),
4543
};

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,10 +1934,12 @@ pub fn submit_pre_lto_module_to_llvm<B: ExtraBackendMethods>(
19341934
})
19351935
};
19361936
// Schedule the module to be loaded
1937-
drop(tx_to_llvm_workers.send(box (Message::AddImportOnlyModule::<B> {
1938-
module_data: SerializedModule::FromUncompressedFile(mmap),
1939-
work_product: module.source,
1940-
})));
1937+
drop(tx_to_llvm_workers.send(
1938+
box (Message::AddImportOnlyModule::<B> {
1939+
module_data: SerializedModule::FromUncompressedFile(mmap),
1940+
work_product: module.source,
1941+
}),
1942+
));
19411943
}
19421944

19431945
pub fn pre_lto_bitcode_filename(module_name: &str) -> String {

compiler/rustc_data_structures/src/owning_ref/tests.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,8 @@ mod owning_ref_mut {
465465

466466
#[test]
467467
fn map_chained_inference() {
468-
let or = BoxRefMut::new(box (example().1))
469-
.map_mut(|x| &mut x[..5])
470-
.map_mut(|x| &mut x[1..3]);
468+
let or =
469+
BoxRefMut::new(box (example().1)).map_mut(|x| &mut x[..5]).map_mut(|x| &mut x[1..3]);
471470
assert_eq!(&*or, "el");
472471
}
473472

@@ -509,11 +508,9 @@ mod owning_ref_mut {
509508

510509
#[test]
511510
fn erased_owner() {
512-
let o1: BoxRefMut<Example, str> =
513-
BoxRefMut::new(box (example())).map_mut(|x| &mut x.1[..]);
511+
let o1: BoxRefMut<Example, str> = BoxRefMut::new(box (example())).map_mut(|x| &mut x.1[..]);
514512

515-
let o2: BoxRefMut<String, str> =
516-
BoxRefMut::new(box (example().1)).map_mut(|x| &mut x[..]);
513+
let o2: BoxRefMut<String, str> = BoxRefMut::new(box (example().1)).map_mut(|x| &mut x[..]);
517514

518515
let os: Vec<ErasedBoxRefMut<str>> = vec![o1.erase_owner(), o2.erase_owner()];
519516
assert!(os.iter().all(|e| &e[..] == "hello world"));

0 commit comments

Comments
 (0)