Skip to content

ICE in src/librustc/ty/query/plumbing.rs when compiling incrementally #59716

Closed
@jethrogb

Description

@jethrogb
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);
}

Metadata

Metadata

Assignees

Labels

A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions