1
Fork 0

Suggest using Arc on !Send/!Sync types

This commit is contained in:
Esteban Kuber 2021-09-14 15:44:08 +00:00 committed by Esteban Küber
parent 19a647d6d8
commit 9de1a472b6
113 changed files with 223 additions and 13 deletions

View file

@ -2743,6 +2743,12 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
}
ObligationCauseCode::BindingObligation(item_def_id, span)
| ObligationCauseCode::ExprBindingObligation(item_def_id, span, ..) => {
if self.tcx.is_diagnostic_item(sym::Send, item_def_id)
|| self.tcx.lang_items().sync_trait() == Some(item_def_id)
{
return;
}
let item_name = tcx.def_path_str(item_def_id);
let short_item_name = with_forced_trimmed_paths!(tcx.def_path_str(item_def_id));
let mut multispan = MultiSpan::from(span);