File tree Expand file tree Collapse file tree 1 file changed +30
-21
lines changed Expand file tree Collapse file tree 1 file changed +30
-21
lines changed Original file line number Diff line number Diff line change 1
1
macro_rules! soc {
2
- ( $ ( $ ( # [ $doc : meta ] ) * pub struct $Ty : ident => $paddr : expr_2021$ ( , $DerefTy : ty ) + ; ) + ) => {
2
+ (
3
3
$(
4
- $( #[ $doc] ) *
5
- #[ allow( non_camel_case_types) ]
6
- pub struct $Ty {
7
- _private: ( ) ,
8
- }
9
- $(
10
- impl core:: ops:: Deref for $Ty {
11
- type Target = $DerefTy;
12
- #[ inline( always) ]
13
- fn deref( & self ) -> & Self :: Target {
14
- unsafe { & * ( $paddr as * const _) }
15
- }
16
- }
17
- impl core:: convert:: AsRef <$DerefTy> for $Ty {
18
- #[ inline( always) ]
19
- fn as_ref( & self ) -> & $DerefTy {
20
- unsafe { & * ( $paddr as * const _) }
21
- }
22
- }
23
- ) +
4
+ $( #[ $doc: meta] ) *
5
+ pub struct $Ty: ident => $paddr: expr_2021
6
+ $( , $DerefTy: ty) + ;
7
+ ) +
8
+ ) => {
9
+ $(
10
+ $( #[ $doc] ) *
11
+ #[ allow( non_camel_case_types) ]
12
+ pub struct $Ty {
13
+ _private: ( ) ,
14
+ }
15
+
16
+ $(
17
+ impl core:: ops:: Deref for $Ty {
18
+ type Target = $DerefTy;
19
+
20
+ #[ inline( always) ]
21
+ fn deref( & self ) -> & Self :: Target {
22
+ unsafe { & * ( $paddr as * const _) }
23
+ }
24
+ }
25
+
26
+ impl core:: convert:: AsRef <$DerefTy> for $Ty {
27
+ #[ inline( always) ]
28
+ fn as_ref( & self ) -> & $DerefTy {
29
+ unsafe { & * ( $paddr as * const _) }
30
+ }
31
+ }
32
+ ) +
24
33
) +
25
34
} ;
26
35
}
You can’t perform that action at this time.
0 commit comments