1
Fork 0

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

@ -966,8 +966,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
_ => None,
});
let is_option_or_result = parent_self_ty.map_or(false, |def_id| {
tcx.is_diagnostic_item(sym::option_type, def_id)
|| tcx.is_diagnostic_item(sym::result_type, def_id)
tcx.is_diagnostic_item(sym::Option, def_id)
|| tcx.is_diagnostic_item(sym::Result, def_id)
});
FnSelfUseKind::Normal { self_arg, implicit_into_iter, is_option_or_result }
});

View file

@ -400,8 +400,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
| ty::Opaque(def_id, _) => def_id,
_ => return err,
};
let is_option = self.infcx.tcx.is_diagnostic_item(sym::option_type, def_id);
let is_result = self.infcx.tcx.is_diagnostic_item(sym::result_type, def_id);
let is_option = self.infcx.tcx.is_diagnostic_item(sym::Option, def_id);
let is_result = self.infcx.tcx.is_diagnostic_item(sym::Result, def_id);
if (is_option || is_result) && use_spans.map_or(true, |v| !v.for_closure()) {
err.span_suggestion_verbose(
span.shrink_to_hi(),