Repository: rust
Issue: Rust compiler crashes on simple wgpu project
Labels: I-ICE,T-compiler,C-bug,S-needs-repro

<!--
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

```Rust
https://www.mediafire.com/folder/f321nvh587za9/rust_wgpu_error_files

place both of the files at src/
```


### 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.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-pc-windows-msvc
release: 1.75.0
LLVM version: 17.0.6
```

### Error output

```
   Compiling wgpu-test v0.1.0 (C:\Users\anast\Desktop\rust-projects\wgpu-test)
thread 'rustc' panicked at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\compiler\rustc_serialize\src\serialize.rs:129:9:
assertion failed: bytes[len] == STR_SENTINEL
stack backtrace:
   0:     0x7ffae07c3053 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h99d8f55dc77ea58e
   1:     0x7ffae07f5a3d - core::fmt::write::hde05c98aa8466c89
   2:     0x7ffae07b9951 - <std::io::IoSlice as core::fmt::Debug>::fmt::hfbd96d963048182d
   3:     0x7ffae07c2e5a - std::sys_common::backtrace::lock::h19b13d03fb733c4f
   4:     0x7ffae07c6329 - std::panicking::default_hook::h809e3ce877795dde
   5:     0x7ffae07c5feb - std::panicking::default_hook::h809e3ce877795dde
   6:     0x7ffacbc2f522 - <tracing_subscriber[6409740a17f48d06]::fmt::format::Writer>::write_fmt
   7:     0x7ffae07c6903 - std::panicking::rust_panic_with_hook::hac29101b109c3744
   8:     0x7ffae07c676b - <std::panicking::begin_panic_handler::StaticStrPayload as core::panic::PanicPayload>::take_box::h1529e0c3d6e161ce
   9:     0x7ffae07c3949 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h99d8f55dc77ea58e
  10:     0x7ffae07c64b4 - rust_begin_unwind
  11:     0x7ffae081ae57 - core::panicking::panic_fmt::ha2a0d31008962eb7
  12:     0x7ffae081af12 - core::panicking::panic::h5c1fb882612266eb
  13:     0x7ffacaa79c15 - <rustc_metadata[6fc6b9891f8c7c53]::rmeta::def_path_hash_map::DefPathHashMapRef as rustc_serialize[865eee8fdfaeb5da]::serialize::Decodable<rustc_metadata[6fc6b9891f8c7c53]::rmeta::decoder::DecodeContext>>::decode
  14:     0x7ffacaa79607 - <rustc_metadata[6fc6b9891f8c7c53]::rmeta::def_path_hash_map::DefPathHashMapRef as rustc_serialize[865eee8fdfaeb5da]::serialize::Decodable<rustc_metadata[6fc6b9891f8c7c53]::rmeta::decoder::DecodeContext>>::decode
  15:     0x7ffacaa2bd8e - <rustc_metadata[6fc6b9891f8c7c53]::rmeta::CrateHeader as rustc_serialize[865eee8fdfaeb5da]::serialize::Decodable<rustc_metadata[6fc6b9891f8c7c53]::rmeta::decoder::DecodeContext>>::decode
  16:     0x7ffacaa7f60c - <rustc_metadata[6fc6b9891f8c7c53]::rmeta::decoder::DecodeContext as rustc_type_ir[f40b78b38e38a0cb]::codec::TyDecoder>::decode_alloc_id
  17:     0x7ffacaa426e0 - <rustc_metadata[6fc6b9891f8c7c53]::rmeta::LazyTables as rustc_serialize[865eee8fdfaeb5da]::serialize::Decodable<rustc_metadata[6fc6b9891f8c7c53]::rmeta::decoder::DecodeContext>>::decode
  18:     0x7ffacaa41c68 - <rustc_metadata[6fc6b9891f8c7c53]::rmeta::LazyTables as rustc_serialize[865eee8fdfaeb5da]::serialize::Decodable<rustc_metadata[6fc6b9891f8c7c53]::rmeta::decoder::DecodeContext>>::decode
  19:     0x7ffacb84f6a6 - <rustc_metadata[6fc6b9891f8c7c53]::rmeta::TraitImpls as rustc_serialize[865eee8fdfaeb5da]::serialize::Decodable<rustc_metadata[6fc6b9891f8c7c53]::rmeta::decoder::DecodeContext>>::decode
  20:     0x7ffacaa40ea3 - <rustc_metadata[6fc6b9891f8c7c53]::rmeta::LazyTables as rustc_serialize[865eee8fdfaeb5da]::serialize::Decodable<rustc_metadata[6fc6b9891f8c7c53]::rmeta::decoder::DecodeContext>>::decode
  21:     0x7ffacb861c7f - <rustc_metadata[6fc6b9891f8c7c53]::creader::CStore>::from_tcx
  22:     0x7ffacb85d3ef - <rustc_metadata[6fc6b9891f8c7c53]::creader::CStore>::from_tcx
  23:     0x7ffacb85e431 - <rustc_metadata[6fc6b9891f8c7c53]::creader::CStore>::from_tcx
  24:     0x7ffacb85e431 - <rustc_metadata[6fc6b9891f8c7c53]::creader::CStore>::from_tcx
  25:     0x7ffacb85e431 - <rustc_metadata[6fc6b9891f8c7c53]::creader::CStore>::from_tcx
  26:     0x7ffacb85e431 - <rustc_metadata[6fc6b9891f8c7c53]::creader::CStore>::from_tcx
  27:     0x7ffacaa4c904 - <rustc_metadata[6fc6b9891f8c7c53]::creader::CrateLoader>::maybe_process_path_extern
  28:     0x7ffacb261898 - <rustc_resolve[e25009528610c42]::Segment as core[94f19dc4588870f6]::convert::From<&rustc_ast[e4c3c1853c306dc5]::ast::PathSegment>>::from
  29:     0x7ffacb23e7cb - <rustc_ast_lowering[3e995d46624aad7]::index::NodeCollector as rustc_hir[6c7798e1a793feda]::intravisit::Visitor>::visit_trait_ref
  30:     0x7ffacb24d5e7 - <rustc_resolve[e25009528610c42]::Resolver as rustc_expand[3c4d18453948ed29]::base::ResolverExpand>::resolve_imports
  31:     0x7ffacb90746e - <rustc_expand[3c4d18453948ed29]::expand::MacroExpander>::fully_expand_fragment
  32:     0x7ffacaaac86c - <rustc_expand[3c4d18453948ed29]::expand::MacroExpander>::expand_crate
  33:     0x7ffac7e11c25 - rustc_interface[845e99c2fcb4bb36]::interface::parse_check_cfg
  34:     0x7ffac7e211f3 - rustc_interface[845e99c2fcb4bb36]::passes::resolver_for_lowering
  35:     0x7ffaca8546bd - rustc_query_impl[70f5d3af722ab40a]::profiling_support::alloc_self_profile_query_strings
  36:     0x7ffaca81e099 - rustc_traits[18d67eec7ae4404]::type_op::type_op_normalize_fn_sig
  37:     0x7ffaca88ccec - rustc_query_impl[70f5d3af722ab40a]::profiling_support::alloc_self_profile_query_strings
  38:     0x7ffaca8c0f24 - rustc_query_impl[70f5d3af722ab40a]::profiling_support::alloc_self_profile_query_strings
  39:     0x7ffaca8928a1 - rustc_query_impl[70f5d3af722ab40a]::profiling_support::alloc_self_profile_query_strings
  40:     0x7ffac7ddf286 - rustc_driver_impl[b4ac4ed7e8bb44fd]::args::arg_expand_all
  41:     0x7ffac7ddd56f - rustc_driver_impl[b4ac4ed7e8bb44fd]::args::arg_expand_all
  42:     0x7ffac7dcf4bb - rustc_driver_impl[b4ac4ed7e8bb44fd]::args::arg_expand_all
  43:     0x7ffac7ddf101 - rustc_driver_impl[b4ac4ed7e8bb44fd]::args::arg_expand_all
  44:     0x7ffac7dda6df - rustc_driver_impl[b4ac4ed7e8bb44fd]::args::arg_expand_all
  45:     0x7ffac7dd2861 - rustc_driver_impl[b4ac4ed7e8bb44fd]::args::arg_expand_all
  46:     0x7ffae07d8b6c - std::sys::windows::thread::Thread::new::h7b3ce3a09b163019
  47:     0x7ffb57087344 - BaseThreadInitThunk
  48:     0x7ffb58f626b1 - RtlUserThreadStart

error: 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.75.0 (82e1608df 2023-12-21) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
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>

```
<backtrace>
```

</p>
</details>