Skip to content

RUSTFLAGS='-Z fuel=rand_core=0' leads to ICE: trimmed_def_paths constructed #79546

Closed
@andersk

Description

@andersk

Code

Cargo.toml

[package]
name = "fuel-test"
version = "0.1.0"

[dependencies]
rand_core = "0.5.1"

src/main.rs

fn main() {}

Building with env RUSTFLAGS='-Z fuel=rand_core=0' cargo build --release leads to error: internal compiler error: trimmed_def_paths constructed.

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (349b3b324 2020-11-29)
binary: rustc
commit-hash: 349b3b324dade7ca638091db93ba08bbc443c63d
commit-date: 2020-11-29
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

From bisecting previous nightlies, this is a regression between 2020-09-03 0d0f6b1 and 2020-09-04 c59199e. Within 0d0f6b1...c59199e, it looks like #73996 is related. Cc @da-x.

Error output

   Compiling rand_core v0.5.1
     Running `rustc --crate-name rand_core --edition=2018 /home/anders/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.5.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=4da4ae534686a8b2 -C extra-filename=-4da4ae534686a8b2 --out-dir /tmp/fuel-test/target/release/deps -L dependency=/tmp/fuel-test/target/release/deps --cap-lints allow -Z fuel=rand_core=0`
error: internal compiler error: trimmed_def_paths constructed
  |
  = note: delayed at    0: rustc_errors::Handler::delay_good_path_bug
             1: rustc_middle::ty::print::pretty::trimmed_def_paths
             2: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::trimmed_def_paths>::compute
             3: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
             4: rustc_data_structures::stack::ensure_sufficient_stack
             5: rustc_query_system::query::plumbing::get_query_impl
             6: <rustc_middle::ty::print::pretty::FmtPrinter<F> as rustc_middle::ty::print::Printer>::print_def_path
             7: rustc_middle::ty::print::pretty::<impl rustc_middle::ty::context::TyCtxt>::def_path_str_with_substs
             8: rustc_session::session::Session::consider_optimizing
             9: rustc_middle::ty::ReprOptions::new
            10: rustc_typeck::collect::adt_def
            11: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::adt_def>::compute
            12: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
            13: rustc_data_structures::stack::ensure_sufficient_stack
            14: rustc_query_system::query::plumbing::get_query_impl
            15: rustc_typeck::collect::type_of::type_of
            16: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::type_of>::compute
            17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
            18: rustc_data_structures::stack::ensure_sufficient_stack
            19: rustc_query_system::query::plumbing::get_query_impl
            20: <dyn rustc_typeck::astconv::AstConv>::res_to_ty
            21: <dyn rustc_typeck::astconv::AstConv>::ast_ty_to_ty_inner
            22: rustc_typeck::collect::type_of::type_of
            23: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::type_of>::compute
            24: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
            25: rustc_data_structures::stack::ensure_sufficient_stack
            26: rustc_query_system::query::plumbing::get_query_impl
            27: rustc_typeck::collect::impl_trait_ref
            28: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
            29: rustc_data_structures::stack::ensure_sufficient_stack
            30: rustc_query_system::query::plumbing::get_query_impl
            31: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::trait_id_of_impl
            32: rustc_typeck::collect::codegen_fn_attrs
            33: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::codegen_fn_attrs>::compute
            34: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
            35: rustc_data_structures::stack::ensure_sufficient_stack
            36: rustc_query_system::query::plumbing::get_query_impl
            37: rustc_query_system::query::plumbing::ensure_query_impl
            38: rustc_passes::check_attr::CheckAttrVisitor::check_attributes
            39: <rustc_passes::check_attr::CheckAttrVisitor as rustc_hir::intravisit::Visitor>::visit_impl_item
            40: rustc_middle::hir::map::Map::visit_item_likes_in_module
            41: rustc_passes::check_attr::check_mod_attrs
            42: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_attrs>::compute
            43: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
            44: rustc_data_structures::stack::ensure_sufficient_stack
            45: rustc_query_system::query::plumbing::get_query_impl
            46: rustc_query_system::query::plumbing::ensure_query_impl
            47: std::panic::catch_unwind
            48: rustc_session::utils::<impl rustc_session::session::Session>::time
            49: rustc_interface::passes::analysis
            50: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
            51: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
            52: rustc_data_structures::stack::ensure_sufficient_stack
            53: rustc_query_system::query::plumbing::get_query_impl
            54: rustc_interface::passes::QueryContext::enter
            55: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
            56: rustc_span::with_source_map
            57: scoped_tls::ScopedKey<T>::set
            58: std::sys_common::backtrace::__rust_begin_short_backtrace
            59: core::ops::function::FnOnce::call_once{{vtable.shim}}
            60: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/349b3b324dade7ca638091db93ba08bbc443c63d/library/alloc/src/boxed.rs:1327:9
                <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/349b3b324dade7ca638091db93ba08bbc443c63d/library/alloc/src/boxed.rs:1327:9
                std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/349b3b324dade7ca638091db93ba08bbc443c63d/library/std/src/sys/unix/thread.rs:71:17
            61: start_thread
            62: __GI___clone
          

thread 'rustc' panicked at 'no warnings or errors encountered even though `delayed_good_path_bugs` issued', compiler/rustc_errors/src/lib.rs:974:13
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.50.0-nightly (349b3b324 2020-11-29) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z fuel=rand_core=0 -C opt-level=3 -C embed-bitcode=no --crate-type lib

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

query stack during panic:
end of query stack
error: could not compile `rand_core`

Caused by:
  process didn't exit successfully: `rustc --crate-name rand_core --edition=2018 /home/anders/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.5.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=4da4ae534686a8b2 -C extra-filename=-4da4ae534686a8b2 --out-dir /tmp/fuel-test/target/release/deps -L dependency=/tmp/fuel-test/target/release/deps --cap-lints allow -Z fuel=rand_core=0` (exit code: 101)
Backtrace

thread 'rustc' panicked at 'no warnings or errors encountered even though `delayed_good_path_bugs` issued', compiler/rustc_errors/src/lib.rs:974:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/349b3b324dade7ca638091db93ba08bbc443c63d/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/349b3b324dade7ca638091db93ba08bbc443c63d/library/std/src/panicking.rs:435:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place
   7: rustc_span::with_source_map
   8: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions