Closed JoJoJet closed 2 years ago
Thank you for reporting this issue. I have minimized this into two different issues:
(1.) Checking trait and impl assoc type compatibility might constrain opaques in ways we don't observe during find_opaque_ty_constraints
:
#![feature(type_alias_impl_trait)]
struct Concrete;
type Tait = impl Sized;
impl Foo for Concrete {
type Item = Concrete;
}
impl Bar for Concrete {
type Other = Tait;
}
trait Foo {
type Item: Bar<Other = Self>;
}
trait Bar {
type Other;
}
fn tait() -> Tait {}
(2.) Borrowck's opaque type constraints differ from typeck's constraints. Probably due to reachability during mir build.
#![feature(type_alias_impl_trait)]
type Tait = impl Sized;
struct One;
fn one() -> Tait { One }
struct Two<T>(T);
fn two() -> Tait { Two::<()>(todo!()) }
This might be another, unrelated bug.
You were correct about this :stuck_out_tongue_winking_eye:
Wow that example is much more minimal than mine 😀
No worries, the fact that you provided sample code is very well appreciated.
Triage: The ICE itself has been fixed by #99356 but I'm not sure why it didn't close this issue, @compiler-errors Is there a remaining task?
There's another issue I pointed out in (2.) that remains, I'll file another task for just that and then close this out..
Code
Minimum reproducible example: https://github.com/JoJoJet/bevy_param_example/blob/4ee1ab4d2ad7858df2a84a5ab2d88fc83c0d882b/src/main.rs
Meta
rustc --version --verbose
:Error output
Backtrace
``` thread 'rustc' panicked at 'Box', compiler\rustc_errors\src\lib.rs:1425:13
stack backtrace:
0: 0x7ffbc9c19fff - ::fmt::h3c410eac6bf1896a
1: 0x7ffbc9c5426a - core::fmt::write::hb34cfbd7fc8b3c9a
2: 0x7ffbc9c0c4f9 - ::fmt::h507d5d0f0254c738
3: 0x7ffbc9c1d8eb - std::panicking::default_hook::hf68d7718f0acf962
4: 0x7ffbc9c1d56b - std::panicking::default_hook::hf68d7718f0acf962
5: 0x7ffb95947106 - rustc_driver[4b277adb16bde54b]::pretty::print_after_hir_lowering
6: 0x7ffbc9c1e092 - std::panicking::rust_panic_with_hook::h395aeb81db8d4939
7: 0x7ffb9a141715 - ::fmt
8: 0x7ffb9a13d699 - ::fmt
9: 0x7ffb9a485529 - rustc_query_system[88c026d040f23148]::query::job::report_cycle
10: 0x7ffb9a0ec5f9 - ::fmt
11: 0x7ffb9a0f09bc - ::drop
12: 0x7ffb958c3fa4 - ::increment
13: 0x7ffb958ce72a - ::increment
14: 0x7ffb95958a6d - ::fmt
15: 0x7ffb95955999 - ::fmt
16: 0x7ffb958d648d - ::increment
17: 0x7ffb959000d6 - ::fmt
18: 0x7ffb95900958 - ::fmt
19: 0x7ffbc9c2e61c - std::sys::windows::thread::Thread::new::h7f265c57c73b4ff5
20: 0x7ffc2e2c7034 - BaseThreadInitThunk
21: 0x7ffc30182651 - RtlUserThreadStart
```