Closed
Description
Ok, so rustc outputting to /dev/null is a bit pathelogical but it used to not ICE the compiler.
If you checkout
https://github.com/jethrogb/rust-reduce/tree/master/tests/suite/futures_core
and from dir tests/suite/futures_core run:
rustc --crate-type lib -o /dev/null input.rs
Then rustc is vexed:
error: failed to write bytecode to /dev/null.input.3a1fbbbh-cgu.3.rcgu.bc.z: Permission denied (os error 13)
error: failed to write bytecode to /dev/null.input.3a1fbbbh-cgu.0.rcgu.bc.z: Permission denied (os error 13)
error: failed to write bytecode to /dev/null.input.3a1fbbbh-cgu.4.rcgu.bc.z: Permission denied (os error 13)
error: failed to write bytecode to /dev/null.input.3a1fbbbh-cgu.7.rcgu.bc.z: Permission denied (os error 13)
thread '<unnamed>' panicked at 'src/librustc_codegen_ssa/back/write.rs:1544: worker thread panicked', src/librustc/util/bug.rs:37:26
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: rustc_driver::report_ice
6: std::panicking::rust_panic_with_hook
7: std::panicking::begin_panic
8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
9: rustc::ty::context::tls::with_opt::{{closure}}
10: rustc::ty::context::tls::with_context_opt
11: rustc::ty::context::tls::with_opt
12: rustc::util::bug::opt_span_bug_fmt
13: rustc::util::bug::bug_fmt
14: rustc_codegen_ssa::back::write::start_executing_work::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: internal compiler error: unexpected panic
(ICEs on stable and nightly)
The irony is that this is in the test suite of a rust code minimisation project.... 🤣 🤣 🤣
Let me minimise the reproduction of the problem...