diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-02 18:19:46 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-01-02 23:39:16 +0000 |
| commit | c5d4996404fe7ed37a94d83d7b632ed6a566d2ac (patch) | |
| tree | 58173c9840d379ea740511cb98affff3c602be6e | |
| parent | 4363f9b6f6d3656d94adbcabba6348a485ef9a56 (diff) | |
| download | rust-c5d4996404fe7ed37a94d83d7b632ed6a566d2ac.tar.gz rust-c5d4996404fe7ed37a94d83d7b632ed6a566d2ac.zip | |
nit: Make get_infer_ret_ty name more consistent with is_suggestable_infer_ty
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir_analysis/src/collect.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir_typeck/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/sig_types.rs | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 7a3cde4bc2f..44762299ee8 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -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); diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index ada70117b62..2ba7e2d1669 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -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); } diff --git a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs index 66255829dcf..c933095fd3d 100644 --- a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs +++ b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs @@ -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(), diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs index 91ea34eb54d..b24aa0e4693 100644 --- a/compiler/rustc_hir_typeck/src/lib.rs +++ b/compiler/rustc_hir_typeck/src/lib.rs @@ -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() diff --git a/compiler/rustc_ty_utils/src/sig_types.rs b/compiler/rustc_ty_utils/src/sig_types.rs index 6f1cbb0fee7..64e5a609b2f 100644 --- a/compiler/rustc_ty_utils/src/sig_types.rs +++ b/compiler/rustc_ty_utils/src/sig_types.rs @@ -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(); |
