add #[rustc_pass_by_value] to more types

This commit is contained in:
lcnr 2022-03-08 15:39:52 +01:00
parent d3bc1297db
commit a4d6c61bdc
2 changed files with 6 additions and 5 deletions

View File

@ -543,10 +543,10 @@ impl<'a, 'tcx> PossibleBorrowerVisitor<'a, 'tcx> {
continue;
}
let borrowers = self.possible_borrower.reachable_from(&row);
let borrowers = self.possible_borrower.reachable_from(row);
if !borrowers.is_empty() {
let mut bs = HybridBitSet::new_empty(self.body.local_decls.len());
for &c in borrowers {
for c in borrowers {
if c != mir::Local::from_usize(0) {
bs.insert(c);
}
@ -663,10 +663,10 @@ impl<'a, 'tcx> PossibleOriginVisitor<'a, 'tcx> {
continue;
}
let borrowers = self.possible_origin.reachable_from(&row);
let borrowers = self.possible_origin.reachable_from(row);
if !borrowers.is_empty() {
let mut bs = HybridBitSet::new_empty(self.body.local_decls.len());
for &c in borrowers {
for c in borrowers {
if c != mir::Local::from_usize(0) {
bs.insert(c);
}

View File

@ -489,7 +489,8 @@ pub fn def_path_res(cx: &LateContext<'_>, path: &[&str]) -> Res {
fn find_crate(tcx: TyCtxt<'_>, name: &str) -> Option<DefId> {
tcx.crates(())
.iter()
.find(|&&num| tcx.crate_name(num).as_str() == name)
.copied()
.find(|&num| tcx.crate_name(num).as_str() == name)
.map(CrateNum::as_def_id)
}