Rollup merge of #97595 - ouz-a:issue-97381, r=compiler-errors
Remove unwrap from get_vtable This avoids ICE on issue #97381 I think the bug is a bit deeper though, it compiles fine when `v` is `&v` which makes me think `Deref` is causing some issue with borrowck but it's fine I guess since this thing crashes since `nightly-2020-09-17` 😅
This commit is contained in:
commit
148a44a001
6 changed files with 132 additions and 11 deletions
|
@ -347,11 +347,15 @@ fn resolve_associated_item<'tcx>(
|
|||
_ => None,
|
||||
},
|
||||
traits::ImplSource::Object(ref data) => {
|
||||
let index = traits::get_vtable_index_of_object_method(tcx, data, trait_item_id);
|
||||
Some(Instance {
|
||||
def: ty::InstanceDef::Virtual(trait_item_id, index),
|
||||
substs: rcvr_substs,
|
||||
})
|
||||
if let Some(index) = traits::get_vtable_index_of_object_method(tcx, data, trait_item_id)
|
||||
{
|
||||
Some(Instance {
|
||||
def: ty::InstanceDef::Virtual(trait_item_id, index),
|
||||
substs: rcvr_substs,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
traits::ImplSource::Builtin(..) => {
|
||||
if Some(trait_ref.def_id) == tcx.lang_items().clone_trait() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue