Skip to main content

INVALID_RUNTIME_SYMBOL_DEFINITIONS

Static INVALID_RUNTIME_SYMBOL_DEFINITIONS 

Source
pub static INVALID_RUNTIME_SYMBOL_DEFINITIONS: &Lint
Expand description

The invalid_runtime_symbol_definitions lint checks the signature of items whose symbol name is a runtime symbol expected by core differs significantly from the expected signature (like mismatch ABI, mismatch C variadics, mismatch argument count, missing return type, …).

§Example

#[unsafe(no_mangle)]
 pub fn strlen() {} // invalid definition of the `strlen` function

{{produces}}

§Explanation

Up-most care is required when defining runtime symbols assumed and used by the standard library. They must follow the C specification, not use any standard-library facility or undefined behavior may occur.

The symbols currently checked are memcpy, memmove, memset, memcmp, bcmp and strlen.


  1. https://doc.rust-lang.org/core/index.html#how-to-use-the-core-library