Rename variable

This commit is contained in:
Roxane 2021-06-29 20:26:37 -04:00
parent 06afafd492
commit cc3af7091c
2 changed files with 5 additions and 9 deletions

View file

@ -687,16 +687,16 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
return false;
}
// Blacklist traits for which it would be nonsensical to suggest borrowing.
// List of traits for which it would be nonsensical to suggest borrowing.
// For instance, immutable references are always Copy, so suggesting to
// borrow would always succeed, but it's probably not what the user wanted.
let mut blacklist: Vec<_> =
let mut never_suggest_borrow: Vec<_> =
[LangItem::Copy, LangItem::Clone, LangItem::Unpin, LangItem::Sized]
.iter()
.filter_map(|lang_item| self.tcx.lang_items().require(*lang_item).ok())
.collect();
blacklist.push(self.tcx.get_diagnostic_item(sym::send_trait).unwrap());
never_suggest_borrow.push(self.tcx.get_diagnostic_item(sym::send_trait).unwrap());
let span = obligation.cause.span;
let param_env = obligation.param_env;
@ -799,7 +799,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
ty::TraitRef::new(trait_ref.def_id, imm_substs),
trait_ref,
false,
&blacklist[..],
&never_suggest_borrow[..],
) {
return true;
} else {
@ -807,7 +807,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
ty::TraitRef::new(trait_ref.def_id, mut_substs),
trait_ref,
true,
&blacklist[..],
&never_suggest_borrow[..],
);
}
} else {