Skip to content

ICE: trivial_numeric_casts when using SDL on nightly #42007

Closed
@andrewhickman

Description

@andrewhickman

Compiling this short snippet causes a compiler panic

extern crate sdl2;

use sdl2::mouse::MouseButton;

enum Input {
    MouseButton(MouseButton),
}

fn main() {}

Compiler version:

PS C:\Users\me\Documents\rust\sdltest> rustc --version --verbose
rustc 1.17.0 (56124baa9 2017-04-24)
binary: rustc
commit-hash: 56124baa9e73f28c0709e59e74783cf234a978cf
commit-date: 2017-04-24
host: x86_64-pc-windows-msvc
release: 1.17.0
LLVM version: 3.9

SDL version was 0.29.0.

Backtrace:

PS C:\Users\me\Documents\rust\sdltest> cargo +nightly build
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling sdl2-sys v0.27.3
   Compiling sdltest v0.1.0 (file:///C:/Users/me/Documents/rust/sdltest)
   Compiling sdl2 v0.29.1
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/blob/master/CONTRIBUTING.md#bug-reports

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'invalid lint-id `trivial_numeric_casts`', src\librustc\lint\context.rs:1322
stack backtrace:
   0: <std::time::SystemTimeError as core::fmt::Display>::fmt
   1: std::panicking::Location::line
   2: std::panicking::Location::line
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic_fmt
   5: std::panicking::begin_panic_fmt
   6: <unknown>
   7: rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::item_body_tables
   8: rustc_metadata::cstore_impl::provide
   9: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  10: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  11: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
  12: rustc_const_eval::eval::provide
  13: rustc::ty::maps::<impl rustc::ty::maps::queries::const_eval<'tcx>>::try_get
  14: rustc::ty::maps::TyCtxtAt::const_eval
  15: rustc::ty::layout::Layout::compute_uncached
  16: rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::needs_drop_uncached
  17: <rustc::util::common::Indenter as core::ops::Drop>::drop
  18: rustc::ty::layout::Layout::compute_uncached
  19: <rustc_lint::types::VariantSizeDifferences as rustc::lint::LateLintPass<'a, 'tcx>>::check_item
  20: rustc::lint::context::gather_attrs
  21: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  22: rustc::lint::context::check_crate
  23: rustc_driver::driver::count_nodes
  24: rustc_driver::driver::count_nodes
  25: rustc_driver::driver::compile_input
  26: rustc_driver::run_compiler
  27: <unknown>
  28: _rust_maybe_catch_panic
  29: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_impl_item
  30: std::sys::imp::thread::Thread::new
  31: BaseThreadInitThunk

error: Could not compile `sdltest`.

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions