Skip to content

ICE when running cargo test #94028

Closed
Closed
@colin-grapl

Description

@colin-grapl

Unfortunately, I can't reproduce this. I ran cargo clean so that I could start to narrow things down and it went away. It did happen multiple times in a row.

This command triggered it:
RUST_LOG=debug cargo test smoketest -- --nocapture

But this didn't:
cargo check --all-features --all-targets

Code

I can't post everything, but here's the line it's referencing. It seems totally benign.

"#0 [type_of] computing type of query::node_query::<impl at graph-query/src/query/node_query.rs:20:1: 91:2>::names::{opaque#0}"

That is referring to the new method. I assume the opaque type it's referring to is impl Into<String>. Maybe notable is that new is called only by another method default, and that is only called in tests.

pub struct NodeQuery {
    pub(crate) node_type: String,
    pub(crate) string_queries: StringQueries,
    pub(crate) forward_edge_queries: HashMap<String, Vec<Vec<NodeQueryCell>>>,
    pub(crate) reverse_edges: HashMap<String, String>,
}

impl NodeQuery {
    pub fn new(
        node_type: impl Into<String>,
        string_queries: StringQueries,
        forward_edge_queries: HashMap<String, Vec<Vec<NodeQueryCell>>>,
    ) -> Self {
        Self {
            node_type: node_type.into(),
            string_queries,
            forward_edge_queries,
            reverse_edges: HashMap::new(),
        }
    }


    pub fn new_cell(
        node_type: impl Into<String>,
        string_queries: StringQueries,
        forward_edge_queries: HashMap<String, Vec<Vec<NodeQueryCell>>>,
    ) -> NodeQueryCell {
        NodeQueryCell::from(Self::new(node_type, string_queries, forward_edge_queries))
    }

    pub fn default(node_type: impl Into<String>) -> Self {
        Self::new(
            node_type,
            StringQueries::default(),
            HashMap::new(),
        )
    }

    pub fn default_cell(node_type: impl Into<String>) -> NodeQueryCell {
        NodeQueryCell::from(Self::default(node_type))
    }

}

Meta

rustc --version --verbose:

rustc --version --verbose
rustc 1.58.1 (db9d1b20b 2022-01-20)
binary: rustc
commit-hash: db9d1b20bba1968c1ec1fc49616d4742c1725b4b
commit-date: 2022-01-20
host: x86_64-unknown-linux-gnu
release: 1.58.1
LLVM version: 13.0.0

Error output

   Compiling graph-query v0.1.0 (/home/colin/grapl-ws/grapl/src/rust/graph-query)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/compiler/rustc_hir/src/definitions.rs:452:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.58.1 (db9d1b20b 2022-01-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=1 -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [type_of] computing type of `query::node_query::<impl at graph-query/src/query/node_query.rs:20:1: 91:2>::names::{opaque#0}`
#1 [check_mod_item_types] checking item types in module `query::node_query`
end of query stack
error: could not compile `graph-query`

Backtrace

<backtrace>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-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