Skip to content

Commit e61238d

Browse files
committed
rename various regression tests
1 parent 85ae47f commit e61238d

7 files changed

+44
-55
lines changed
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/2074
2+
13
//@ run-pass
24

35
#![allow(non_camel_case_types)]
46

57
pub fn main() {
68
let one = || {
7-
enum r { a }
9+
enum r {
10+
a,
11+
}
812
r::a as usize
913
};
1014
let two = || {
11-
enum r { a }
15+
enum r {
16+
a,
17+
}
1218
r::a as usize
1319
};
14-
one(); two();
20+
one();
21+
two();
1522
}

tests/ui/resolve/struct-function-same-name-2445-b.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,22 @@
22
#![allow(dead_code)]
33
#![allow(non_camel_case_types)]
44

5-
65
struct c1<T> {
76
x: T,
87
}
98

109
impl<T> c1<T> {
11-
pub fn f1(&self, _x: isize) {
12-
}
10+
pub fn f1(&self, _x: isize) {}
1311
}
1412

1513
fn c1<T>(x: T) -> c1<T> {
16-
c1 {
17-
x: x
18-
}
14+
c1 { x }
1915
}
2016

2117
impl<T> c1<T> {
22-
pub fn f2(&self, _x: isize) {
23-
}
18+
pub fn f2(&self, _x: isize) {}
2419
}
2520

26-
2721
pub fn main() {
2822
c1::<isize>(3).f1(4);
2923
c1::<isize>(3).f2(4);

tests/ui/resolve/struct-function-same-name-2445.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/2445
2+
13
//@ run-pass
24
#![allow(dead_code)]
35
#![allow(non_camel_case_types)]
46

5-
67
struct c1<T> {
78
x: T,
89
}
@@ -12,16 +13,13 @@ impl<T> c1<T> {
1213
}
1314

1415
fn c1<T>(x: T) -> c1<T> {
15-
c1 {
16-
x: x
17-
}
16+
c1 { x }
1817
}
1918

2019
impl<T> c1<T> {
2120
pub fn f2(&self, _x: T) {}
2221
}
2322

24-
2523
pub fn main() {
2624
c1::<isize>(3).f1(4);
2725
c1::<isize>(3).f2(4);

tests/ui/resolve/struct-function-same-name-2487-a.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@
22
#![allow(dead_code)]
33
#![allow(non_camel_case_types)]
44

5-
65
struct socket {
76
sock: isize,
8-
97
}
108

119
impl Drop for socket {
1210
fn drop(&mut self) {}
1311
}
1412

1513
impl socket {
16-
pub fn set_identity(&self) {
14+
pub fn set_identity(&self) {
1715
closure(|| setsockopt_bytes(self.sock.clone()))
1816
}
1917
}
2018

2119
fn socket() -> socket {
22-
socket {
23-
sock: 1
24-
}
20+
socket { sock: 1 }
2521
}
2622

27-
fn closure<F>(f: F) where F: FnOnce() { f() }
23+
fn closure<F>(f: F)
24+
where
25+
F: FnOnce(),
26+
{
27+
f()
28+
}
2829

29-
fn setsockopt_bytes(_sock: isize) { }
30+
fn setsockopt_bytes(_sock: isize) {}
3031

3132
pub fn main() {}
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/2502
2+
13
//@ check-pass
24
#![allow(dead_code)]
35
#![allow(non_camel_case_types)]
46

5-
6-
77
struct font<'a> {
8-
fontbuf: &'a Vec<u8> ,
8+
fontbuf: &'a Vec<u8>,
99
}
1010

1111
impl<'a> font<'a> {
@@ -14,10 +14,8 @@ impl<'a> font<'a> {
1414
}
1515
}
1616

17-
fn font(fontbuf: &Vec<u8> ) -> font<'_> {
18-
font {
19-
fontbuf: fontbuf
20-
}
17+
fn font(fontbuf: &Vec<u8>) -> font<'_> {
18+
font { fontbuf }
2119
}
2220

23-
pub fn main() { }
21+
pub fn main() {}

tests/ui/resolve/struct-function-same-name-2550.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/2550
2+
13
//@ run-pass
24
#![allow(dead_code)]
35
#![allow(non_snake_case)]
46

5-
67
struct C {
78
x: usize,
89
}
910

1011
fn C(x: usize) -> C {
11-
C {
12-
x: x
13-
}
12+
C { x }
1413
}
1514

16-
fn f<T>(_x: T) {
17-
}
15+
fn f<T>(_x: T) {}
1816

1917
pub fn main() {
2018
f(C(1));
Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/2463
2+
13
//@ run-pass
24
#![allow(dead_code)]
35

4-
struct Pair { f: isize, g: isize }
6+
struct Pair {
7+
f: isize,
8+
g: isize,
9+
}
510

611
pub fn main() {
12+
let x = Pair { f: 0, g: 0 };
713

8-
let x = Pair {
9-
f: 0,
10-
g: 0,
11-
};
12-
13-
let _y = Pair {
14-
f: 1,
15-
g: 1,
16-
.. x
17-
};
18-
19-
let _z = Pair {
20-
f: 1,
21-
.. x
22-
};
14+
let _y = Pair { f: 1, g: 1, ..x };
2315

16+
let _z = Pair { f: 1, ..x };
2417
}

0 commit comments

Comments
 (0)