1
Fork 0

Use iter::zip in compiler/

This commit is contained in:
Josh Stone 2021-03-08 15:32:41 -08:00
parent 3b1f5e3462
commit 72ebebe474
87 changed files with 213 additions and 204 deletions

View file

@ -45,6 +45,7 @@ use rustc_target::abi::LayoutOf;
use tracing::debug;
use std::cell::Cell;
use std::iter;
use std::slice;
/// Information about the registered lints.
@ -864,7 +865,7 @@ impl<'tcx> LateContext<'tcx> {
pub fn match_def_path(&self, def_id: DefId, path: &[Symbol]) -> bool {
let names = self.get_def_path(def_id);
names.len() == path.len() && names.into_iter().zip(path.iter()).all(|(a, &b)| a == b)
names.len() == path.len() && iter::zip(names, path).all(|(a, &b)| a == b)
}
/// Gets the absolute path of `def_id` as a vector of `Symbol`.