1
Fork 0

Auto merge of #89479 - camsteffen:diag-naming, r=Manishearth

Make diangostic item naming consistent

Right now there is about a 50/50 split of naming diagnostic items as `vec_type` vs `Vec`. So it is hard to guess a diagnostic item name with confidence. I know it's not great to change these retroactively, but I think it will be much easier to maintain consistency after consistency is established.
This commit is contained in:
bors 2021-10-03 03:43:21 +00:00
commit 77f1e504a9
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 = poly_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) =