News for hackers. Stuff that matters.
Re:Rust Dependencies Scare Me by simonask on Saturday May 10, 2025 @02:58AM (#43943738)
I love this idea. There is some reminiscence of this in Rust, but it's opt in and based on convention, and only for `unsafe` code. Specifically, there's a trend of libraries using `#![deny(unsafe_code)]` (which will cause a compilation error if there is any `unsafe` code in the current crate), and then advertising this to their users. But there's no enforcement, and the library can still add `#[allow(unsafe_Code)]` to specific functions.

Perhaps a capability system could work like the current "feature" flags, but for the standard library, which would mean they could be computed transitively.

Re:Rust Dependencies Scare Me by QuartzLibrary on Saturday May 10, 2025 @06:07AM (#43944483)
FYI: `#[forbid(_)]` cannot be bypassed by the affected code (without a never-to-be-stabilised nightly feature meant to be used only in `std` macros).

https://doc.rust-lang.org/rustc/lints/levels.html

Re:Rust Dependencies Scare Me by simonask on Sunday May 11, 2025 @02:31AM (#43951854)
Ah right, forgot about forbid!