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