You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 #155521
0 commit comments