Skip to content

internal compiler error: src/librustc/middle/stability.rs:768: encountered unmarked API: DefId(1/0:4216 ~ std[508b]::sys_common[0]::thread_info[0]::current_thread[0]) #58101

Closed
@bjorn3

Description

fn abc() {
    let thread = std::thread::thread_info::current_thread();
}

(Playground)

Errors:

   Compiling playground v0.0.1 (/playground)
error[E0603]: module `thread_info` is private
 --> src/lib.rs:2:31
  |
2 |     let thread = std::thread::thread_info::current_thread();
  |                               ^^^^^^^^^^^

error: internal compiler error: src/librustc/middle/stability.rs:768: encountered unmarked API: DefId(1/0:4216 ~ std[508b]::sys_common[0]::thread_info[0]::current_thread[0])
 --> src/lib.rs:2:18
  |
2 |     let thread = std::thread::thread_info::current_thread();
  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:543:9
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:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::span_bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::span_bug_fmt
  14: rustc::middle::stability::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::check_stability
  15: <rustc::middle::stability::Checker<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_path
  16: rustc::hir::intravisit::walk_expr
  17: rustc::hir::intravisit::walk_local
  18: rustc::hir::intravisit::walk_expr
  19: rustc::hir::intravisit::Visitor::visit_fn
  20: rustc::hir::intravisit::walk_item
  21: <rustc::middle::stability::Checker<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  22: rustc::hir::map::Map::visit_item_likes_in_module
  23: rustc::middle::stability::check_mod_unstable_api_usage
  24: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::check_mod_unstable_api_usage<'tcx>>::compute
  25: rustc::dep_graph::graph::DepGraph::with_task_impl
  26: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  27: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query
  28: rustc::middle::stability::check_unstable_api_usage
  29: rustc::util::common::time
  30: <std::thread::local::LocalKey<T>>::with
  31: rustc::ty::context::TyCtxt::create_and_enter
  32: rustc_driver::driver::compile_input
  33: rustc_driver::run_compiler_with_pool
  34: <scoped_tls::ScopedKey<T>>::set
  35: rustc_driver::run_compiler
  36: <scoped_tls::ScopedKey<T>>::set
query stack during panic:
#0 [check_mod_unstable_api_usage] checking for unstable API usage in top-level module
end of query stack
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0603`.

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.34.0-nightly (8a57831a4 2019-02-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib

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

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

Metadata

Assignees

Labels

A-stabilityArea: `#[stable]`, `#[unstable]` etc.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions