-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE DefId(2:2587 ~ core[22a2]::default) does not have a "generics_of"
#113610
Comments
Thanks for the ping. It seems to be that here rust/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs Lines 165 to 168 in 993deaa
it's not always the parent tcx.parent(def_id) which has generics_of , sometimes its on the def_id as-is. I'm not entirely sure when we need the tcx.parent (IIRC it doesn't work for my test case if I don't add tcx.parent ).
|
Now if I stick to only using debug!(?def_id);
let generics = infcx.tcx.generics_of(def_id);
debug!("generics: {:?}", generics);
let idx = generics.param_def_id_to_index(infcx.tcx, def_id).unwrap(); the trait T {}
struct S {}
impl S {
fn owo(&self, _: Option<&impl T>) {}
}
fn main() {
(S {}).owo(None)
//~^ ERROR type annotations needed
}
cc @lcnr sorry for the ping, but do you know if |
going to look into this, I think using |
self type param infer, avoid ICE fixes rust-lang#113610, which is caused by https://github.com/rust-lang/rust/blob/33a2c2487ac5d9927830ea4c1844335c6b9f77db/compiler/rustc_hir_analysis/src/collect/generics_of.rs#L190-L205
self type param infer, avoid ICE fixes rust-lang#113610, which is caused by https://github.com/rust-lang/rust/blob/33a2c2487ac5d9927830ea4c1844335c6b9f77db/compiler/rustc_hir_analysis/src/collect/generics_of.rs#L190-L205
self type param infer, avoid ICE fixes rust-lang#113610, which is caused by https://github.com/rust-lang/rust/blob/33a2c2487ac5d9927830ea4c1844335c6b9f77db/compiler/rustc_hir_analysis/src/collect/generics_of.rs#L190-L205
self type param infer, avoid ICE fixes rust-lang#113610, which is caused by https://github.com/rust-lang/rust/blob/33a2c2487ac5d9927830ea4c1844335c6b9f77db/compiler/rustc_hir_analysis/src/collect/generics_of.rs#L190-L205
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: