Make diangostic item names consistent
This commit is contained in:
parent
f03eb6bef8
commit
eec856bfbc
123 changed files with 244 additions and 248 deletions
|
@ -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 }
|
||||
});
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue