Skip to content

Commit c5d4996

Browse files
nit: Make get_infer_ret_ty name more consistent with is_suggestable_infer_ty
1 parent 4363f9b commit c5d4996

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Diff for: compiler/rustc_hir/src/hir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3387,7 +3387,7 @@ impl<'hir> FnRetTy<'hir> {
33873387
}
33883388
}
33893389

3390-
pub fn get_infer_ret_ty(&self) -> Option<&'hir Ty<'hir>> {
3390+
pub fn is_suggestable_infer_ty(&self) -> Option<&'hir Ty<'hir>> {
33913391
if let Self::Return(ty) = self {
33923392
if ty.is_suggestable_infer_ty() {
33933393
return Some(*ty);

Diff for: compiler/rustc_hir_analysis/src/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ fn lower_fn_sig_recovering_infer_ret_ty<'tcx>(
13711371
generics: &'tcx hir::Generics<'tcx>,
13721372
def_id: LocalDefId,
13731373
) -> ty::PolyFnSig<'tcx> {
1374-
if let Some(infer_ret_ty) = sig.decl.output.get_infer_ret_ty() {
1374+
if let Some(infer_ret_ty) = sig.decl.output.is_suggestable_infer_ty() {
13751375
return recover_infer_ret_ty(icx, infer_ret_ty, generics, def_id);
13761376
}
13771377

Diff for: compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl TaitConstraintLocator<'_> {
187187
"foreign items cannot constrain opaque types",
188188
);
189189
if let Some(hir_sig) = hir_node.fn_sig()
190-
&& hir_sig.decl.output.get_infer_ret_ty().is_some()
190+
&& hir_sig.decl.output.is_suggestable_infer_ty().is_some()
191191
{
192192
let guar = self.tcx.dcx().span_delayed_bug(
193193
hir_sig.decl.output.span(),

Diff for: compiler/rustc_hir_typeck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ fn typeck_with_fallback<'tcx>(
150150
let mut fcx = FnCtxt::new(&root_ctxt, param_env, def_id);
151151

152152
if let Some(hir::FnSig { header, decl, .. }) = node.fn_sig() {
153-
let fn_sig = if decl.output.get_infer_ret_ty().is_some() {
153+
let fn_sig = if decl.output.is_suggestable_infer_ty().is_some() {
154154
fcx.lowerer().lower_fn_ty(id, header.safety, header.abi, decl, None, None)
155155
} else {
156156
tcx.fn_sig(def_id).instantiate_identity()

Diff for: compiler/rustc_ty_utils/src/sig_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
3131
// If the type of the item uses `_`, we're gonna error out anyway, but
3232
// typeck (which type_of invokes below), will call back into opaque_types_defined_by
3333
// causing a cycle. So we just bail out in this case.
34-
if hir_sig.output.get_infer_ret_ty().is_some() {
34+
if hir_sig.output.is_suggestable_infer_ty().is_some() {
3535
return V::Result::output();
3636
}
3737
let ty_sig = tcx.fn_sig(item).instantiate_identity();

0 commit comments

Comments
 (0)