Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 9ddab6c

Browse files
authored
Some cleanups (#820)
1 parent 0db917b commit 9ddab6c

12 files changed

+47
-77
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* text=auto eol=lf
2+
*.rs whitespace=tab-in-indent,trailing-space,tabwidth=4

fixed/15402-2.rs

-14
This file was deleted.

fixed/16812_2.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ use std::path::PathBuf;
33

44
pub enum Source
55
{
6-
File(Path), // compiler error :(
7-
//File(PathBuf), // works :)
6+
File(Path), // compiler error :(
7+
//File(PathBuf), // works :)
88
}
99

1010
pub fn source_to_dbtype(src: &Source) -> u8
1111
{
12-
match src
13-
{
14-
&Source::File(..) => 1,
15-
}
12+
match src
13+
{
14+
&Source::File(..) => 1,
15+
}
1616
}
1717

1818
fn main() {}

fixed/27987.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub struct S;
22
impl S {
3-
pub fn f<'a>(&self, f: &'a f32) where u32: PartialEq<&'a f32> {
4-
4==f;
5-
}
3+
pub fn f<'a>(&self, f: &'a f32) where u32: PartialEq<&'a f32> {
4+
4==f;
5+
}
66
}
77
fn main() {}

fixed/54108.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
use std::ops::Add;
22

33
pub trait Encoder {
4-
type Size: Add<Output = Self::Size>;
4+
type Size: Add<Output = Self::Size>;
55

6-
fn foo(&self) -> Self::Size;
6+
fn foo(&self) -> Self::Size;
77
}
88

99
pub trait SubEncoder : Encoder {
10-
type ActualSize;
10+
type ActualSize;
1111

12-
fn bar(&self) -> Self::Size;
12+
fn bar(&self) -> Self::Size;
1313
}
1414

1515
impl<T> Encoder for T where T: SubEncoder {
16-
type Size = <Self as SubEncoder>::ActualSize;
16+
type Size = <Self as SubEncoder>::ActualSize;
1717

18-
fn foo(&self) -> Self::Size {
19-
self.bar() + self.bar()
20-
}
18+
fn foo(&self) -> Self::Size {
19+
self.bar() + self.bar()
20+
}
2121
}
2222

2323
pub struct UnitEncoder;
2424

2525
impl SubEncoder for UnitEncoder {
26-
type ActualSize = ();
26+
type ActualSize = ();
2727

28-
fn bar(&self) {}
28+
fn bar(&self) {}
2929
}
3030

3131

3232
fn main() {
33-
fun(&UnitEncoder {});
33+
fun(&UnitEncoder {});
3434
}
3535

3636
pub fn fun<R: Encoder>(encoder: &R) {
37-
encoder.foo();
37+
encoder.foo();
3838
}

fixed/66223.sh

-17
This file was deleted.

fixed/69136.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
trait SomeTrait where {}
44

55
trait WithAssoc<A> where {
6-
type AssocType;
6+
type AssocType;
77
}
88

99
type Return<A> // 'a is not in scope

fixed/73109.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
rustc -Z validate-mir - <<EOF
44
fn main() {
5-
let x = "a".to_string();
5+
let x = "a".to_string();
66
}
77
EOF

fixed/75229.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ enum TestEnum {
55
Field { test_field: String },
66
}
77
fn main(){
8-
()
8+
()
99
}
1010
1111
EOF

ices/53475.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::ops::CoerceUnsized;
44
use std::any::Any;
55

66
struct Foo<T> {
7-
data: Box<T>
7+
data: Box<T>
88
}
99

1010
impl<T> CoerceUnsized<Foo<dyn Any>> for Foo<T> {}

ices/78628.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ enum MyEnum {
1212
}
1313
1414
fn f(arg3: bool) -> MyStruct {
15-
match if arg3 { Some(MyEnum::Variant3) } else { None } {
16-
Some(t) => {
17-
let ah = t;
18-
return MyStruct(Some(ah));
19-
}
20-
_ => MyStruct(None)
21-
}
15+
match if arg3 { Some(MyEnum::Variant3) } else { None } {
16+
Some(t) => {
17+
let ah = t;
18+
return MyStruct(Some(ah));
19+
}
20+
_ => MyStruct(None)
21+
}
2222
}
2323
2424
#[derive(Debug)]

ices/83919.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
use std::future::Future;
44

55
trait Foo {
6-
type T;
7-
type Fut2: Future<Output=Self::T>; // ICE gets triggered with traits other than Future here
8-
type Fut: Future<Output=Self::Fut2>;
9-
fn get_fut(&self) -> Self::Fut;
6+
type T;
7+
type Fut2: Future<Output=Self::T>; // ICE gets triggered with traits other than Future here
8+
type Fut: Future<Output=Self::Fut2>;
9+
fn get_fut(&self) -> Self::Fut;
1010
}
1111

1212
struct Implementor;
1313

1414
impl Foo for Implementor {
15-
type T = u64;
16-
type Fut2 = impl Future<Output=u64>;
17-
type Fut = impl Future<Output=Self::Fut2>;
15+
type T = u64;
16+
type Fut2 = impl Future<Output=u64>;
17+
type Fut = impl Future<Output=Self::Fut2>;
1818

19-
fn get_fut(&self) -> Self::Fut {
20-
async move {
21-
42
22-
// 42 does not impl Future and rustc does actually point out the error, but rustc also panics.
23-
// Putting a valid Future here works fine.
24-
}
25-
}
19+
fn get_fut(&self) -> Self::Fut {
20+
async move {
21+
42
22+
// 42 does not impl Future and rustc does actually point out the error, but rustc also panics.
23+
// Putting a valid Future here works fine.
24+
}
25+
}
2626
}

0 commit comments

Comments
 (0)