Make diangostic item names consistent

This commit is contained in:
Cameron Steffen 2021-10-02 18:51:01 -05:00
parent f03eb6bef8
commit eec856bfbc
123 changed files with 244 additions and 248 deletions

View file

@ -533,9 +533,9 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
// example).
let trait_is_debug =
self.tcx.is_diagnostic_item(sym::debug_trait, trait_ref.def_id());
self.tcx.is_diagnostic_item(sym::Debug, trait_ref.def_id());
let trait_is_display =
self.tcx.is_diagnostic_item(sym::display_trait, trait_ref.def_id());
self.tcx.is_diagnostic_item(sym::Display, trait_ref.def_id());
let in_std_macro =
match obligation.cause.span.ctxt().outer_expn_data().macro_def_id {

View file

@ -702,7 +702,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
.filter_map(|lang_item| self.tcx.lang_items().require(*lang_item).ok())
.collect();
never_suggest_borrow.push(self.tcx.get_diagnostic_item(sym::send_trait).unwrap());
never_suggest_borrow.push(self.tcx.get_diagnostic_item(sym::Send).unwrap());
let param_env = obligation.param_env;
let trait_ref = trait_ref.skip_binder();
@ -1634,8 +1634,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
// Special case the primary error message when send or sync is the trait that was
// not implemented.
let is_send = self.tcx.is_diagnostic_item(sym::send_trait, trait_ref.def_id);
let is_sync = self.tcx.is_diagnostic_item(sym::sync_trait, trait_ref.def_id);
let is_send = self.tcx.is_diagnostic_item(sym::Send, trait_ref.def_id);
let is_sync = self.tcx.is_diagnostic_item(sym::Sync, trait_ref.def_id);
let hir = self.tcx.hir();
let trait_explanation = if is_send || is_sync {
let (trait_name, trait_verb) =