Skip to content

Commit 419924d

Browse files
committed
Run tidy on tests
1 parent ed9d6e0 commit 419924d

File tree

7 files changed

+45
-28
lines changed

7 files changed

+45
-28
lines changed

library/std/tests/builtin-clone.rs

+3-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn test_clone<T: Clone>(arg: T) {
66
let _ = arg.clone();
77
}
88

9-
fn foo() { }
9+
fn foo() {}
1010

1111
#[derive(Debug, PartialEq, Eq)]
1212
struct S(i32);
@@ -27,19 +27,7 @@ fn builtin_clone() {
2727
let b = [S(1), S(2), S(3)];
2828
assert_eq!(b, a.clone());
2929

30-
let a = (
31-
(S(1), S(0)),
32-
(
33-
(S(0), S(0), S(1)),
34-
S(0)
35-
)
36-
);
37-
let b = (
38-
(S(2), S(1)),
39-
(
40-
(S(1), S(1), S(2)),
41-
S(1)
42-
)
43-
);
30+
let a = ((S(1), S(0)), ((S(0), S(0), S(1)), S(0)));
31+
let b = ((S(2), S(1)), ((S(1), S(1), S(2)), S(1)));
4432
assert_eq!(b, a.clone());
4533
}

library/std/tests/eq-multidispatch.rs

+27-5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,35 @@ struct Foo;
77
#[derive(Debug)]
88
struct Fu;
99

10-
impl PartialEq for Baz { fn eq(&self, _: &Baz) -> bool { true } }
10+
impl PartialEq for Baz {
11+
fn eq(&self, _: &Baz) -> bool {
12+
true
13+
}
14+
}
15+
16+
impl PartialEq<Fu> for Foo {
17+
fn eq(&self, _: &Fu) -> bool {
18+
true
19+
}
20+
}
1121

12-
impl PartialEq<Fu> for Foo { fn eq(&self, _: &Fu) -> bool { true } }
13-
impl PartialEq<Foo> for Fu { fn eq(&self, _: &Foo) -> bool { true } }
22+
impl PartialEq<Foo> for Fu {
23+
fn eq(&self, _: &Foo) -> bool {
24+
true
25+
}
26+
}
1427

15-
impl PartialEq<Bar> for Foo { fn eq(&self, _: &Bar) -> bool { false } }
16-
impl PartialEq<Foo> for Bar { fn eq(&self, _: &Foo) -> bool { false } }
28+
impl PartialEq<Bar> for Foo {
29+
fn eq(&self, _: &Bar) -> bool {
30+
false
31+
}
32+
}
33+
34+
impl PartialEq<Foo> for Bar {
35+
fn eq(&self, _: &Foo) -> bool {
36+
false
37+
}
38+
}
1739

1840
#[test]
1941
fn eq_multidispatch() {

library/std/tests/issue-21058.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
use std::fmt::Debug;
44

55
struct NT(str);
6-
struct DST { a: u32, b: str }
6+
7+
struct DST {
8+
a: u32,
9+
b: str,
10+
}
711

812
macro_rules! check {
913
(val: $ty_of:expr, $expected:expr) => {
@@ -56,7 +60,9 @@ fn type_name_of_val<T>(_: T) -> &'static str {
5660
struct Foo;
5761

5862
impl Foo {
59-
fn new() -> Self { Foo }
63+
fn new() -> Self {
64+
Foo
65+
}
6066
}
6167

6268
fn foo() -> impl Debug {

library/std/tests/istr.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ fn test_stack_assign() {
99
}
1010

1111
#[test]
12-
fn test_heap_lit() { "a big string".to_string(); }
12+
fn test_heap_lit() {
13+
"a big string".to_string();
14+
}
1315

1416
#[test]
1517
fn test_heap_assign() {

library/std/tests/log-knows-the-names-of-variants-in-std.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#[derive(Clone, Debug)]
55
enum foo {
6-
a(usize),
7-
b(String),
6+
a(usize),
7+
b(String),
88
}
99

1010
fn check_log<T: std::fmt::Debug>(exp: String, v: T) {

library/std/tests/minmax-stability-issue-23687.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use std::fmt::Debug;
21
use std::cmp::{self, Ordering};
2+
use std::fmt::Debug;
33

44
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
55
struct Foo {
66
n: u8,
7-
name: &'static str
7+
name: &'static str,
88
}
99

1010
impl PartialOrd for Foo {

src/tools/tidy/src/issues.txt

-1
Original file line numberDiff line numberDiff line change
@@ -3862,7 +3862,6 @@ ui/statics/issue-91050-1.rs
38623862
ui/statics/issue-91050-2.rs
38633863
ui/std/issue-3563-3.rs
38643864
ui/std/issue-81357-unsound-file-methods.rs
3865-
ui/stdlib-unit-tests/issue-21058.rs
38663865
ui/structs-enums/enum-rec/issue-17431-6.rs
38673866
ui/structs-enums/enum-rec/issue-17431-7.rs
38683867
ui/structs-enums/issue-103869.rs

0 commit comments

Comments
 (0)