mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 14:31:55 +00:00
Rename variable
This commit is contained in:
parent
06afafd492
commit
cc3af7091c
@ -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 {
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user