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 in rustc_typeck::check::method::suggest::<impl rustc_typeck::check::FnCtxt>::report_method_error #60713

Closed
jethrogb opened this issue May 10, 2019 · 1 comment · Fixed by #60720
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

@jethrogb
Copy link
Contributor

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   6: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   7: rust_begin_unwind
             at src/libstd/panicking.rs:308
   8: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   9: core::panicking::panic
             at src/libcore/panicking.rs:49
  10: rustc_typeck::check::method::suggest::<impl rustc_typeck::check::FnCtxt>::report_method_error
  11: rustc_typeck::check::FnCtxt::check_expr_kind
  12: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  13: rustc_typeck::check::FnCtxt::check_decl_initializer
  14: rustc_typeck::check::FnCtxt::check_decl_local
  15: rustc_typeck::check::FnCtxt::check_stmt
  16: rustc_typeck::check::FnCtxt::check_block_with_expected
  17: rustc_typeck::check::FnCtxt::check_expr_kind
  18: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  19: rustc_typeck::check::FnCtxt::check_return_expr
  20: rustc_typeck::check::check_fn
  21: rustc::ty::context::GlobalCtxt::enter_local
  22: rustc_typeck::check::typeck_tables_of
  23: rustc::ty::query::__query_compute::typeck_tables_of
  24: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::typeck_tables_of>::compute
  25: rustc::dep_graph::graph::DepGraph::with_task_impl
  26: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  27: rustc::ty::<impl rustc::ty::context::TyCtxt>::par_body_owners
  28: rustc_typeck::check::typeck_item_bodies
  29: rustc::ty::query::__query_compute::typeck_item_bodies
  30: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::typeck_item_bodies>::compute
  31: rustc::dep_graph::graph::DepGraph::with_task_impl
  32: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  33: rustc::util::common::time
  34: rustc_typeck::check_crate
  35: rustc_interface::passes::analysis
  36: rustc::ty::query::__query_compute::analysis
  37: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::analysis>::compute
  38: rustc::dep_graph::graph::DepGraph::with_task_impl
  39: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  40: rustc::ty::context::tls::enter_global
  41: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  42: rustc_interface::passes::create_global_ctxt::{{closure}}
  43: rustc_interface::interface::run_compiler_in_existing_thread_pool
  44: std::thread::local::LocalKey<T>::with
  45: scoped_tls::ScopedKey<T>::set
  46: syntax::with_globals
query stack during panic:
#0 [typeck_tables_of] processing `<types::base::TypeKind as types::base::GraphQLType<__S>>::meta`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack

Encountered while trying to produce a reduced test case for #58840. Will add source code later.

@varkor varkor added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label May 10, 2019
@jethrogb
Copy link
Contributor Author

# Cargo.toml
[package]
name = "juniper"
version = "0.11.1"

[dependencies.juniper_codegen]
version = "=0.11.1"
// src/lib.rs
#[macro_use]
extern crate juniper_codegen;
mod value {
    mod scalar {
        pub trait ScalarValue {}
        pub trait ScalarRefValue<'a> {}
    }
    pub use self::scalar::{
        DefaultScalarValue, ParseScalarResult, ParseScalarValue, ScalarRefValue, ScalarValue,
    };
}
mod ast {
    pub trait FromInputValue<S = DefaultScalarValue>: Sized {}
    pub trait ToInputValue<S = DefaultScalarValue>: Sized {}
}
mod executor {
    use schema::meta::{
        Argument, DeprecationStatus, EnumMeta, EnumValue, Field, InputObjectMeta, InterfaceMeta,
    };
    pub struct Registry<'r, DefaultScalarValue> {
        types: FnvHashMap,
    }
    impl<'r, S> Registry<'r, S>
    where
        S: 'r,
    {
        pub fn build_enum_type(&mut self) -> EnumMeta<'r, S> {
            unimplemented!()
        }
    }
}
mod schema {
    pub mod meta {
        pub struct EnumMeta<'a, S> {
            pub name: Cow,
            pub description: Option<String>,
            pub values: VecEnumValue,
            pub try_parse_fn: fn() -> bool,
        }
    }
}
mod types {
    pub mod base {
        use value::{DefaultScalarValue, Object, ScalarRefValue, ScalarValue, Value};
        #[doc = " of a type."]
        #[derive(Clone, Eq, PartialEq, Debug, GraphQLEnumInternal)]
        pub enum TypeKind {
            NonNull,
        }
        pub trait GraphQLType<S = DefaultScalarValue>: Sized
        where
            S: ScalarValue,
            for<'b> &'b S: ScalarRefValue<'b>,
        {
        }
    }
}
use ast::{FromInputValue, ToInputValue};
use executor::Registry;
use types::base::GraphQLType;
use value::{ScalarRefValue, ScalarValue};

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 10, 2019
Centril added a commit to Centril/rust that referenced this issue May 11, 2019
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

Successfully merging a pull request may close this issue.

3 participants