This repository was archived by the owner on May 23, 2024. It is now read-only.
File tree 12 files changed +47
-77
lines changed
12 files changed +47
-77
lines changed Original file line number Diff line number Diff line change 1
1
* text =auto eol =lf
2
+ * .rs whitespace =tab-in-indent,trailing-space,tabwidth=4
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,16 +3,16 @@ use std::path::PathBuf;
3
3
4
4
pub enum Source
5
5
{
6
- File ( Path ) , // compiler error :(
7
- //File(PathBuf), // works :)
6
+ File ( Path ) , // compiler error :(
7
+ //File(PathBuf), // works :)
8
8
}
9
9
10
10
pub fn source_to_dbtype ( src : & Source ) -> u8
11
11
{
12
- match src
13
- {
14
- & Source :: File ( ..) => 1 ,
15
- }
12
+ match src
13
+ {
14
+ & Source :: File ( ..) => 1 ,
15
+ }
16
16
}
17
17
18
18
fn main ( ) { }
Original file line number Diff line number Diff line change 1
1
pub struct S ;
2
2
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
+ }
6
6
}
7
7
fn main ( ) { }
Original file line number Diff line number Diff line change 1
1
use std:: ops:: Add ;
2
2
3
3
pub trait Encoder {
4
- type Size : Add < Output = Self :: Size > ;
4
+ type Size : Add < Output = Self :: Size > ;
5
5
6
- fn foo ( & self ) -> Self :: Size ;
6
+ fn foo ( & self ) -> Self :: Size ;
7
7
}
8
8
9
9
pub trait SubEncoder : Encoder {
10
- type ActualSize ;
10
+ type ActualSize ;
11
11
12
- fn bar ( & self ) -> Self :: Size ;
12
+ fn bar ( & self ) -> Self :: Size ;
13
13
}
14
14
15
15
impl < T > Encoder for T where T : SubEncoder {
16
- type Size = <Self as SubEncoder >:: ActualSize ;
16
+ type Size = <Self as SubEncoder >:: ActualSize ;
17
17
18
- fn foo ( & self ) -> Self :: Size {
19
- self . bar ( ) + self . bar ( )
20
- }
18
+ fn foo ( & self ) -> Self :: Size {
19
+ self . bar ( ) + self . bar ( )
20
+ }
21
21
}
22
22
23
23
pub struct UnitEncoder ;
24
24
25
25
impl SubEncoder for UnitEncoder {
26
- type ActualSize = ( ) ;
26
+ type ActualSize = ( ) ;
27
27
28
- fn bar ( & self ) { }
28
+ fn bar ( & self ) { }
29
29
}
30
30
31
31
32
32
fn main ( ) {
33
- fun ( & UnitEncoder { } ) ;
33
+ fun ( & UnitEncoder { } ) ;
34
34
}
35
35
36
36
pub fn fun < R : Encoder > ( encoder : & R ) {
37
- encoder. foo ( ) ;
37
+ encoder. foo ( ) ;
38
38
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
trait SomeTrait where { }
4
4
5
5
trait WithAssoc < A > where {
6
- type AssocType ;
6
+ type AssocType ;
7
7
}
8
8
9
9
type Return < A > // 'a is not in scope
Original file line number Diff line number Diff line change 2
2
3
3
rustc -Z validate-mir - << EOF
4
4
fn main() {
5
- let x = "a".to_string();
5
+ let x = "a".to_string();
6
6
}
7
7
EOF
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ enum TestEnum {
5
5
Field { test_field: String },
6
6
}
7
7
fn main(){
8
- ()
8
+ ()
9
9
}
10
10
11
11
EOF
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use std::ops::CoerceUnsized;
4
4
use std:: any:: Any ;
5
5
6
6
struct Foo < T > {
7
- data : Box < T >
7
+ data : Box < T >
8
8
}
9
9
10
10
impl < T > CoerceUnsized < Foo < dyn Any > > for Foo < T > { }
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ enum MyEnum {
12
12
}
13
13
14
14
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
+ }
22
22
}
23
23
24
24
#[derive(Debug)]
Original file line number Diff line number Diff line change 3
3
use std:: future:: Future ;
4
4
5
5
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 ;
10
10
}
11
11
12
12
struct Implementor ;
13
13
14
14
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 > ;
18
18
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
+ }
26
26
}
You can’t perform that action at this time.
0 commit comments