compiler/rustc_error_codes/src/error_codes/E0756.md MARKDOWN 32 lines View on github.com → Search inside
1#### Note: this error code is no longer emitted by the compiler.23The `ffi_const` attribute was used on something other than a foreign function4declaration.56Erroneous code example:78```ignore (no longer emitted)9#![feature(ffi_const)]1011#[unsafe(ffi_const)] // error!12pub fn foo() {}13# fn main() {}14```1516The `ffi_const` attribute can only be used on foreign function declarations17which have no side effects except for their return value:1819```20#![feature(ffi_const)]2122extern "C" {23    #[unsafe(ffi_const)] // ok!24    pub fn strlen(s: *const i8) -> i32;25}26# fn main() {}27```2829You can get more information about it in the [unstable Rust Book].3031[unstable Rust Book]: https://doc.rust-lang.org/nightly/unstable-book/language-features/ffi-const.html

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.