File tree Expand file tree Collapse file tree 2 files changed +41
-39
lines changed Expand file tree Collapse file tree 2 files changed +41
-39
lines changed Original file line number Diff line number Diff line change 7
7
8
8
pub mod default_impl {
9
9
// I don't feel `default impl` is the good feature to combine with ext trait, but test anyway.
10
+ // TODO: `default impl` became syntactically invalid in https://github.com/rust-lang/rust/pull/144386#issuecomment-3133213586
10
11
11
12
// https://github.com/rust-lang/rust/blob/1.84.0/tests/ui/specialization/defaultimpl/auxiliary/go_trait.rs
12
13
pub mod go_trait {
13
- use easy_ext:: ext;
14
-
15
- pub trait Go {
16
- fn go ( & self , arg : isize ) ;
17
- }
18
-
19
- pub fn go < G : Go > ( this : & G , arg : isize ) {
20
- this. go ( arg)
21
- }
22
-
23
- pub fn go_mut < G : GoMut > ( this : & mut G , arg : isize ) {
24
- this. go_mut ( arg)
25
- }
26
-
27
- pub fn go_once < G : GoOnce > ( this : G , arg : isize ) {
28
- this. go_once ( arg)
29
- }
30
-
31
- #[ ext( GoMut ) ]
32
- pub default impl < G > G
33
- where
34
- G : Go ,
35
- {
36
- fn go_mut ( & mut self , arg : isize ) {
37
- go ( & * self , arg)
38
- }
39
- }
40
-
41
- #[ ext( GoOnce ) ]
42
- pub default impl < G > G
43
- where
44
- G : GoMut ,
45
- {
46
- fn go_once ( mut self , arg : isize ) {
47
- go_mut ( & mut self , arg)
48
- }
49
- }
14
+ // use easy_ext::ext;
15
+
16
+ // pub trait Go {
17
+ // fn go(&self, arg: isize);
18
+ // }
19
+
20
+ // pub fn go<G: Go>(this: &G, arg: isize) {
21
+ // this.go(arg)
22
+ // }
23
+
24
+ // pub fn go_mut<G: GoMut>(this: &mut G, arg: isize) {
25
+ // this.go_mut(arg)
26
+ // }
27
+
28
+ // pub fn go_once<G: GoOnce>(this: G, arg: isize) {
29
+ // this.go_once(arg)
30
+ // }
31
+
32
+ // #[ext(GoMut)]
33
+ // pub default impl<G> G
34
+ // where
35
+ // G: Go,
36
+ // {
37
+ // fn go_mut(&mut self, arg: isize) {
38
+ // go(&*self, arg)
39
+ // }
40
+ // }
41
+
42
+ // #[ext(GoOnce)]
43
+ // pub default impl<G> G
44
+ // where
45
+ // G: GoMut,
46
+ // {
47
+ // fn go_once(mut self, arg: isize) {
48
+ // go_mut(&mut self, arg)
49
+ // }
50
+ // }
50
51
}
51
52
}
52
53
Original file line number Diff line number Diff line change @@ -329,8 +329,9 @@ fn assoc_ty() {
329
329
#[ allow( clippy:: let_underscore_future) ]
330
330
#[ test]
331
331
fn syntax ( ) {
332
+ // TODO: `unsafe impl` became syntactically invalid in https://github.com/rust-lang/rust/pull/144386#issuecomment-3133213586
332
333
#[ ext( E1 ) ]
333
- unsafe impl str {
334
+ impl str {
334
335
fn normal ( & self ) { }
335
336
unsafe fn unsafety ( & self ) { }
336
337
extern "C" fn abi1 ( ) { }
@@ -351,7 +352,7 @@ fn syntax() {
351
352
} ;
352
353
353
354
struct S { }
354
- unsafe impl E1 for S {
355
+ impl E1 for S {
355
356
fn normal ( & self ) { }
356
357
unsafe fn unsafety ( & self ) { }
357
358
extern "C" fn abi1 ( ) { }
You can’t perform that action at this time.
0 commit comments