mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
nit: Make get_infer_ret_ty name more consistent with is_suggestable_infer_ty
This commit is contained in:
parent
4363f9b6f6
commit
c5d4996404
@ -3387,7 +3387,7 @@ impl<'hir> FnRetTy<'hir> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_infer_ret_ty(&self) -> Option<&'hir Ty<'hir>> {
|
||||
pub fn is_suggestable_infer_ty(&self) -> Option<&'hir Ty<'hir>> {
|
||||
if let Self::Return(ty) = self {
|
||||
if ty.is_suggestable_infer_ty() {
|
||||
return Some(*ty);
|
||||
|
@ -1371,7 +1371,7 @@ fn lower_fn_sig_recovering_infer_ret_ty<'tcx>(
|
||||
generics: &'tcx hir::Generics<'tcx>,
|
||||
def_id: LocalDefId,
|
||||
) -> ty::PolyFnSig<'tcx> {
|
||||
if let Some(infer_ret_ty) = sig.decl.output.get_infer_ret_ty() {
|
||||
if let Some(infer_ret_ty) = sig.decl.output.is_suggestable_infer_ty() {
|
||||
return recover_infer_ret_ty(icx, infer_ret_ty, generics, def_id);
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ impl TaitConstraintLocator<'_> {
|
||||
"foreign items cannot constrain opaque types",
|
||||
);
|
||||
if let Some(hir_sig) = hir_node.fn_sig()
|
||||
&& hir_sig.decl.output.get_infer_ret_ty().is_some()
|
||||
&& hir_sig.decl.output.is_suggestable_infer_ty().is_some()
|
||||
{
|
||||
let guar = self.tcx.dcx().span_delayed_bug(
|
||||
hir_sig.decl.output.span(),
|
||||
|
@ -150,7 +150,7 @@ fn typeck_with_fallback<'tcx>(
|
||||
let mut fcx = FnCtxt::new(&root_ctxt, param_env, def_id);
|
||||
|
||||
if let Some(hir::FnSig { header, decl, .. }) = node.fn_sig() {
|
||||
let fn_sig = if decl.output.get_infer_ret_ty().is_some() {
|
||||
let fn_sig = if decl.output.is_suggestable_infer_ty().is_some() {
|
||||
fcx.lowerer().lower_fn_ty(id, header.safety, header.abi, decl, None, None)
|
||||
} else {
|
||||
tcx.fn_sig(def_id).instantiate_identity()
|
||||
|
@ -31,7 +31,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
|
||||
// If the type of the item uses `_`, we're gonna error out anyway, but
|
||||
// typeck (which type_of invokes below), will call back into opaque_types_defined_by
|
||||
// causing a cycle. So we just bail out in this case.
|
||||
if hir_sig.output.get_infer_ret_ty().is_some() {
|
||||
if hir_sig.output.is_suggestable_infer_ty().is_some() {
|
||||
return V::Result::output();
|
||||
}
|
||||
let ty_sig = tcx.fn_sig(item).instantiate_identity();
|
||||
|
Loading…
Reference in New Issue
Block a user