Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE when running cargo test #94028

Closed
colin-grapl opened this issue Feb 15, 2022 · 1 comment
Closed

ICE when running cargo test #94028

colin-grapl opened this issue Feb 15, 2022 · 1 comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@colin-grapl
Copy link

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>

@colin-grapl colin-grapl added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 15, 2022
@Aaron1011 Aaron1011 added the A-incr-comp Area: Incremental compilation label Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants