Closed
Description
internal compiler error: src/librustc/ty/query/plumbing.rs:1195: Cannot force dep node: coherent_trait(core[ef5d]::ops[0]::drop[0]::Drop[0])
This went away after a cargo clean
. I'm sorry I can't reproduce this anymore. Also this was with a stage 1 compiler so who knows if it's real.
The code I was compiling:
use std::io::{self, *};
use std::sync::atomic::*;
fn main() {
std::thread::spawn(|| panic!()).join().unwrap_err();
println!("main after join");
}
#[test]
fn panic_in_write_doesnt_flush_in_drop() {
static WRITES: AtomicUsize = AtomicUsize::new(0);
struct PanicWriter;
impl Write for PanicWriter {
fn write(&mut self, _: &[u8]) -> io::Result<usize> {
WRITES.fetch_add(1, Ordering::SeqCst);
panic!();
}
fn flush(&mut self) -> io::Result<()> { Ok(()) }
}
std::thread::spawn(|| {
let mut writer = BufWriter::new(PanicWriter);
let _ = writer.write(b"hello world");
let _ = writer.flush();
}).join().unwrap_err();
assert_eq!(WRITES.load(Ordering::SeqCst), 1);
}