File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 30
30
/// ```
31
31
#[ macro_export]
32
32
macro_rules! map_field {
33
- ( $volatile: ident. $place: ident) => { {
33
+ ( $volatile: ident. $( $ place: ident) .+ ) => { {
34
34
// Simulate creating a reference to the field. This is done to make
35
35
// sure that the field is not potentially unaligned. The body of the
36
36
// if statement will never be executed, so it can never cause any UB.
37
37
if false {
38
- let _ref_to_field = & ( unsafe { & * $volatile. as_raw_ptr( ) . as_ptr( ) } ) . $place;
38
+ let _ref_to_field = & ( unsafe { & * $volatile. as_raw_ptr( ) . as_ptr( ) } ) . $( $ place) .+ ;
39
39
}
40
40
41
41
unsafe {
42
42
$volatile. map( |ptr| {
43
- core:: ptr:: NonNull :: new( core:: ptr:: addr_of_mut!( ( * ptr. as_ptr( ) ) . $place) ) . unwrap( )
43
+ core:: ptr:: NonNull :: new( core:: ptr:: addr_of_mut!( ( * ptr. as_ptr( ) ) . $( $ place) .+ ) ) . unwrap( )
44
44
} )
45
45
}
46
46
} } ;
You can’t perform that action at this time.
0 commit comments