Files
rust/tests/ui/cfg
Jacob Pratt 8365df9f23 Rollup merge of #158522 - Urgau:runtime-symbols-posix, r=chenyukang
Lint against invalid POSIX symbol definitions

This PR extends the `invalid_runtime_symbol_definitions` and `suspicious_runtime_symbol_definitions` lints to lint againts the following POSIX symbols:
 - I/O: `open`, `read`, `write`, `close`
 - Alloc: `malloc`, `realloc`, `free`
 - Program: `exit`

This is meant to address the multiple reports of users tripping over `std` symbols:
 - [Why does `#[no_mangle] fn open() {}` make `cargo t` hang?](https://users.rust-lang.org/t/why-does-no-mangle-fn-open-make-cargo-t-hang/103423)
 - [Pointer becomes misaligned in test with `no_mangle`](https://users.rust-lang.org/t/pointer-becomes-misaligned-in-test-with-no-mangle/126580)

Those symbols are defined in `std`, so as long as the `std` crate is imported (and we are on a UNIX-like target) we lint on those symbols.

Follow up to https://github.com/rust-lang/rust/pull/155521
2026-07-15 06:12:11 -04:00
..
2025-04-03 21:41:58 +00:00
2025-04-03 21:41:58 +00:00
2026-01-22 19:50:00 +01:00