1
Fork 0

Rollup merge of #110404 - matthiaskrgr:mapmap, r=Nilstrieb

fix clippy::toplevel_ref_arg and ::manual_map

r? ``@Nilstrieb``
This commit is contained in:
Matthias Krüger 2023-04-17 08:09:40 +02:00 committed by GitHub
commit 1795bf8222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 42 additions and 70 deletions

View file

@ -243,16 +243,11 @@ pub fn get_vtable_index_of_object_method<'tcx, N>(
) -> Option<usize> {
// Count number of methods preceding the one we are selecting and
// add them to the total offset.
if let Some(index) = tcx
.own_existential_vtable_entries(object.upcast_trait_ref.def_id())
tcx.own_existential_vtable_entries(object.upcast_trait_ref.def_id())
.iter()
.copied()
.position(|def_id| def_id == method_def_id)
{
Some(object.vtable_base + index)
} else {
None
}
.map(|index| object.vtable_base + index)
}
pub fn closure_trait_ref_and_return_type<'tcx>(