-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Broken MIR" error on latest nightly #93209
Comments
I believe I'm encountering the same issue compiling
Backtrace
|
I'm seeing a similar error in capnproto-rust, which does not use any unstable features: error with backtrace
|
ditto when compile tonic error with backtrace
|
These are duplicates of #93161 and are already fixed on master, but not available on nightly yet. They will be fixed in the next nightly which will contain #93165. The most recent 2 nightlies have this issue:
We've checked yesterday that this PR fixes Please reopen this issue if tomorrow's nightly doesn't fix it. There are other ICEs that it does not fix but it's expected that the 3 above will be. |
Thanks! |
When compiling lsm-rs on latest rust I get a panic.
Meta
rustc --version --verbose
:Notes
This also happens on github actions, so I can reproduce it on multiple machines.
I can only reproduce this on the most recent nightly (2022-01-21), 2022-01-20 and earlier work fine.
The crate uses a few unstable features, that might trigger this.
Backtrace
Backtrace
``` Compiling lsm v0.2.0 (/home/kai/dev/lsm-rs) error: internal compiler error: compiler/rustc_mir_transform/src/generator.rs:755:13: Broken MIR: generator contains type &mut dyn InternalIterator in MIR, but typeck only knows about {ResumeTy, &mut DbIteratorInner, usize, std::option::Option<(u64, usize)>, &mut [Box], Box, dyn InternalIterator, DbIteratorInner, std::option::Option>, &std::option::Option>, &Vec, bool, Pin + std::marker::Send>>, ()} and [&mut async_iter::DbIteratorInner, usize, std::option::Option<(u64, usize)>] --> src/async_iter.rs:121:83 | 121 | async fn parse_iter(&mut self, offset: usize, min_kv: MinKV) -> (bool, MinKV) { | ___________________________________________________________________________________^ 122 | | // Split slices to make the borrow checker happy 123 | | let (prev, cur) = self.iterators[..].split_at_mut(offset); 124 | | let iter = &mut *cur[0]; ... | 158 | | } 159 | | } | |_____^
thread 'rustc' panicked at 'Box', /rustc/17d29dcdce9b9e838635eb0adefd9b8b1588410b/compiler/rustc_errors/src/lib.rs:1115:9
stack backtrace:
0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
1: std::panic::panic_any::<rustc_errors::ExplicitBug>
2: <rustc_errors::HandlerInner>::span_bug::<rustc_span::span_encoding::Span>
3: <rustc_errors::Handler>::span_bug::<rustc_span::span_encoding::Span>
4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, ()>
5: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
6: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
7: <rustc_mir_transform::generator::StateTransform as rustc_middle::mir::MirPass>::run_pass
8: rustc_mir_transform::pass_manager::run_passes
9: rustc_mir_transform::optimized_mir
10: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, &rustc_middle::mir::Body>
11: rustc_data_structures::stack::ensure_sufficient_stack::<(&rustc_middle::mir::Body, rustc_query_system::dep_graph::graph::DepNodeIndex), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::DefId, &rustc_middle::mir::Body>::{closure#3}>
12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, &rustc_middle::mir::Body>>
13: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
14: <rustc_middle::ty::context::TyCtxt>::generator_layout
15: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached
16: rustc_middle::ty::layout::layout_of
17: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<&rustc_middle::ty::TyS>, core::result::Result<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>, rustc_middle::ty::layout::LayoutError>>
18: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
20: core::iter::adapters::process_results::<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>, rustc_middle::ty::layout::LayoutError, <core::result::Result<alloc::vec::Vec<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>>, rustc_middle::ty::layout::LayoutError> as core::iter::traits::collect::FromIterator<core::result::Result<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>, rustc_middle::ty::layout::LayoutError>>>::from_iter<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>>::{closure#0}, alloc::vec::Vec<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>>>
21: core::iter::adapters::process_results::<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, alloc::vec::Vec<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>>, rustc_middle::ty::layout::LayoutError, <core::result::Result<rustc_index::vec::IndexVec<rustc_target::abi::VariantIdx, alloc::vec::Vec<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>>>, rustc_middle::ty::layout::LayoutError> as core::iter::traits::collect::FromIterator<core::result::Result<alloc::vec::Vec<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>>, rustc_middle::ty::layout::LayoutError>>>::from_iter<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>>::{closure#0}, rustc_index::vec::IndexVec<rustc_target::abi::VariantIdx, alloc::vec::Vec<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>>>>
22: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached
23: rustc_middle::ty::layout::layout_of
24: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<&rustc_middle::ty::TyS>, core::result::Result<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>, rustc_middle::ty::layout::LayoutError>>
25: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
27: rustc_middle::ty::layout::layout_of
28: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<&rustc_middle::ty::TyS>, core::result::Result<rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS>, rustc_middle::ty::layout::LayoutError>>
29: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
30: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
31: <rustc_mir_transform::const_prop::ConstProp as rustc_middle::mir::MirPass>::run_pass
32: rustc_mir_transform::pass_manager::run_passes
33: rustc_mir_transform::optimized_mir
34: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, &rustc_middle::mir::Body>
35: rustc_data_structures::stack::ensure_sufficient_stack::<(&rustc_middle::mir::Body, rustc_query_system::dep_graph::graph::DepNodeIndex), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::DefId, &rustc_middle::mir::Body>::{closure#3}>
36: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, &rustc_middle::mir::Body>>
37: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
38: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
39: rustc_metadata::rmeta::encoder::encode_metadata_impl
40: rustc_data_structures::sync::join::<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, rustc_metadata::rmeta::encoder::EncodedMetadata, ()>
41: rustc_metadata::rmeta::encoder::encode_metadata
42: <rustc_interface::passes::QueryContext>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core::result::Result<alloc::boxed::Box, rustc_errors::ErrorReported>>
43: <rustc_interface::queries::Queries>::ongoing_codegen
44: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorReported>>
45: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
46: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
note: Some details are omitted, run with
RUST_BACKTRACE=full
for a verbose backtrace.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.60.0-nightly (17d29dc 2022-01-21) 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:
#0 [optimized_mir] optimizing MIR for
async_iter::<impl at src/async_iter.rs:103:1: 235:2>::parse_iter::{closure#0}
#1 [layout_of] computing layout of
[static generator@src/async_iter.rs:121:83: 159:6]
#2 [layout_of] computing layout of
core::future::from_generator::GenFuture<[static generator@src/async_iter.rs:121:83: 159:6]>
#3 [layout_of] computing layout of
impl core::future::future::Future<Output = [async output]>
#4 [optimized_mir] optimizing MIR for
async_iter::<impl at src/async_iter.rs:103:1: 235:2>::parse_iter
end of query stack
error: could not compile
lsm
The text was updated successfully, but these errors were encountered: