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: type_alias_impl_trait + impl_trait_in_bindings 'called Option::unwrap() on a None value' #78722

Closed
DutchGhost opened this issue Nov 4, 2020 · 1 comment
Labels
C-bug Category: This is a bug. F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@DutchGhost
Copy link
Contributor

Code

#![feature(type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]

type F = impl core::future::Future<Output = u8>;

struct Bug {
    V1: [(); {
        fn concrete_use() -> F {
            async {}
        }
        let f: F = async { 1 };
        1
    }],
}

fn main() {
}

Meta

rustc --version --verbose:

rustc 1.49.0-nightly (338f939a8 2020-11-02)

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_middle/src/ty/mod.rs:2976:62
Backtrace

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_middle/src/ty/mod.rs:2976:62
stack backtrace:
   0: rust_begin_unwind
             at /rustc/338f939a8d77061896cd0a1ca87a2c6d1f4ec359/library/std/src/panicking.rs:495:5
   1: core::panicking::panic_fmt
             at /rustc/338f939a8d77061896cd0a1ca87a2c6d1f4ec359/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/338f939a8d77061896cd0a1ca87a2c6d1f4ec359/library/core/src/panicking.rs:50:5
   3: rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>::layout_raw_uncached
   4: rustc_middle::ty::layout::layout_raw
   5: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::layout_raw>::compute
   6: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   7: rustc_data_structures::stack::ensure_sufficient_stack
   8: rustc_query_system::query::plumbing::get_query_impl
   9: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt> as rustc_target::abi::LayoutOf>::layout_of
  10: <alloc::vec::Vec<T> as alloc::vec::SpecFromIter<T,I>>::from_iter
  11: <core::iter::adapters::ResultShunt<I,E> as core::iter::traits::iterator::Iterator>::next
  12: <alloc::vec::Vec<T> as alloc::vec::SpecFromIter<T,I>>::from_iter
  13: rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>::layout_raw_uncached
  14: rustc_middle::ty::layout::layout_raw
  15: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::layout_raw>::compute
  16: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  17: rustc_data_structures::stack::ensure_sufficient_stack
  18: rustc_query_system::query::plumbing::get_query_impl
  19: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::query::TyCtxtAt> as rustc_target::abi::LayoutOf>::layout_of
  20: rustc_mir::interpret::eval_context::InterpCx<M>::layout_of_local
  21: rustc_mir::interpret::place::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::eval_place
  22: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::run
  23: rustc_mir::const_eval::eval_queries::eval_to_allocation_raw_provider
  24: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_allocation_raw>::compute
  25: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  26: rustc_data_structures::stack::ensure_sufficient_stack
  27: rustc_query_system::query::plumbing::get_query_impl
  28: rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider
  29: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_const_value_raw>::compute
  30: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  31: rustc_data_structures::stack::ensure_sufficient_stack
  32: rustc_query_system::query::plumbing::get_query_impl
  33: rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider
  34: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_const_value_raw>::compute
  35: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  36: rustc_data_structures::stack::ensure_sufficient_stack
  37: rustc_query_system::query::plumbing::get_query_impl
  38: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  39: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  40: rustc_middle::ty::consts::Const::eval
  41: rustc_middle::ty::structural_impls::<impl rustc_middle::ty::fold::TypeFoldable for &rustc_middle::ty::TyS>::super_fold_with
  42: <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_ty
  43: rustc_data_structures::stack::ensure_sufficient_stack
  44: rustc_trait_selection::traits::project::normalize
  45: <rustc_infer::infer::InferCtxt as rustc_trait_selection::infer::InferCtxtExt>::partially_normalize_associated_types_in
  46: rustc_typeck::check::inherited::Inherited::normalize_associated_types_in
  47: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  48: rustc_infer::infer::InferCtxtBuilder::enter
  49: rustc_typeck::check::wfcheck::check_item_well_formed
  50: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_item_well_formed>::compute
  51: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  52: rustc_data_structures::stack::ensure_sufficient_stack
  53: rustc_query_system::query::plumbing::get_query_impl
  54: rustc_query_system::query::plumbing::ensure_query_impl
  55: rustc_data_structures::sync::par_for_each_in
  56: rustc_hir::hir::Crate::par_visit_all_item_likes
  57: rustc_session::session::Session::track_errors
  58: rustc_typeck::check_crate
  59: rustc_interface::passes::analysis
  60: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  61: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  62: rustc_data_structures::stack::ensure_sufficient_stack
  63: rustc_query_system::query::plumbing::get_query_impl
  64: rustc_interface::passes::QueryContext::enter
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.49.0-nightly (338f939a8 2020-11-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type bin

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

query stack during panic:
#0 [layout_raw] computing layout of `[static generator@src/main.rs:9:19: 9:21]`
#1 [layout_raw] computing layout of `std::future::from_generator::GenFuture<[static generator@src/main.rs:9:19: 9:21]>`
#2 [eval_to_allocation_raw] const-evaluating + checking `Bug::V1::{constant#0}`
#3 [eval_to_const_value_raw] simplifying constant for the type system `Bug::V1::{constant#0}`
#4 [eval_to_const_value_raw] simplifying constant for the type system `Bug::V1::{constant#0}`
#5 [check_item_well_formed] checking that `Bug` is well-formed
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors; 1 warning emitted

Some errors have detailed explanations: E0271, E0493.
For more information about an error, try `rustc --explain E0271`.
error: could not compile `playground`

@DutchGhost DutchGhost 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 Nov 4, 2020
@jyn514 jyn514 added F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` requires-nightly This issue requires a nightly compiler in some way. labels Nov 4, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Nov 8, 2020
@Alexendoo
Copy link
Member

No longer ICEs since #78809

Alexendoo added a commit to Alexendoo/rust that referenced this issue Nov 16, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Nov 19, 2020
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. F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Development

No branches or pull requests

4 participants