Skip to content

Commit

Permalink
Rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
roxelo committed Jun 30, 2021
1 parent 06afafd commit cc3af70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -799,15 +799,15 @@ 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 {
return try_borrowing(
ty::TraitRef::new(trait_ref.def_id, mut_substs),
trait_ref,
true,
&blacklist[..],
&never_suggest_borrow[..],
);
}
} else {
Expand Down
4 changes: 0 additions & 4 deletions library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ use crate::hash::Hasher;
/// [ub]: ../../reference/behavior-considered-undefined.html
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "send_trait")]
<<<<<<< HEAD
#[lang = "send"]
=======
>>>>>>> Remove lang items Send, UnwindSafe and RefUnwindSafe
#[rustc_on_unimplemented(
message = "`{Self}` cannot be sent between threads safely",
label = "`{Self}` cannot be sent between threads safely"
Expand Down

0 comments on commit cc3af70

Please sign in to comment.