Repository: rust
Issue: ICE 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:975:64
Labels: I-ICE,A-metadata,P-medium,A-visibility,T-compiler,A-incr-comp,C-bug,WG-incr-comp

With this `config.toml`:
```toml
# Includes one of the default files in src/bootstrap/defaults
profile = "compiler"
changelog-seen = 2

[build]
low-priority = true
```

Running `RUST_BACKTRACE=1 ./x.py test` on commit 6b9fbf212a06944ff23325d2d63215805dc3c6c3 without code changes:

```rust
[…]
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling rustc_serialize v0.0.0 (/home/simon/projects/rust/compiler/rustc_serialize)
   Compiling synstructure v0.12.4
   Compiling tracing-attributes v0.1.11
   Compiling rand_chacha v0.2.2
   Compiling rls-data v0.19.0
   Compiling parking_lot_core v0.6.2
   Compiling crossbeam-deque v0.7.3
   Compiling sha-1 v0.8.2
   Compiling md-5 v0.8.0
   Compiling chrono v0.4.15
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:975:64
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::get_visibility
   4: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::visibility
   5: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
   6: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   7: rustc_data_structures::stack::ensure_sufficient_stack
   8: rustc_query_system::query::plumbing::force_query_impl
   9: rustc_middle::ty::query::force_from_dep_node
  10: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepContext for rustc_middle::ty::context::TyCtxt>::try_force_from_dep_node
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  12: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  13: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  14: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green_and_read
  15: rustc_query_system::query::plumbing::ensure_query_impl
  16: rustc_passes::check_attr::CheckAttrVisitor::check_attributes
  17: <rustc_passes::check_attr::CheckAttrVisitor as rustc_hir::intravisit::Visitor>::visit_impl_item
  18: rustc_middle::hir::map::Map::visit_item_likes_in_module
  19: rustc_passes::check_attr::check_mod_attrs
  20: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_attrs>::compute
  21: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  22: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  23: rustc_data_structures::stack::ensure_sufficient_stack
  24: rustc_query_system::query::plumbing::get_query_impl
  25: rustc_query_system::query::plumbing::ensure_query_impl
  26: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  27: std::panicking::try
  28: rustc_session::utils::<impl rustc_session::session::Session>::time
  29: rustc_interface::passes::analysis
  30: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  31: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  32: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  33: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
  34: rustc_data_structures::stack::ensure_sufficient_stack
  35: rustc_query_system::query::plumbing::get_query_impl
  36: rustc_interface::passes::QueryContext::enter
  37: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  38: rustc_span::with_source_map
  39: rustc_interface::interface::create_compiler_and_run
  40: scoped_tls::ScopedKey<T>::set
  41: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.49.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C incremental -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C llvm-args=-import-instr-limit=10 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [visibility] computing visibility of `indexmap::IndexMap::S`
#1 [check_mod_attrs] checking attributes in module `collection_impls`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rustc_serialize`
```