rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.41k stars 12.59k forks source link

Error compiling with wgpu #112532

Closed jembishop closed 1 year ago

jembishop commented 1 year ago

Code

No user code, just trying to compile my project. The Cargo.toml is

[package]
name = "dnapl-sim"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bytemuck = { version = "1.13.1", features = ["derive"] }
env_logger = "0.10.0"
futures-intrusive = "0.5.0"
nannou = "*"
pollster = "0.3.0"
wgpu = "0.16.1"

[profile.dev.package."*"]
opt-level = 3

Meta

rustc --version --verbose:

(base) ➜  dnapl-sim git:(master) ✗ rustc --version --verbose
rustc 1.71.0-nightly (18bfe5d8a 2023-05-14)
binary: rustc
commit-hash: 18bfe5d8a9ca0e226171e98f8f4ef071790f3352
commit-date: 2023-05-14
host: aarch64-apple-darwin
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output

(base) ➜  dnapl-sim git:(master) ✗ cargo run --release   
    Updating crates.io index
  Downloaded num-rational v0.1.42
  Downloaded piston-float v0.3.0
  Downloaded vec_map v0.8.2
  Downloaded rand_pcg v0.2.1
  Downloaded rand_xorshift v0.1.1
  Downloaded daggy v0.5.0
  Downloaded autocfg v0.1.8
  Downloaded siphasher v0.3.10
  Downloaded gfx-backend-empty v0.5.2
  Downloaded wgpu-native v0.5.1
  Downloaded copypasta v0.6.3
  Downloaded rand_core v0.3.1
  Downloaded synstructure v0.12.6
  Downloaded phf_codegen v0.8.0
  Downloaded fixedbitset v0.1.9
  Downloaded enum_primitive v0.1.1
  Downloaded rand_hc v0.1.0
  Downloaded rand_jitter v0.1.4
  Downloaded fnv v1.0.7
  Downloaded num-rational v0.2.4
  Downloaded parking_lot v0.10.2
  Downloaded storage-map v0.3.0
  Downloaded atom v0.3.6
  Downloaded rand_os v0.1.3
  Downloaded rand_isaac v0.1.1
  Downloaded lzw v0.10.0
  Downloaded lyon_path v0.15.2
  Downloaded rand_pcg v0.1.2
  Downloaded num-traits v0.1.43
  Downloaded num v0.2.1
  Downloaded lock_api v0.3.4
  Downloaded wgpu v0.5.2
  Downloaded hibitset v0.6.3
  Downloaded phf v0.8.0
  Downloaded phf_shared v0.8.0
  Downloaded objc_id v0.1.1
  Downloaded objc-foundation v0.1.1
  Downloaded num-complex v0.2.4
  Downloaded piston-viewport v0.5.0
  Downloaded rand_chacha v0.1.1
  Downloaded euclid v0.20.14
  Downloaded gfx-backend-metal v0.5.7
  Downloaded parking_lot_core v0.7.3
  Downloaded gfx-hal v0.5.3
  Downloaded rand_core v0.4.2
  Downloaded rand v0.5.6
  Downloaded pistoncore-input v0.24.0
  Downloaded num-bigint v0.2.6
  Downloaded lyon_geom v0.15.3
  Downloaded noise v0.6.0
  Downloaded petgraph v0.4.13
  Downloaded rand v0.6.5
  Downloaded metal v0.20.0
  Downloaded conrod_core v0.70.0
  Downloaded deflate v0.7.20
  Downloaded spirv_cross v0.20.0
  Downloaded daggy v0.6.0
  Downloaded peek-poke-derive v0.2.1
  Downloaded image v0.18.0
  Downloaded peek-poke v0.2.0
  Downloaded winit v0.22.2
  Downloaded wgpu-types v0.5.1
  Downloaded cgmath v0.17.0
  Downloaded phf_generator v0.8.0
  Downloaded cocoa v0.20.2
  Downloaded png v0.11.0
  Downloaded gfx-descriptor v0.1.0
  Downloaded conrod_winit v0.70.0
  Downloaded gfx-auxil v0.4.0
  Downloaded inflate v0.3.4
  Downloaded gif v0.9.2
  Downloaded gfx-memory v0.1.3
  Downloaded conrod_derive v0.70.0
  Downloaded lyon_algorithms v0.15.1
  Downloaded conrod_wgpu v0.70.0
  Downloaded wgpu-core v0.5.6
  Downloaded lyon_tessellation v0.15.9
  Downloaded nannou v0.15.0
  Downloaded lyon v0.15.9
  Downloaded 79 crates (13.5 MB) in 2.32s (largest was `lyon` at 9.3 MB)
   Compiling syn v1.0.109
   Compiling libc v0.2.141
   Compiling rand_core v0.4.2
   Compiling getrandom v0.1.16
   Compiling autocfg v0.1.8
   Compiling cfg-if v1.0.0
   Compiling gfx-hal v0.5.3
   Compiling crossbeam-epoch v0.9.14
   Compiling spirv_cross v0.20.0
   Compiling serde v1.0.164
   Compiling unicode-xid v0.2.4
   Compiling ppv-lite86 v0.2.17
   Compiling rand_core v0.3.1
   Compiling crossbeam-deque v0.8.3
   Compiling num-bigint v0.2.6
   Compiling rayon-core v1.11.0
   Compiling atom v0.3.6
   Compiling siphasher v0.3.10
   Compiling phf_shared v0.8.0
   Compiling hibitset v0.6.3
   Compiling rayon v1.7.0
   Compiling rand_core v0.5.1
   Compiling rand_chacha v0.2.2
   Compiling rand_pcg v0.2.1
   Compiling rand v0.7.3
   Compiling metal v0.20.0
   Compiling parking_lot v0.11.2
   Compiling storage-map v0.3.0
   Compiling parking_lot_core v0.7.3
   Compiling approx v0.3.2
   Compiling euclid v0.20.14
   Compiling lock_api v0.3.4
   Compiling num-rational v0.2.4
   Compiling num-complex v0.2.4
   Compiling fixedbitset v0.1.9
   Compiling range-alloc v0.1.3
   Compiling lyon_geom v0.15.3
   Compiling petgraph v0.4.13
   Compiling parking_lot v0.10.2
   Compiling synstructure v0.12.6
   Compiling jpeg-decoder v0.1.22
   Compiling crossbeam-epoch v0.8.2
   Compiling phf_generator v0.8.0
   Compiling gfx-backend-empty v0.5.2
   Compiling gfx-descriptor v0.1.0
   Compiling gfx-memory v0.1.3
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling objc_id v0.1.1
   Compiling vec_map v0.8.2
   Compiling piston-float v0.3.0
   Compiling piston-viewport v0.5.0
   Compiling objc-foundation v0.1.1
   Compiling phf_codegen v0.8.0
   Compiling crossbeam-deque v0.7.4
   Compiling lyon_path v0.15.2
   Compiling rand v0.6.5
   Compiling peek-poke-derive v0.2.1
   Compiling deflate v0.7.20
   Compiling inflate v0.3.4
   Compiling peek-poke v0.2.0
   Compiling wgpu-types v0.5.1
   Compiling num-traits v0.1.43
   Compiling lzw v0.10.0
   Compiling rusttype v0.8.3
   Compiling naga v0.12.2
   Compiling gif v0.9.2
   Compiling enum_primitive v0.1.1
   Compiling png v0.11.0
   Compiling num v0.2.1
   Compiling conrod_derive v0.70.0
   Compiling palette v0.5.0
   Compiling copypasta v0.6.3
   Compiling pistoncore-input v0.24.0
   Compiling daggy v0.5.0
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling rand_os v0.1.3
   Compiling rand_jitter v0.1.4
   Compiling num-rational v0.1.42
   Compiling cgmath v0.17.0
   Compiling fnv v1.0.7
   Compiling image v0.18.0
   Compiling conrod_core v0.70.0
   Compiling phf v0.8.0
   Compiling tiff v0.6.1
   Compiling lyon_algorithms v0.15.1
   Compiling lyon_tessellation v0.15.9
   Compiling palette_derive v0.5.0
   Compiling cocoa v0.20.2
   Compiling rand v0.5.6
   Compiling wgpu-hal v0.16.1
   Compiling serde_json v1.0.96
   Compiling noise v0.6.0
   Compiling winit v0.22.2
   Compiling wgpu-core v0.16.1
