Skip to content

Commit 0df88b7

Browse files
committed
rust: allow invalid_runtime_symbol_definitions lint for Rust >= 1.98
Starting with Rust 1.98.0 (expected 2026-08-20), Rust is introducing a new deny-by-default lint which checks the signature of items whose symbol name is a runtime symbol expected by `core`: error: invalid definition of the runtime `strlen` symbol used by the standard library --> rust/uapi/uapi_generated.rs:13998:5 | 13998 | pub fn strlen(s: *const ffi::c_char) -> usize; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expected `unsafe extern "C" fn(*const i8) -> usize` found `unsafe extern "C" fn(*const u8) -> usize` = help: either fix the signature or remove any attributes like `#[unsafe(no_mangle)]`, `#[unsafe(export_name = "strlen")]`, or `#[link_name = "strlen"]` = note: `#[deny(invalid_runtime_symbol_definitions)]` on by default error: invalid definition of the runtime `strlen` symbol used by the standard library --> rust/bindings/bindings_generated.rs:19877:5 | 19877 | pub fn strlen(s: *const ffi::c_char) -> usize; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expected `unsafe extern "C" fn(*const i8) -> usize` found `unsafe extern "C" fn(*const u8) -> usize` = help: either fix the signature or remove any attributes like `#[unsafe(no_mangle)]`, `#[unsafe(export_name = "strlen")]`, or `#[link_name = "strlen"]` = note: `#[deny(invalid_runtime_symbol_definitions)]` on by default Thus `allow` the lint in `bindings` and `uapi`. Link: rust-lang/rust#155521 [1] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 40bc558 commit 0df88b7

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

rust/bindings/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#![feature(cfi_encoding)]
2323

2424
#[allow(dead_code)]
25+
#[allow(invalid_runtime_symbol_definitions)]
2526
#[allow(clippy::cast_lossless)]
2627
#[allow(clippy::ptr_as_ptr)]
2728
#[allow(clippy::ref_as_ptr)]

rust/uapi/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
clippy::ref_as_ptr,
1616
clippy::undocumented_unsafe_blocks,
1717
dead_code,
18+
invalid_runtime_symbol_definitions,
1819
missing_docs,
1920
non_camel_case_types,
2021
non_upper_case_globals,

0 commit comments

Comments
 (0)