Radar · Rust · Archive · Week 4 · Jan 19 – 25, 2026
`#[export_visibility = …]` Attribute RFC
Worth knowingcompiler
- What changed
- The RFC proposes adding an
#[export_visibility = …]attribute to address FFI tooling concerns and complement the-Zdefault-visibility=…flag. - Production impact
- The source does not say.
- Try it
- Read the RFC at the linked page to see the proposed syntax and rationale.
- Source
- github.com/rust-lang/rfcs/pull/3834
Understand it, then run it
Run it now
// This program shows how the new #[export_visibility] attribute would be used
// if it were available in Rust 1.98.1. Since it is not yet shipped, the code
// does not compile. The attribute is commented out to keep the example
// runnable with the current compiler.
fn main() {
// The following function would normally be exported because of #[no_mangle].
// With the new attribute, we could hide it:
//
// #[no_mangle]
// #[export_visibility = "hidden"]
// fn secret() {
// println!("You should not see this symbol in the binary");
// }
println!("Run `nm <binary>` to inspect exported symbols.");
}
What it printed when we ran it on Rust 1.98.1 (edition 2024)
Run `nm <binary>` to inspect exported symbols.
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed