Repository: rust
Issue: Unexpected panic building debug target for tonic crate, on armv7
Labels: I-ICE,A-metadata,O-Arm,T-compiler,C-bug

`cargo build` fails with a compiler error when compiling the tonic crate on a Raspberry Pi (armv7). `cargo build --release` succeeds, and building a debug target succeeds on other architectures.

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.

http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/

-->

### Code
`tonic = "0.2"` is a dependency.

Tonic's state in Cargo.lock is:
```
[[package]]
name = "tonic"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4afef9ce97ea39593992cf3fa00ff33b1ad5eb07665b31355df63a690e38c736"
```
### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.44.1 (c7087fe00 2020-06-17)
binary: rustc
commit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7
commit-date: 2020-06-17
host: armv7-unknown-linux-gnueabihf
release: 1.44.1
LLVM version: 9.0
```

### Error output

```
cargo build
   Compiling tonic v0.2.1
thread 'rustc' panicked at 'no name in item_ident', src/librustc_metadata/rmeta/decoder.rs:660:24
stack backtrace:
   0: 0x7198f0bc - backtrace::backtrace::libunwind::trace::h11ac3ac0d74302ad
                       at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: 0x7198f0bc - backtrace::backtrace::trace_unsynchronized::hdf62c917e9b2ef6e
                       at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: 0x7198f0bc - std::sys_common::backtrace::_print_fmt::h0bfe64f9222ce2f3
                       at src/libstd/sys_common/backtrace.rs:78
   3: 0x7198f0bc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1215cde72a82cc12
                       at src/libstd/sys_common/backtrace.rs:59
   4: 0x719c3a38 - core::fmt::write::h6236afb532da25eb
                       at src/libcore/fmt/mod.rs:1069
   5: 0x71981200 - std::io::Write::write_fmt::h9a6af9b5531b16e1
                       at src/libstd/io/mod.rs:1504
   6: 0x71993c5c - std::sys_common::backtrace::_print::h4580c18962130b5c
                       at src/libstd/sys_common/backtrace.rs:62
   7: 0x71993c5c - std::sys_common::backtrace::print::he77ad506192e88b6
                       at src/libstd/sys_common/backtrace.rs:49
   8: 0x71993c5c - std::panicking::default_hook::{{closure}}::h4563d9a366d32d4d
                       at src/libstd/panicking.rs:198
   9: 0x71993914 - std::panicking::default_hook::h73d18278dcd23830
                       at src/libstd/panicking.rs:218
  10: 0x71d88680 - rustc_driver::report_ice::hdee5593caf9f2a4d
  11: 0x71994374 - std::panicking::rust_panic_with_hook::h164a10eb665809d3
                       at src/libstd/panicking.rs:515
  12: 0x71993fa8 - rust_begin_unwind
                       at src/libstd/panicking.rs:419
  13: 0x719c001c - core::panicking::panic_fmt::hc42ca5828f8f3331
                       at src/libcore/panicking.rs:111
  14: 0x719bfc60 - core::option::expect_failed::h7c9d5072a576e290
                       at src/libcore/option.rs:1260
  15: 0x74c1a4b0 - rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::item_ident::h1e7a5981242482de
  16: 0x74b00928 - <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::hb1963ac093435d67
  17: 0x74c15e3c - rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_metadata::creader::CStore>::struct_field_names_untracked::h6efd1899fe2b5069
  18: 0x73fbf648 - rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor::build_reduced_graph_for_external_crate_res::hecbbde89bbee3fda
  19: 0x7404df24 - rustc_resolve::Resolver::resolutions::h2f6f7d07f53b570d
  20: 0x74037e24 - rustc_resolve::imports::<impl rustc_resolve::Resolver>::resolve_ident_in_module_unadjusted_ext::hdb8823839984132b
  21: 0x74050700 - rustc_resolve::Resolver::resolve_ident_in_module_ext::h80b7134a6bc040fc
  22: 0x7403ac48 - rustc_resolve::imports::ImportResolver::resolve_import::{{closure}}::hf0d99a9e9db6637d
  23: 0x73f99c88 - rustc_resolve::imports::ImportResolver::resolve_imports::h5e2c840b70dbf842
  24: 0x7403cc50 - rustc_resolve::macros::<impl rustc_expand::base::Resolver for rustc_resolve::Resolver>::resolve_imports::h9e73e7e41f49dc0e
  25: 0x74dd07c4 - rustc_expand::expand::MacroExpander::fully_expand_fragment::h85c4caf18e2b912c
  26: 0x74dcffac - rustc_expand::expand::MacroExpander::expand_crate::he8d946de4a244787
  27: 0x7203d398 - rustc_session::utils::<impl rustc_session::session::Session>::time::h9ea925d1846ab204
  28: 0x72097804 - rustc_interface::passes::configure_and_expand_inner::h68c79f1f5e94993d
  29: 0x7201e85c - rustc_interface::passes::configure_and_expand::{{closure}}::hd0f8d74f2054835e
  30: 0x72009ddc - rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new::ha7835f89edb6e576
  31: 0x72096b4c - rustc_interface::passes::configure_and_expand::hc941f962e455593c
  32: 0x720e80dc - rustc_interface::queries::Queries::expansion::h4b199728d4409dbd
  33: 0x71eb00f0 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h6a513a83086f1dc1
  34: 0x71d914c8 - scoped_tls::ScopedKey<T>::set::h14880974a2d9ed06
  35: 0x71d8ee20 - rustc_ast::attr::with_globals::hadcb0e7aba072992
  36: 0x71d9b0dc - std::sys_common::backtrace::__rust_begin_short_backtrace::hd86ffecd76139a10
  37: 0x71eb33f8 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7109e48681c2cee6
  38: 0x719a1748 - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h1c3beb23b66aaaa9
                       at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
  39: 0x719a1748 - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h97bc9ba054374f8f
                       at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
  40: 0x719a1748 - std::sys::unix::thread::Thread::new::thread_start::h4bc05a65c7f95744
                       at src/libstd/sys/unix/thread.rs:87

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.44.1 (c7087fe00 2020-06-17) running on armv7-unknown-linux-gnueabihf

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `tonic`.

To learn more, run the command again with --verbose.
```

</p>
</details>