Description
Error:
error: internal compiler error: librustc_mir/borrow_check/mod.rs:1868: encountered mutable promoted
thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:580:9
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: rustc::util::common::panic_hook
5: std::panicking::rust_panic_with_hook
6: std::panicking::begin_panic
7: rustc_errors::Handler::bug
8: rustc::session::opt_span_bug_fmt::{{closure}}
9: rustc::ty::context::tls::with_opt::{{closure}}
10: rustc::ty::context::tls::with_context_opt
11: rustc::ty::context::tls::with_opt
12: rustc::session::opt_span_bug_fmt
13: rustc::session::bug_fmt
14: rustc_mir::borrow_check::MirBorrowckCtxt::is_mutable
15: rustc_mir::borrow_check::MirBorrowckCtxt::access_place
16: <rustc_mir::borrow_check::MirBorrowckCtxt<'cx, 'gcx, 'tcx> as rustc_mir::dataflow::DataflowResultsConsumer<'cx, 'tcx>>::visit_statement_entry
17: rustc_mir::borrow_check::do_mir_borrowck
18: rustc::ty::context::tls::with_related_context
19: rustc::infer::InferCtxtBuilder::enter
20: rustc_mir::borrow_check::mir_borrowck
21: rustc::ty::query::__query_compute::mir_borrowck
22: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_borrowck<'tcx>>::compute
23: rustc::dep_graph::graph::DepGraph::with_task_impl
24: rustc::ty::context::tls::with_related_context
25: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
26: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
27: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_borrowck
28: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::par_body_owners
29: rustc::util::common::time
30: rustc::ty::context::tls::enter_context
31: <std::thread::local::LocalKey<T>>::with
32: rustc::ty::context::TyCtxt::create_and_enter
33: rustc_driver::driver::compile_input
34: rustc_driver::run_compiler_with_pool
35: <scoped_tls::ScopedKey<T>>::set
36: <scoped_tls::ScopedKey<T>>::set
37: syntax::with_globals
38: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
39: __rust_maybe_catch_panic
40: rustc_driver::run
41: rustc_driver::main
42: std::rt::lang_start::{{closure}}
43: std::panicking::try::do_call
44: __rust_maybe_catch_panic
45: std::rt::lang_start_internal
46: main
47: __libc_start_main
48: _start
query stack during panic:
#0 [mir_borrowck] processing `wire::util::buffer::tests::test_buffer_and_range_slice`
end of query stack
error: aborting due to previous error
For more information about this error, try `rustc --explain E0170`.
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.29.0-dev running on x86_64-unknown-linux-gnu
note: compiler flags: -C linker=/usr/local/google/home/cramertj/src/fuchsia/buildtools/linux-x64/clang/bin/clang -C link-arg=--target=x86_64-unknown-fuchsia -C link-arg=--sysroot=/usr/local/google/home/cramertj/src/fuchsia/out/release-x64/sdks/zircon_sysroot/arch/x64/sysroot -C opt-level=z -C lto=thin --crate-type bin
[5390/6330] ACTION //garnet/public/lib/fidl/rust/fidl:fidl_build(//build/toolchain/fuchsia:x64)
ninja: build stopped: subcommand failed.
This only happens after #52597 cc @oli-obk. The code that triggered this is here.