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

Experienced compiler error with simple test project #83411

Closed
Folling opened this issue Mar 23, 2021 · 2 comments
Closed

Experienced compiler error with simple test project #83411

Folling opened this issue Mar 23, 2021 · 2 comments
Labels
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

@Folling
Copy link

Folling commented Mar 23, 2021

Code

Just the example code from the SDL2 crate

extern crate gl;
extern crate sdl2;

use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::video::GLProfile;

fn main() {
    let sdl_context = sdl2::init().unwrap();
    let video_subsystem = sdl_context.video().unwrap();

    let gl_attr = video_subsystem.gl_attr();
    gl_attr.set_context_profile(GLProfile::Core);
    gl_attr.set_context_version(3, 3);

    let window = video_subsystem
        .window("Window", 800, 600)
        .resizable()
        .opengl()
        .build()
        .unwrap();

    // Unlike the other example above, nobody created a context for your window, so you need to create one.
    let ctx = window.gl_create_context().unwrap();
    gl::load_with(|name| video_subsystem.gl_get_proc_address(name) as *const _);

    debug_assert_eq!(gl_attr.context_profile(), GLProfile::Core);
    debug_assert_eq!(gl_attr.context_version(), (3, 3));

    let mut event_pump = sdl_context.event_pump().unwrap();

    'running: loop {
        unsafe {
            gl::ClearColor(0.6, 0.0, 0.8, 1.0);
            gl::Clear(gl::COLOR_BUFFER_BIT);
        }

        window.gl_swap_window();
        for event in event_pump.poll_iter() {
            match event {
                Event::Quit { .. }
                | Event::KeyDown {
                    keycode: Some(Keycode::Escape),
                    ..
                } => break 'running,
                _ => {}
            }
        }
        ::std::thread::sleep(::std::time::Duration::new(0, 1_000_000_000u32 / 60));
    }
}

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (1705a7d64 2021-03-18)
binary: rustc
commit-hash: 1705a7d64b833d1c4b69958b0627bd054e6d764b
commit-date: 2021-03-18
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0

-- It does run on stable, just not on nightly

Error output

thread 'rustc' panicked at 'found unstable fingerprints for predicates_of(core[3998]::cmp::PartialEq)', /rustc/1705a7d64b833d1c4b69958b0627bd054e6d764b/compiler/rustc_query_system/src/query/plumbing.rs:593:5
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.52.0-nightly (1705a7d64 2021-03-18) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

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

query stack during panic:
#0 [predicates_of] computing predicates of `std::cmp::PartialEq`
#1 [typeck] type-checking `main`
end of query stack
error: could not compile `graphite`
Backtrace

``` 0: rust_begin_unwind at /rustc/1705a7d64b833d1c4b69958b0627bd054e6d764b/library/std/src/panicking.rs:493:5 1: std::panicking::begin_panic_fmt at /rustc/1705a7d64b833d1c4b69958b0627bd054e6d764b/library/std/src/panicking.rs:435:5 2: rustc_query_system::query::plumbing::incremental_verify_ich 3: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory 4: rustc_query_system::query::plumbing::get_query_impl 5: ::predicates_of 6: rustc_middle::ty::generics::GenericPredicates::instantiate_into 7: rustc_middle::ty::generics::GenericPredicates::instantiate 8: rustc_typeck::check::method::::lookup_method_in_trait 9: rustc_typeck::check::op::::lookup_op_method 10: rustc_typeck::check::op::::check_overloaded_binop 11: rustc_typeck::check::op::::check_binop 12: rustc_typeck::check::expr::::check_expr_with_expectation 13: rustc_typeck::check::expr::::check_expr_kind 14: rustc_typeck::check::expr::::check_expr_with_expectation 15: rustc_typeck::check::expr::::check_expr_kind 16: rustc_typeck::check::expr::::check_expr_with_expectation 17: rustc_typeck::check::fn_ctxt::checks::::check_block_with_expected 18: rustc_typeck::check::expr::::check_expr_with_expectation 19: rustc_typeck::check::_match::::check_match 20: rustc_typeck::check::expr::::check_expr_kind 21: rustc_typeck::check::expr::::check_expr_with_expectation 22: rustc_typeck::check::fn_ctxt::checks::::check_block_with_expected 23: rustc_typeck::check::expr::::check_expr_with_expectation 24: rustc_typeck::check::fn_ctxt::checks::::check_stmt 25: rustc_typeck::check::fn_ctxt::checks::::check_block_with_expected 26: rustc_typeck::check::expr::::check_expr_with_expectation 27: rustc_typeck::check::expr::::check_expr_kind 28: rustc_typeck::check::expr::::check_expr_with_expectation 29: rustc_typeck::check::fn_ctxt::checks::::check_stmt 30: rustc_typeck::check::fn_ctxt::checks::::check_block_with_expected 31: rustc_typeck::check::expr::::check_expr_with_expectation 32: rustc_typeck::check::expr::::check_return_expr 33: rustc_typeck::check::check::check_fn 34: rustc_infer::infer::InferCtxtBuilder::enter 35: rustc_typeck::check::typeck 36: rustc_middle::dep_graph::::with_deps 37: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl 38: rustc_query_system::query::plumbing::force_query_with_job 39: rustc_query_system::query::plumbing::get_query_impl 40: ::typeck 41: rustc_middle::ty::::par_body_owners 42: rustc_typeck::check::typeck_item_bodies 43: rustc_middle::dep_graph::::with_deps 44: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl 45: rustc_data_structures::stack::ensure_sufficient_stack 46: rustc_query_system::query::plumbing::force_query_with_job 47: rustc_query_system::query::plumbing::get_query_impl 48: ::typeck_item_bodies 49: rustc_session::utils::::time 50: rustc_typeck::check_crate 51: rustc_interface::passes::analysis 52: rustc_middle::dep_graph::::with_deps 53: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl 54: rustc_data_structures::stack::ensure_sufficient_stack 55: rustc_query_system::query::plumbing::force_query_with_job 56: rustc_query_system::query::plumbing::get_query_impl 57: ::analysis 58: rustc_interface::passes::QueryContext::enter 59: rustc_interface::queries::::enter 60: rustc_span::with_source_map 61: rustc_interface::interface::create_compiler_and_run 62: scoped_tls::ScopedKey::set ```

My cargo.toml looks as follows:

[package]
name = "graphite"
version = "0.1.0"
authors = ["Folling <coding@folling.de>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sdl2 = "0.34"
gl = "0.14.0"

Hope this helps!

@Folling Folling 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 Mar 23, 2021
@osa1
Copy link
Contributor

osa1 commented Mar 23, 2021

Seems like a duplicate of #83259.

@wesleywiser
Copy link
Member

Thanks for filing the bug report! We just shipped a patch release to work around this issue and are currently triaging related issues related to ensure each underlying problem gets resolved. Since this appears to be a duplicate of #83259, I'm going to close in favor of that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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