Closed Weasy666 closed 4 years ago
MCVE:
async fn some_future() -> u8 { 1 }
pub async fn bad_mir(x: u8) {
match x {
y if some_future().await == y => (),
_ => (),
}
}
Looks like this is a duplicate of #72651.
Thanks @SNCPlay42! Going to close this as a duplicate, I've added the MVCE here to #72651.
Code
Minimal verifiable example can be found here: https://github.com/Weasy666/rustc-bug Just clone and
cargo run
.Meta
rustc --version --verbose
:Error output
Backtrace
``` stack backtrace: 0:::fmt
1: core::fmt::write
2: ::fmt
3: std::panicking::take_hook
4: std::panicking::take_hook
5: rustc_driver::report_ice
6: std::panicking::rust_panic_with_hook
7: rustc_mir_build::provide
8: ::fmt
9: ::fmt
10: ::fmt
11: ::fmt
12: ::fmt
13: ::fmt
14: ::fmt
15: ::run_pass
16: rustc_mir::transform::run_passes
17: rustc_mir::transform::run_passes
18: rustc_mir::transform::run_passes
19: rustc_mir::transform::run_passes
20: rustc_middle::dep_graph::::debug_node
21: ::fmt
22: ::fmt
23: rustc_middle::ty::structural_impls::::lift_to_tcx
24: rustc_middle::ty::layout::provide
25: ::fmt
26: >::hash_stable
27: rustc_middle::dep_graph::::debug_node
28: ::fmt
29: ::fmt
30: rustc_middle::ty::structural_impls::::lift_to_tcx
31: as rustc_target::abi::LayoutOf>::layout_of
32: ::fmt
33: ZN238_$LT$rustc_infer..infer..undo_log..UndoLog$u20$as$u20$core..convert..From$LT$rustc_data_structures..snapshot_map..UndoLog$LT$rustc_infer..traits..project..ProjectionCacheKey$C$rustc_infer..traits..project..ProjectionCacheEntry$GT$$GT$$GT$4from17h3714
34: ::fmt
35: ZN238_$LT$rustc_infer..infer..undo_log..UndoLog$u20$as$u20$core..convert..From$LT$rustc_data_structures..snapshot_map..UndoLog$LT$rustc_infer..traits..project..ProjectionCacheKey$C$rustc_infer..traits..project..ProjectionCacheEntry$GT$$GT$$GT$4from17h3714
36: rustc_middle::ty::layout::provide
37: ::fmt
38: >::hash_stable
39: rustc_middle::dep_graph::::debug_node
40: ::fmt
41: ::fmt
42: rustc_middle::ty::structural_impls::::lift_to_tcx
43: as rustc_target::abi::LayoutOf>::layout_of
44: ::run_pass
45: rustc_mir::transform::run_passes
46: rustc_mir::transform::run_passes
47: rustc_mir::transform::run_passes
48: rustc_mir::transform::run_passes
49: rustc_middle::dep_graph::::debug_node
50: ::fmt
51: ::fmt
52: rustc_middle::ty::structural_impls::::lift_to_tcx
53: rustc_middle::ty::::instance_mir
54: ::visit_impl_item
55: rustc_mir::monomorphize::collector::collect_crate_mono_items
56: rustc_mir::monomorphize::collector::collect_crate_mono_items
57: rustc_mir::monomorphize::collector::collect_crate_mono_items
58: rustc_mir::monomorphize::collector::collect_crate_mono_items
59: rustc_mir::monomorphize::collector::collect_crate_mono_items
60: rustc_mir::monomorphize::collector::collect_crate_mono_items
61: ::fmt
62: rustc_mir::monomorphize::collector::collect_crate_mono_items
63: rustc_mir::monomorphize::partitioning::compute_codegen_unit_name
64: as rustc_codegen_llvm::type_of::LayoutLlvmExt>::pointee_info_at
65: rustc_codegen_llvm::llvm_::archive_ro::Child::data
66: ::fmt
67: ::fmt
68: ::fmt
69: as rustc_codegen_llvm::type_of::LayoutLlvmExt>::pointee_info_at
70: ::codegen_crate
71: rustc_interface::passes::QueryContext::print_stats
72: rustc_interface::passes::BoxedResolver::complete
73: rustc_interface::queries::Queries::ongoing_codegen
74: ::check_trait_item_post
75: ::fmt
76: ::deref
77: ::deref
78: ::array_subpath
79: std::sys::windows::thread::Thread::new
80: BaseThreadInitThunk
81: RtlUserThreadStart
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.47.0-nightly (6c8927b0c 2020-07-26) running on x86_64-pc-windows-msvc
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [optimized_mir] optimizing MIR for `>::from_request::__from_request::{{closure}}#0`
#1 [layout_raw] computing layout of `[static generator@src\user.rs:16:83: 26:6 request:&rocket::Request for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5, 't6> {std::future::ResumeTy, &'r rocket::Request<'s>, rocket::http::Cookies<'t0>, &'t1 mut rocket::http::Cookies<'t2>, &'t3 str, std::option::Option>, rocket::http::Cookie<'t5>, std::pin::Pin, (rocket::http::Status, ()), ()>> + std::marker::Send + 't6)>>, ()}]`
#2 [layout_raw] computing layout of `std::future::from_generator::GenFuture<[static generator@src\user.rs:16:83: 26:6 request:&rocket::Request for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5, 't6> {std::future::ResumeTy, &'r rocket::Request<'s>, rocket::http::Cookies<'t0>, &'t1 mut rocket::http::Cookies<'t2>, &'t3 str, std::option::Option>, rocket::http::Cookie<'t5>, std::pin::Pin, (rocket::http::Status, ()), ()>> + std::marker::Send + 't6)>>, ()}]>`
#3 [optimized_mir] optimizing MIR for `>::from_request::__from_request`
#4 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
```