Skip to content

ICE - 'cannot access a scoped thread local variable without calling set first' #63283

Closed
@omerbenamram

Description

@omerbenamram

Hello,

After updating nightly version to 2019-07-31 (also fails on 2019-08-04), previously working code no longer compiles.
I can confirm that it compiles successfully on nightly-2019-07-30.

EDIT: Happens on debug aswell, also doesn't happen on macOS, but I'm not sure whether it's a transitive dependency or a windows specific thing.

Traceback:

thread 'rustc' panicked at 'cannot access a scoped thread local variable without calling `set` first', C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\scoped-tls-1.0.0\src\lib.rs:168:9                             
stack backtrace:                                                                                                                                                                                                                               
   0: std::sys_common::alloc::realloc_fallback                                                                                                                                                                                                 
   1: std::panicking::take_hook                                                                                                                                                                                                                
   2: std::panicking::take_hook                                                                                                                                                                                                                
   3: <rustc::ty::layout::LayoutCx<rustc::ty::query::TyCtxtAt> as rustc_target::abi::LayoutOf>::layout_of                                                                                                                                      
   4: std::panicking::rust_panic_with_hook                                                                                                                                                                                                     
   5: std::panicking::begin_panic                                                                                                                                                                                                              
   6: scoped_tls::ScopedKey<T>::with                                                                                                                                                                                                           
   7: syntax_pos::symbol::InternedString::intern                                                                                                                                                                                               
   8: rustc_plugin::registry::Registry::register_macro                                                                                                                                                                                         
   9: _rustc_plugin_registrar_c4a9050c6e5e6ab11ae9f48c182f5a1b__                                                                                                                                                                               
  10: <humantime::date::Rfc3339Timestamp as core::fmt::Debug>::fmt                                                                                                                                                                             
  11: <humantime::date::Rfc3339Timestamp as core::fmt::Debug>::fmt                                                                                                                                                                             
  12: rustc_interface::passes::BoxedResolver::to_expansion_result                                                                                                                                                                              
  13: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::compile                                                                                                                                                           
  14: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::register_plugins                                                                                                                                                  
  15: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt                                                                                                                                                                      
  16: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt                                                                                                                                                                      
  17: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt                                                                                                                                                                      
  18: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt                                                                                                                                                                      
  19: _rust_maybe_catch_panic                                                                                                                                                                                                                  
  20: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt                                                                                                                                                                      
  21: ZN244_$LT$std..error..$LT$impl$u20$core..convert..From$LT$alloc..string..String$GT$$u20$for$u20$alloc..boxed..Box$LT$dyn$u20$std..error..Error$u2b$core..marker..Sync$u2b$core..marker..Send$GT$$GT$..from..StringError$u20$as$u20$core..
mt..Display$GT$3fmt17                                                                                                                                                                                                                          
  22: std::sys::windows::thread::Thread::new                                                                                                                                                                                                   
  23: BaseThreadInitThunk                                                                                                                                                                                                                      
  24: RtlUserThreadStart                                                                                                                                                                                                                       
query stack during panic:                                                                                                                                                                                                                      
end of query stack                                                                                                                                                                                                                             
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.38.0-nightly (8a58268b5 2019-07-31) running on x86_64-pc-windows-msvc

note: compiler flags: -C opt-level=3 --crate-type lib

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

The repo is private so unfortunately i cannot link to it.
If there are any details that may help debugging this I will be happy to assist :)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-thread-localsArea: Thread local storage (TLS)C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions