Skip to content

ICE: compiler/rustc_middle/src/hir/map/mod.rs:764:18: expected item, found trait method #83512

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

Closed
chengniansun opened this issue Mar 26, 2021 · 0 comments · Fixed by #86401
Closed
Labels
C-bug Category: This is a bug. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

trait Foo {
    #[doc(keyword = "match")]
    fn quux() {}
}

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (52e3dffa5 2021-03-25)
binary: rustc
commit-hash: 52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07
commit-date: 2021-03-25
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

error[E0658]: `#[doc(keyword)]` is experimental
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:5
  |
2 |     #[doc(keyword = "match")]
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #51315 <https://github.com/rust-lang/rust/issues/51315> for more information
  = help: add `#![feature(doc_keyword)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | / trait Foo {
2 | |     #[doc(keyword = "match")]
3 | |     fn quux() {}
4 | | }
  | |_^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_middle/src/hir/map/mod.rs:764:18: expected item, found trait method quux in Foo::quux (hir_id=HirId { owner: DefId(0:4 ~ perses_node_priority_with_dfs_delta_reduced_mutant[317d]::Foo::quux), local_id: 0 })

thread 'rustc' panicked at 'Box<Any>', /rustc/52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07/library/std/src/panic.rs:59:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.53.0-nightly (52e3dffa5 2021-03-25) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_mod_attrs] checking attributes in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.
Backtrace

error[E0658]: `#[doc(keyword)]` is experimental
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:5
  |
2 |     #[doc(keyword = "match")]
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #51315 <https://github.com/rust-lang/rust/issues/51315> for more information
  = help: add `#![feature(doc_keyword)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | / trait Foo {
2 | |     #[doc(keyword = "match")]
3 | |     fn quux() {}
4 | | }
  | |_^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_middle/src/hir/map/mod.rs:764:18: expected item, found trait method quux in Foo::quux (hir_id=HirId { owner: DefId(0:4 ~ perses_node_priority_with_dfs_delta_reduced_mutant[317d]::Foo::quux), local_id: 0 })

thread 'rustc' panicked at 'Box<Any>', /rustc/52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07/library/std/src/panic.rs:59:5
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_middle::hir::map::Map::expect_item
   8: rustc_passes::check_attr::CheckAttrVisitor::check_attributes
   9: rustc_middle::hir::map::Map::visit_item_likes_in_module
  10: rustc_passes::check_attr::check_mod_attrs
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  12: rustc_query_system::query::plumbing::force_query_with_job
  13: rustc_query_system::query::plumbing::get_query_impl
  14: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_mod_attrs
  15: std::panic::catch_unwind
  16: rustc_session::utils::<impl rustc_session::session::Session>::time
  17: rustc_interface::passes::analysis
  18: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  19: rustc_data_structures::stack::ensure_sufficient_stack
  20: rustc_query_system::query::plumbing::force_query_with_job
  21: rustc_query_system::query::plumbing::get_query_impl
  22: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  23: rustc_interface::passes::QueryContext::enter
  24: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  25: rustc_span::with_source_map
  26: rustc_interface::interface::create_compiler_and_run
  27: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.53.0-nightly (52e3dffa5 2021-03-25) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_mod_attrs] checking attributes in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.

@chengniansun chengniansun 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 Mar 26, 2021
@jyn514 jyn514 added requires-nightly This issue requires a nightly compiler in some way. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 26, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Mar 26, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 27, 2021
FabianWolff added a commit to FabianWolff/rust that referenced this issue Jun 17, 2021
@bors bors closed this as completed in 0274401 Jun 18, 2021
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. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants