Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion qt/private/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ struct Generated {
source: Vec<u8>,
}

#[expect(
unsafe_code,
reason = "std::env::set_var is unsafe; cxx-qt reads CLANG_FORMAT_BINARY in-process"
)]
fn main() -> ExitCode {
// SAFETY: the process is single-threaded here or the env lock is held.
// SAFETY: main has not spawned any thread yet, so nothing reads the environment concurrently.
unsafe { std::env::set_var("CLANG_FORMAT_BINARY", "") };
let args: Vec<String> = std::env::args().skip(1).collect();
match run(&args) {
Expand Down
Loading