error[E0308]: mismatched types
   --> /Users/jembishop/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.22.2/src/platform_impl/macos/util/async.rs:170:55
    |
170 |                 ns_window.setFrame_display_(new_rect, 0);
    |                           -----------------           ^ expected `bool`, found integer
    |                           |
    |                           arguments to this method are incorrect
    |
note: method defined here
   --> /Users/jembishop/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.20.2/src/appkit.rs:945:15
    |
945 |     unsafe fn setFrame_display_(self, windowFrame: NSRect, di...
    |               ^^^^^^^^^^^^^^^^^

error: internal compiler error: compiler/rustc_hir_typeck/src/mem_categorization.rs:489:13: cat_overloaded_place: base is not a reference
   --> /Users/jembishop/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.22.2/src/platform_impl/macos/util/async.rs:150:73
    |
150 | ... = Some(NSWindow::frame(*ns_window));
    |                            ^^^^^^^^^^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/18bfe5d8a9ca0e226171e98f8f4ef071790f3352/compiler/rustc_errors/src/lib.rs:994:33
stack backtrace:
   0:        0x1052f9a28 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hde7fdf7cfdaf491d
   1:        0x105349584 - core::fmt::write::h38707f3675b75ee0
   2:        0x1052efba4 - std::io::Write::write_fmt::hacfe2dddecf43f42
   3:        0x1052f987c - std::sys_common::backtrace::print::h54051b88ba4e2e68
   4:        0x1052fc280 - std::panicking::default_hook::{{closure}}::he4b29d209b206f03
   5:        0x1052fc088 - std::panicking::default_hook::ha73c95dfd1bff720
   6:        0x10d6472a4 - rustc_driver_impl[90b14d8595fced0d]::install_ice_hook::{closure#0}
   7:        0x1052fc894 - std::panicking::rust_panic_with_hook::hd656dccdd23f0e1a
   8:        0x10fad4304 - std[40379d6b2ba08555]::panicking::begin_panic::<rustc_errors[55f55914efff6153]::ExplicitBug>::{closure#0}
   9:        0x10fad097c - std[40379d6b2ba08555]::sys_common::backtrace::__rust_end_short_backtrace::<std[40379d6b2ba08555]::panicking::begin_panic<rustc_errors[55f55914efff6153]::ExplicitBug>::{closure#0}, !>
  10:        0x11181ea10 - std[40379d6b2ba08555]::panicking::begin_panic::<rustc_errors[55f55914efff6153]::ExplicitBug>
  11:        0x10faff298 - <rustc_errors[55f55914efff6153]::HandlerInner>::span_bug::<rustc_span[dfc545257cfc4a75]::span_encoding::Span, alloc[74ef8f226b8fdc6d]::string::String>
  12:        0x10fafeef0 - <rustc_errors[55f55914efff6153]::Handler>::span_bug::<rustc_span[dfc545257cfc4a75]::span_encoding::Span, alloc[74ef8f226b8fdc6d]::string::String>
  13:        0x10fad444c - rustc_middle[5cda045268ed718c]::util::bug::opt_span_bug_fmt::<rustc_span[dfc545257cfc4a75]::span_encoding::Span>::{closure#0}
  14:        0x10fad4480 - rustc_middle[5cda045268ed718c]::ty::context::tls::with_opt::<rustc_middle[5cda045268ed718c]::util::bug::opt_span_bug_fmt<rustc_span[dfc545257cfc4a75]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:        0x10fad3e88 - rustc_middle[5cda045268ed718c]::ty::context::tls::with_context_opt::<rustc_middle[5cda045268ed718c]::ty::context::tls::with_opt<rustc_middle[5cda045268ed718c]::util::bug::opt_span_bug_fmt<rustc_span[dfc545257cfc4a75]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:        0x111819604 - rustc_middle[5cda045268ed718c]::util::bug::span_bug_fmt::<rustc_span[dfc545257cfc4a75]::span_encoding::Span>
  17:        0x10fb15454 - <rustc_hir_typeck[215c81b5a4ed5b7]::mem_categorization::MemCategorizationContext>::cat_overloaded_place
  18:        0x10fad6298 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  19:        0x10fad6894 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::walk_expr
  20:        0x10fad6348 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  21:        0x10fad6894 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::walk_expr
  22:        0x10fad6348 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  23:        0x10fad6d40 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::walk_expr
  24:        0x10fad6348 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  25:        0x10fad6a14 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::walk_expr
  26:        0x10fad6348 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  27:        0x10fad68c8 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::walk_expr
  28:        0x10fad6348 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  29:        0x10fad6a14 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::walk_expr
  30:        0x10fad6348 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  31:        0x10fad68c8 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::walk_expr
  32:        0x10fad6348 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  33:        0x10fad6d40 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::walk_expr
  34:        0x10fad6348 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_expr
  35:        0x10fadb268 - <rustc_hir_typeck[215c81b5a4ed5b7]::expr_use_visitor::ExprUseVisitor>::consume_body
  36:        0x10faae3f0 - <rustc_hir_typeck[215c81b5a4ed5b7]::fn_ctxt::FnCtxt>::analyze_closure
  37:        0x10fb94ffc - <rustc_hir_typeck[215c81b5a4ed5b7]::upvar::InferBorrowKindVisitor as rustc_hir[aa9e89f48bcb87fe]::intravisit::Visitor>::visit_expr
  38:        0x10fb3f92c - rustc_hir[aa9e89f48bcb87fe]::intravisit::walk_expr::<rustc_hir_typeck[215c81b5a4ed5b7]::upvar::InferBorrowKindVisitor>
  39:        0x10fb3f788 - rustc_hir[aa9e89f48bcb87fe]::intravisit::walk_expr::<rustc_hir_typeck[215c81b5a4ed5b7]::upvar::InferBorrowKindVisitor>
  40:        0x10fbb206c - rustc_hir_typeck[215c81b5a4ed5b7]::typeck
  41:        0x1107c6ae4 - rustc_query_system[e265f123bb2a7def]::query::plumbing::try_execute_query::<rustc_query_impl[ec03c2d4c2009b68]::DynamicConfig<rustc_query_system[e265f123bb2a7def]::query::caches::VecCache<rustc_span[dfc545257cfc4a75]::def_id::LocalDefId, rustc_middle[5cda045268ed718c]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ec03c2d4c2009b68]::plumbing::QueryCtxt>
  42:        0x1108a7458 - rustc_query_impl[ec03c2d4c2009b68]::get_query::typeck
  43:        0x10fbb1748 - rustc_hir_typeck[215c81b5a4ed5b7]::used_trait_imports
  44:        0x1107c6ae4 - rustc_query_system[e265f123bb2a7def]::query::plumbing::try_execute_query::<rustc_query_impl[ec03c2d4c2009b68]::DynamicConfig<rustc_query_system[e265f123bb2a7def]::query::caches::VecCache<rustc_span[dfc545257cfc4a75]::def_id::LocalDefId, rustc_middle[5cda045268ed718c]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ec03c2d4c2009b68]::plumbing::QueryCtxt>
  45:        0x1108a77b0 - rustc_query_impl[ec03c2d4c2009b68]::get_query::used_trait_imports
  46:        0x10fc985dc - rustc_hir_analysis[ba2dd7132eaa9ae5]::check_crate
  47:        0x10d70ff44 - rustc_interface[7680369497e026d5]::passes::analysis
  48:        0x1107fcd94 - <rustc_query_impl[ec03c2d4c2009b68]::dynamic_query::analysis::{closure#2} as core[1ff0788f4a509ac9]::ops::function::FnOnce<(rustc_middle[5cda045268ed718c]::ty::context::TyCtxt, ())>>::call_once
  49:        0x110775478 - rustc_query_system[e265f123bb2a7def]::query::plumbing::try_execute_query::<rustc_query_impl[ec03c2d4c2009b68]::DynamicConfig<rustc_query_system[e265f123bb2a7def]::query::caches::SingleCache<rustc_middle[5cda045268ed718c]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ec03c2d4c2009b68]::plumbing::QueryCtxt>
  50:        0x11089e188 - rustc_query_impl[ec03c2d4c2009b68]::get_query::analysis
  51:        0x10d60f178 - <rustc_middle[5cda045268ed718c]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[90b14d8595fced0d]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>>
  52:        0x10d64e804 - <rustc_interface[7680369497e026d5]::interface::Compiler>::enter::<rustc_driver_impl[90b14d8595fced0d]::run_compiler::{closure#1}::{closure#2}, core[1ff0788f4a509ac9]::result::Result<core[1ff0788f4a509ac9]::option::Option<rustc_interface[7680369497e026d5]::queries::Linker>, rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>>
  53:        0x10d607ac8 - rustc_span[dfc545257cfc4a75]::set_source_map::<core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>, rustc_interface[7680369497e026d5]::interface::run_compiler<core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>, rustc_driver_impl[90b14d8595fced0d]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  54:        0x10d6060f4 - std[40379d6b2ba08555]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7680369497e026d5]::util::run_in_thread_pool_with_globals<rustc_interface[7680369497e026d5]::interface::run_compiler<core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>, rustc_driver_impl[90b14d8595fced0d]::run_compiler::{closure#1}>::{closure#0}, core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>>
  55:        0x10d5fe358 - <<std[40379d6b2ba08555]::thread::Builder>::spawn_unchecked_<rustc_interface[7680369497e026d5]::util::run_in_thread_pool_with_globals<rustc_interface[7680369497e026d5]::interface::run_compiler<core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>, rustc_driver_impl[90b14d8595fced0d]::run_compiler::{closure#1}>::{closure#0}, core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1ff0788f4a509ac9]::result::Result<(), rustc_span[dfc545257cfc4a75]::ErrorGuaranteed>>::{closure#1} as core[1ff0788f4a509ac9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  56:        0x1053051fc - std::sys::unix::thread::Thread::new::thread_start::hdf3c279c7519d9cc
  57:        0x186a4026c - __pthread_deallocate

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.71.0-nightly (18bfe5d8a 2023-05-14) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no

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

query stack during panic:
#0 [typeck] type-checking `platform_impl::platform::util::r#async::set_maximized_async`
#1 [used_trait_imports] finding used_trait_imports `platform_impl::platform::util::r#async::set_maximized_async`
#2 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try `rustc --explain E0308`.
error: could not compile `winit` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
(base) ➜  dnapl-sim git:(master) ✗ 
compiler-errors commented 1 year ago

Do you mind checking if this still ICEs on the most recent nightly?

jembishop commented 1 year ago

I just did that now, and it looks like the issue is fixed on the latest nightly. (sorry should have tried that in first place!)

SNCPlay42 commented 1 year ago

That's weird, because I can repro it (cross-compiling for aarch64-apple-darwin from linux if it matters).

compiler-errors commented 1 year ago

@SNCPlay42 on the latest nightly?

SNCPlay42 commented 1 year ago

@compiler-errors yep:

note: rustc 1.72.0-nightly (7820972f8 2023-06-10) running on x86_64-unknown-linux-gnu

Also the version of winit from the report (winit-0.22.2) is not the latest and appears to fail to compile (non-ice) on stable. I'm working on bisecting and reducing now

SNCPlay42 commented 1 year ago

Wait, this actually ICEs on stable too and I didn't notice because rustc emitted a bunch of errors after the ICE (?!)

SNCPlay42 commented 1 year ago

I've reduced it down to this (which is no longer macOS or aarch64 dependent):

pub trait NSWindow: Sized {
    unsafe fn frame(self) -> () { unimplemented!() }
    unsafe fn setFrame_display_(self, windowFrame: (), display: ()) {}
}
impl NSWindow for () {}

pub struct NSRect {}

use std::ops::Deref;
struct MainThreadSafe<T = ()>(T);
impl<T> Deref for MainThreadSafe<T> {
    type Target = T;

    fn deref(&self) -> &T { unimplemented!() }
}

pub unsafe fn set_maximized_async(ns_window: ()) {
    let ns_window = MainThreadSafe(ns_window);
    move || {
        unimplemented!() = {
            NSWindow::frame(*ns_window);
            unimplemented!()
        };
        ns_window.setFrame_display_(unimplemented!(), 0);
    };
}

(The assignment to unimplemented!() was of course something more reasonable in the original code, but now I can't seem to replace it without making the ICE go away)

This failed to compile without ICE on 1.69:

Regression in https://github.com/rust-lang-ci/rust/commit/7adbb6d045d413e5c2fb5e3c65728bd20d4e9828 (#108687)

searched nightlies: from nightly-2023-03-06 to nightly-2023-04-19 regressed nightly: nightly-2023-04-15 searched commit range: https://github.com/rust-lang/rust/compare/a41fc00eaf352541008965fec0dee811e44373b3...84dd17b56a931a631a23dfd5ef2018fd3ef49108 regressed commit: https://github.com/rust-lang/rust/commit/84dd17b56a931a631a23dfd5ef2018fd3ef49108

bisected with cargo-bisect-rustc v0.6.6 Host triple: x86_64-unknown-linux-gnu Reproduce with: ```bash cargo bisect-rustc --start=2023-03-06 --end=2023-04-19 --regress=ice -- check ```

@rustbot label regression-from-stable-to-stable

compiler-errors commented 1 year ago

Whoops, I seemed to have caused it 😆

I'll look into it!

apiraino commented 1 year ago

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium