File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 17
17
/// Panics if executed in const context, or triggers a build error if not.
18
18
#[ inline( never) ]
19
19
#[ cold]
20
- #[ no_mangle ]
20
+ #[ export_name = "rust_build_error" ]
21
21
#[ track_caller]
22
22
pub const fn build_error ( msg : & ' static str ) -> ! {
23
23
panic ! ( "{}" , msg) ;
24
24
}
25
25
26
26
#[ cfg( CONFIG_RUST_BUILD_ASSERT_WARN ) ]
27
- #[ link_section = ".gnu.warning.build_error " ]
27
+ #[ link_section = ".gnu.warning.rust_build_error " ]
28
28
#[ used]
29
29
static BUILD_ERROR_WARNING : [ u8 ; 45 ] = * b"call to build_error present after compilation" ;
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ macro_rules! define_read {
68
68
///
69
69
/// If the offset is not known at compile time, the build will fail.
70
70
$( #[ $attr] ) *
71
+ #[ inline]
71
72
pub fn $name( & self , offset: usize ) -> $type_name {
72
73
Self :: check_offset:: <$type_name>( offset) ;
73
74
let ptr = self . ptr. wrapping_add( offset) ;
@@ -100,6 +101,7 @@ macro_rules! define_write {
100
101
///
101
102
/// If the offset is not known at compile time, the build will fail.
102
103
$( #[ $attr] ) *
104
+ #[ inline]
103
105
pub fn $name( & self , value: $type_name, offset: usize ) {
104
106
Self :: check_offset:: <$type_name>( offset) ;
105
107
let ptr = self . ptr. wrapping_add( offset) ;
@@ -164,6 +166,7 @@ impl<const SIZE: usize> IoMem<SIZE> {
164
166
}
165
167
}
166
168
169
+ #[ inline]
167
170
const fn offset_ok < T > ( offset : usize ) -> bool {
168
171
let type_size = core:: mem:: size_of :: < T > ( ) ;
169
172
if let Some ( end) = offset. checked_add ( type_size) {
@@ -183,6 +186,7 @@ impl<const SIZE: usize> IoMem<SIZE> {
183
186
}
184
187
}
185
188
189
+ #[ inline]
186
190
const fn check_offset < T > ( offset : usize ) {
187
191
crate :: build_assert!( Self :: offset_ok:: <T >( offset) , "IoMem offset overflow" ) ;
188
192
}
You can’t perform that action at this time.
0 commit comments