Skip to content

internal compiler error: unexpected panic for issue #35896 #46101

@gasabr

Description

@gasabr

I'm learning rust and diesel, while trying to get the diesel::association::BelongTo working on my table, I tried this code:

#[derive(Queryable, Identifiable, BelongsTo::User, Clone)]
pub struct Game {
    pub id: i32,
    pub name: String,
    pub admin: i32,
    pub pwd: Option<String>,
    pub messages_enabled: bool,
    pub private: bool,
    pub n_players: i32,
    pub status: String,
}

I expected to see this happen: Nothing, to be honest, I thought BelongsTo::<User> should work, and BelongsTo::User does not make any sense to me.

Instead, this happened: I got the error message telling me to report this bug.

Meta

rustc --version --verbose:

rustc 1.21.0 (3b72af97e 2017-10-09)
binary: rustc
commit-hash: 3b72af97e42989b2fe104d8edbaee123cdf7c58f
commit-date: 2017-10-09
host: x86_64-apple-darwin
release: 1.21.0
LLVM version: 4.0

Backtrace:

   Compiling gotgame v0.1.0 (file:///Users/gasabr/Coding/gotgame)
error: non-ident macro paths are experimental (see issue #35896)
  --> src/models.rs:47:35
   |
47 | #[derive(Queryable, Identifiable, BelongsTo::User, Clone)]
   |                                   ^^^^^^^^^^^^^^^

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: rustc 1.21.0 (3b72af97e 2017-10-09) running on x86_64-apple-darwin

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

thread 'rustc' panicked at 'Expected Def::Macro(..)', src/librustc_resolve/build_reduced_graph.rs:555:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::panicking::default_hook::{{closure}}
   2: std::panicking::default_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic
   5: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver<'a>>::get_macro
   6: rustc_resolve::macros::<impl syntax::ext::base::Resolver for rustc_resolve::Resolver<'a>>::resolve_invoc
   7: syntax::ext::expand::MacroExpander::expand
   8: syntax::ext::expand::MacroExpander::expand_crate
   9: rustc_driver::driver::phase_2_configure_and_expand::{{closure}}
  10: rustc_driver::driver::phase_2_configure_and_expand
  11: rustc_driver::driver::compile_input
  12: rustc_driver::run_compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions