Skip to content
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

MIR Optimization panic #93190

Closed
Arisa-Snowbell opened this issue Jan 22, 2022 · 2 comments
Closed

MIR Optimization panic #93190

Arisa-Snowbell opened this issue Jan 22, 2022 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Arisa-Snowbell
Copy link

Arisa-Snowbell commented Jan 22, 2022

when compiling mongodb-rust-driver with the latest nightly as of now (17d29dc 2022-01-21) it throws out some MIR optimization panic, i am using mongodb-rust-driver right from a repo, the commit is 577345c2b0084691882893a03a3672fdcd410e46

Code

No code

Meta

rustc --version --verbose:

rustc 1.60.0-nightly (17d29dcdc 2022-01-21)
binary: rustc
commit-hash: 17d29dcdce9b9e838635eb0adefd9b8b1588410b
commit-date: 2022-01-21
host: x86_64-unknown-linux-gnu
release: 1.60.0-nightly
LLVM version: 13.0.0

Error output

error: internal compiler error: compiler/rustc_mir_transform/src/generator.rs:755:13: Broken MIR: generator contains type ClientOptionsParser in MIR, but typeck only
knows about {ResumeTy, impl AsRef<str>, std::option::Option<resolver_config::ResolverConfig>, bool, client::options::ClientOptions, [closure@/home/arisa/.cargo/git/ch
eckouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:1100:69: 1100:90], impl futures_core::Future<Output = std::result::Result<SrvResolver, er
ror::Error>>, (), SrvResolver, &Vec<client::options::ServerAddress>, Vec<client::options::ServerAddress>, usize, &client::options::ServerAddress, client::options::Ser
verAddress, &str, impl futures_core::Future<Output = std::result::Result<ResolvedConfig, error::Error>>} and [impl AsRef<str>, std::option::Option<client::options::re
solver_config::ResolverConfig>]
    --> /home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:1092:23
     |
1092 |       ) -> Result<Self> {
     |  _______________________^
1093 | |         let parser = ClientOptionsParser::parse(uri.as_ref())?;
1094 | |         let srv = parser.srv;
1095 | |         let auth_source_present = parser.auth_source.is_some();
...    |
1145 | |         Ok(options)
1146 | |     }
     | |_____^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/17d29dcdce9b9e838635eb0adefd9b8b1588410b/compiler/rustc_errors/src/lib.rs:1115:9
note: run with `RUST_BACKTRACE=1` environment variable to display a 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 (17d29dcdc 2022-01-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [optimized_mir] optimizing MIR for `client::options::<impl at /home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs
:973:1: 1261:2>::parse_uri::{closure#0}`
#1 [layout_of] computing layout of `[static generator@/home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:1092:23: 1
146:6]`
end of query stack
error: could not compile `mongodb`
warning: build failed, waiting for other jobs to finish...
error: build failed
Backtrace

   Compiling mongodb v2.0.0 (https://github.com/mongodb/mongo-rust-driver.git#577345c2)
error: internal compiler error: compiler/rustc_mir_transform/src/generator.rs:755:13: Broken MIR: generator contains type ClientOptionsParser in MIR, but typeck only knows about {ResumeTy, impl AsRef<str>, std::option::Option<resolver_config::ResolverConfig>, bool, client::options::ClientOptions, [closure@/home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:1100:69: 1100:90], impl futures_core::Future<Output = std::result::Result<SrvResolver, error::Error>>, (), SrvResolver, &Vec<client::options::ServerAddress>, Vec<client::options::ServerAddress>, usize, &client::options::ServerAddress, client::options::ServerAddress, &str, impl futures_core::Future<Output = std::result::Result<ResolvedConfig, error::Error>>} and [impl AsRef<str>, std::option::Option<client::options::resolver_config::ResolverConfig>]
    --> /home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:1092:23
     |
1092 |       ) -> Result<Self> {
     |  _______________________^
1093 | |         let parser = ClientOptionsParser::parse(uri.as_ref())?;
1094 | |         let srv = parser.srv;
1095 | |         let auth_source_present = parser.auth_source.is_some();
...    |
1145 | |         Ok(options)
1146 | |     }
     | |_____^

thread 'rustc' panicked at 'Box<dyn Any>', /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::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>>
  11: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
  12: <rustc_middle::ty::context::TyCtxt>::generator_layout
  13: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached
  14: rustc_middle::ty::layout::layout_of
  15: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
  16: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
  17: 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>>>
  18: 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>>>>
  19: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached
  20: rustc_middle::ty::layout::layout_of
  21: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
  22: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
  23: rustc_middle::ty::layout::layout_of
  24: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
  25: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
  26: <rustc_mir_transform::const_prop::ConstProp as rustc_middle::mir::MirPass>::run_pass
  27: rustc_mir_transform::pass_manager::run_passes
  28: rustc_mir_transform::optimized_mir
  29: 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>>
  30: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
  31: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
  32: rustc_metadata::rmeta::encoder::encode_metadata_impl
  33: 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, ()>
  34: rustc_metadata::rmeta::encoder::encode_metadata
  35: <rustc_interface::passes::QueryContext>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core::result::Result<alloc::boxed::Box<dyn core::any::Any>, rustc_errors::ErrorReported>>
  36: <rustc_interface::queries::Queries>::ongoing_codegen
  37: <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>>
  38: 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}>
  39: <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 (17d29dcdc 2022-01-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [optimized_mir] optimizing MIR for `client::options::<impl at /home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:973:1: 1261:2>::parse_uri::{closure#0}`
#1 [layout_of] computing layout of `[static generator@/home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:1092:23: 1146:6]`
#2 [layout_of] computing layout of `core::future::from_generator::GenFuture<[static generator@/home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:1092:23: 1146:6]>`
#3 [layout_of] computing layout of `impl core::future::future::Future<Output = [async output]>`
#4 [optimized_mir] optimizing MIR for `client::options::<impl at /home/arisa/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/577345c/src/client/options/mod.rs:973:1: 1261:2>::parse_uri`
end of query stack
error: could not compile `mongodb`

@Arisa-Snowbell Arisa-Snowbell added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 22, 2022
@lqd
Copy link
Member

lqd commented Jan 22, 2022

This looks like a duplicate of #93161 and will be fixed by #93165 shortly.

@lqd
Copy link
Member

lqd commented Jan 22, 2022

I've indeed verified that mongodb-rust-driver does not ICE with #93165 (via rustup-toolchain-master of the PR's try artifacts d634ef421795e0140724aa9fddf8137b83e616c9 ) so I'll close this issue as a duplicate.

Thanks for letting us know.

@lqd lqd closed this as completed Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants