Repository: rust
Issue: `assertion failed: sentinel == STR_SENTINEL` at /compiler/rustc_serialize/src/opaque.rs:669
Labels: I-ICE,T-compiler,C-bug,E-needs-mcve

<!--
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

``` shell
git clone https://github.com/little-dude/netlink.git
git check out db36e94bff6646668e170162d8cfe4ddc0d4f446
cd netlink/netlink-packet-route
cargo expand --manifest-path ./Cargo.toml  rtnl::tc::buffer
```

### 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.56.1 (59eed8a2a 2021-11-01)
binary: rustc
commit-hash: 59eed8a2aac0230a8b53e89d4e99d55912ba6b35
commit-date: 2021-11-01
host: x86_64-unknown-linux-gnu
release: 1.56.1
LLVM version: 13.0.0
```

```
$ cargo expand --version
cargo-expand 1.0.15
```

### Error output

```
$ cargo expand --manifest-path ./Cargo.toml  rtnl::tc::buffer
    Checking netlink-packet-utils v0.5.0 (/home/wanglei01/opt/open/rust/netlink/netlink/netlink-packet-utils)
thread 'rustc' panicked at 'assertion failed: sentinel == STR_SENTINEL', /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/compiler/rustc_serialize/src/opaque.rs:669:9
note: run with `RUST_BACKTRACE=1` environment variable to display a 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.59.0-nightly (0b42deacc 2021-12-09) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
$ RUST_BACKTRACE=full cargo expand --manifest-path ./Cargo.toml  rtnl::tc::buffer
    Checking netlink-packet-utils v0.5.0 (/home/wanglei01/opt/open/rust/netlink/netlink/netlink-packet-utils)
thread 'rustc' panicked at 'assertion failed: sentinel == STR_SENTINEL', /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/compiler/rustc_serialize/src/opaque.rs:669:9
stack backtrace:
   0:     0x7f73f9cb335c - std::backtrace_rs::backtrace::libunwind::trace::hf7449935ead7573e
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f73f9cb335c - std::backtrace_rs::backtrace::trace_unsynchronized::h221aa2d88d72372a
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f73f9cb335c - std::sys_common::backtrace::_print_fmt::h1c77e8983e1df895
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f73f9cb335c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd4ec41a9a6b0d22c
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f73f9d1037c - core::fmt::write::h72801a82c94e6ff1
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/core/src/fmt/mod.rs:1149:17
   5:     0x7f73f9ca3a65 - std::io::Write::write_fmt::haf74340a8cbeaa88
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/io/mod.rs:1660:15
   6:     0x7f73f9cb6520 - std::sys_common::backtrace::_print::h2d15cd157796a64a
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f73f9cb6520 - std::sys_common::backtrace::print::h52d286d22e2398eb
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f73f9cb6520 - std::panicking::default_hook::{{closure}}::h6da08fba6306daf2
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/panicking.rs:211:50
   9:     0x7f73f9cb60cb - std::panicking::default_hook::h266f67a22e76b11a
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/panicking.rs:228:9
  10:     0x7f73fa7da291 - rustc_driver[feb513e6adc957d8]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f73f9cb6d39 - std::panicking::rust_panic_with_hook::he55698a957f4fb6d
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/panicking.rs:610:17
  12:     0x7f73f9cb67c2 - std::panicking::begin_panic_handler::{{closure}}::h01f453c3ac181895
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/panicking.rs:500:13
  13:     0x7f73f9cb3804 - std::sys_common::backtrace::__rust_end_short_backtrace::h675d77c6e5a3926d
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/sys_common/backtrace.rs:139:18
  14:     0x7f73f9cb6759 - rust_begin_unwind
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/panicking.rs:498:5
  15:     0x7f73f9c7ac21 - core::panicking::panic_fmt::h7b8580d81fcbbacd
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/core/src/panicking.rs:107:14
  16:     0x7f73f9c7ab6d - core::panicking::panic::h50b51d19800453c0
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/core/src/panicking.rs:48:5
  17:     0x7f73fc242116 - <alloc[1954047e53701c4d]::string::String as rustc_serialize[b3e713358750c20b]::serialize::Decodable<rustc_metadata[b7dbc791ee3c9388]::rmeta::decoder::DecodeContext>>::decode
  18:     0x7f73fcd50a90 - <rustc_metadata[b7dbc791ee3c9388]::locator::CrateLocator>::extract_one
  19:     0x7f73fcd5027e - <rustc_metadata[b7dbc791ee3c9388]::locator::CrateLocator>::extract_lib
  20:     0x7f73fcd4f89c - <rustc_metadata[b7dbc791ee3c9388]::locator::CrateLocator>::find_library_crate
  21:     0x7f73fcd4ed37 - <rustc_metadata[b7dbc791ee3c9388]::locator::CrateLocator>::maybe_load_library_crate
  22:     0x7f73fc1f598d - <rustc_metadata[b7dbc791ee3c9388]::creader::CrateLoader>::load
  23:     0x7f73fc1f2ae5 - <rustc_metadata[b7dbc791ee3c9388]::creader::CrateLoader>::maybe_resolve_crate
  24:     0x7f73fc1f2f10 - <rustc_metadata[b7dbc791ee3c9388]::creader::CrateLoader>::maybe_resolve_crate
  25:     0x7f73fb4360e3 - <rustc_metadata[b7dbc791ee3c9388]::creader::CrateLoader>::maybe_process_path_extern
  26:     0x7f73fbd545d8 - <rustc_resolve[ccbaf0437fbeefec]::Resolver>::extern_prelude_get
  27:     0x7f73fbd40268 - <rustc_resolve[ccbaf0437fbeefec]::Resolver>::early_resolve_ident_in_lexical_scope
  28:     0x7f73fbd50589 - <rustc_resolve[ccbaf0437fbeefec]::Resolver>::resolve_path_with_ribs
  29:     0x7f73fbd20530 - <rustc_resolve[ccbaf0437fbeefec]::imports::ImportResolver>::resolve_imports
  30:     0x7f73fc9a7440 - <rustc_resolve[ccbaf0437fbeefec]::Resolver as rustc_expand[2c7572397f580867]::base::ResolverExpand>::resolve_imports
  31:     0x7f73fc26d225 - <rustc_expand[2c7572397f580867]::expand::MacroExpander>::fully_expand_fragment
  32:     0x7f73fcd7c25a - <rustc_expand[2c7572397f580867]::expand::MacroExpander>::expand_crate
  33:     0x7f73fc6b2787 - <rustc_session[2680299e10ec9d86]::session::Session>::time::<core[cc79c391059f8e46]::result::Result<rustc_ast[f63e3a251842e941]::ast::Crate, rustc_errors[248f3f311c690252]::ErrorReported>, rustc_interface[4c4b5644b43577f1]::passes::configure_and_expand::{closure#1}>
  34:     0x7f73fc696d90 - rustc_interface[4c4b5644b43577f1]::passes::configure_and_expand
  35:     0x7f73fc69af6f - <rustc_interface[4c4b5644b43577f1]::queries::Queries>::expansion
  36:     0x7f73fc66e6ec - <rustc_interface[4c4b5644b43577f1]::interface::Compiler>::enter::<rustc_driver[feb513e6adc957d8]::run_compiler::{closure#1}::{closure#2}, core[cc79c391059f8e46]::result::Result<core[cc79c391059f8e46]::option::Option<rustc_interface[4c4b5644b43577f1]::queries::Linker>, rustc_errors[248f3f311c690252]::ErrorReported>>
  37:     0x7f73fc66b14d - rustc_span[dda57b1885b40b9a]::with_source_map::<core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>, rustc_interface[4c4b5644b43577f1]::interface::create_compiler_and_run<core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>, rustc_driver[feb513e6adc957d8]::run_compiler::{closure#1}>::{closure#1}>
  38:     0x7f73fc66f7ef - <scoped_tls[3fea4c3dcac147b1]::ScopedKey<rustc_span[dda57b1885b40b9a]::SessionGlobals>>::set::<rustc_interface[4c4b5644b43577f1]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[4c4b5644b43577f1]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>, rustc_driver[feb513e6adc957d8]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>>::{closure#0}::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>>
  39:     0x7f73fc66d995 - std[f24903a91e569aa2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[4c4b5644b43577f1]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[4c4b5644b43577f1]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>, rustc_driver[feb513e6adc957d8]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>>
  40:     0x7f73fc68dffa - <<std[f24903a91e569aa2]::thread::Builder>::spawn_unchecked<rustc_interface[4c4b5644b43577f1]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[4c4b5644b43577f1]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>, rustc_driver[feb513e6adc957d8]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[248f3f311c690252]::ErrorReported>>::{closure#1} as core[cc79c391059f8e46]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:     0x7f73f9cc1e23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4beb69a85f7fb16c
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/alloc/src/boxed.rs:1811:9
  42:     0x7f73f9cc1e23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hef865a799f44aaf2
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/alloc/src/boxed.rs:1811:9
  43:     0x7f73f9cc1e23 - std::sys::unix::thread::Thread::new::thread_start::hee0b2d4e2414fa96
                               at /rustc/0b42deaccc2cbe17a68067aa5fdb76104369e1fd/library/std/src/sys/unix/thread.rs:108:17
  44:     0x7f73f9bf34e2 - start_thread
  45:     0x7f73f9b0e5b3 - __clone
  46:                0x0 - <unknown>
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.59.0-nightly (0b42deacc 2021-12-09) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --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 `netlink-packet-utils`
```

</p>
</details>