Skip to content

Commit 77f1e50

Browse files
committedOct 3, 2021
Auto merge of rust-lang#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.
2 parents c70b35e + eec856b commit 77f1e50

File tree

123 files changed

+244
-248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+244
-248
lines changed
 

‎compiler/rustc_borrowck/src/diagnostics/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
966966
_ => None,
967967
});
968968
let is_option_or_result = parent_self_ty.map_or(false, |def_id| {
969-
tcx.is_diagnostic_item(sym::option_type, def_id)
970-
|| tcx.is_diagnostic_item(sym::result_type, def_id)
969+
tcx.is_diagnostic_item(sym::Option, def_id)
970+
|| tcx.is_diagnostic_item(sym::Result, def_id)
971971
});
972972
FnSelfUseKind::Normal { self_arg, implicit_into_iter, is_option_or_result }
973973
});

‎compiler/rustc_borrowck/src/diagnostics/move_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
400400
| ty::Opaque(def_id, _) => def_id,
401401
_ => return err,
402402
};
403-
let is_option = self.infcx.tcx.is_diagnostic_item(sym::option_type, def_id);
404-
let is_result = self.infcx.tcx.is_diagnostic_item(sym::result_type, def_id);
403+
let is_option = self.infcx.tcx.is_diagnostic_item(sym::Option, def_id);
404+
let is_result = self.infcx.tcx.is_diagnostic_item(sym::Result, def_id);
405405
if (is_option || is_result) && use_spans.map_or(true, |v| !v.for_closure()) {
406406
err.span_suggestion_verbose(
407407
span.shrink_to_hi(),

0 commit comments

Comments
 (0)
Please sign in to comment.