Skip to content

Commit 8ebb3d4

Browse files
committed
rename structurally_resolved_type
1 parent d5a7424 commit 8ebb3d4

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

compiler/rustc_hir_typeck/src/callee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
8989
_ => self.check_expr(callee_expr),
9090
};
9191

92-
let expr_ty = self.structurally_resolved_type(call_expr.span, original_callee_ty);
92+
let expr_ty = self.structurally_resolve_type(call_expr.span, original_callee_ty);
9393

9494
let mut autoderef = self.autoderef(callee_expr.span, expr_ty);
9595
let mut result = None;
@@ -138,7 +138,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
138138
autoderef: &Autoderef<'a, 'tcx>,
139139
) -> Option<CallStep<'tcx>> {
140140
let adjusted_ty =
141-
self.structurally_resolved_type(autoderef.span(), autoderef.final_ty(false));
141+
self.structurally_resolve_type(autoderef.span(), autoderef.final_ty(false));
142142

143143
// If the callee is a bare function or a closure, then we're all set.
144144
match *adjusted_ty.kind() {

compiler/rustc_hir_typeck/src/cast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,8 @@ impl<'a, 'tcx> CastCheck<'tcx> {
717717

718718
#[instrument(skip(fcx), level = "debug")]
719719
pub fn check(mut self, fcx: &FnCtxt<'a, 'tcx>) {
720-
self.expr_ty = fcx.structurally_resolved_type(self.expr_span, self.expr_ty);
721-
self.cast_ty = fcx.structurally_resolved_type(self.cast_span, self.cast_ty);
720+
self.expr_ty = fcx.structurally_resolve_type(self.expr_span, self.expr_ty);
721+
self.cast_ty = fcx.structurally_resolve_type(self.cast_span, self.cast_ty);
722722

723723
debug!("check_cast({}, {:?} as {:?})", self.expr.hir_id, self.expr_ty, self.cast_ty);
724724

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
380380
let mut oprnd_t = self.check_expr_with_expectation(&oprnd, expected_inner);
381381

382382
if !oprnd_t.references_error() {
383-
oprnd_t = self.structurally_resolved_type(expr.span, oprnd_t);
383+
oprnd_t = self.structurally_resolve_type(expr.span, oprnd_t);
384384
match unop {
385385
hir::UnOp::Deref => {
386386
if let Some(ty) = self.lookup_derefing(expr, oprnd, oprnd_t) {
@@ -1266,13 +1266,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12661266
) -> Ty<'tcx> {
12671267
let rcvr_t = self.check_expr(&rcvr);
12681268
// no need to check for bot/err -- callee does that
1269-
let rcvr_t = self.structurally_resolved_type(rcvr.span, rcvr_t);
1269+
let rcvr_t = self.structurally_resolve_type(rcvr.span, rcvr_t);
12701270
let span = segment.ident.span;
12711271

12721272
let method = match self.lookup_method(rcvr_t, segment, span, expr, rcvr, args) {
12731273
Ok(method) => {
12741274
// We could add a "consider `foo::<params>`" suggestion here, but I wasn't able to
1275-
// trigger this codepath causing `structurally_resolved_type` to emit an error.
1275+
// trigger this codepath causing `structurally_resolve_type` to emit an error.
12761276

12771277
self.write_method_call(expr.hir_id, method);
12781278
Ok(method)
@@ -2252,7 +2252,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
22522252
) -> Ty<'tcx> {
22532253
debug!("check_field(expr: {:?}, base: {:?}, field: {:?})", expr, base, field);
22542254
let base_ty = self.check_expr(base);
2255-
let base_ty = self.structurally_resolved_type(base.span, base_ty);
2255+
let base_ty = self.structurally_resolve_type(base.span, base_ty);
22562256
let mut private_candidate = None;
22572257
let mut autoderef = self.autoderef(expr.span, base_ty);
22582258
while let Some((deref_base_ty, _)) = autoderef.next() {
@@ -2300,7 +2300,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
23002300
_ => {}
23012301
}
23022302
}
2303-
self.structurally_resolved_type(autoderef.span(), autoderef.final_ty(false));
2303+
self.structurally_resolve_type(autoderef.span(), autoderef.final_ty(false));
23042304

23052305
if let Some((adjustments, did)) = private_candidate {
23062306
// (#90483) apply adjustments to avoid ExprUseVisitor from
@@ -2857,7 +2857,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
28572857
} else if idx_t.references_error() {
28582858
idx_t
28592859
} else {
2860-
let base_t = self.structurally_resolved_type(base.span, base_t);
2860+
let base_t = self.structurally_resolve_type(base.span, base_t);
28612861
match self.lookup_indexing(expr, base, base_t, idx, idx_t) {
28622862
Some((index_ty, element_ty)) => {
28632863
// two-phase not needed because index_ty is never mutable
@@ -3084,7 +3084,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
30843084
// allows them to be inferred based on how they are used later in the
30853085
// function.
30863086
if is_input {
3087-
let ty = self.structurally_resolved_type(expr.span, ty);
3087+
let ty = self.structurally_resolve_type(expr.span, ty);
30883088
match *ty.kind() {
30893089
ty::FnDef(..) => {
30903090
let fnptr_ty = self.tcx.mk_fn_ptr(ty.fn_sig(self.tcx));
@@ -3142,7 +3142,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
31423142
let mut current_container = container;
31433143

31443144
for &field in fields {
3145-
let container = self.structurally_resolved_type(expr.span, current_container);
3145+
let container = self.structurally_resolve_type(expr.span, current_container);
31463146

31473147
match container.kind() {
31483148
ty::Adt(container_def, substs) if !container_def.is_enum() => {

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14731473
///
14741474
/// If no resolution is possible, then an error is reported.
14751475
/// Numeric inference variables may be left unresolved.
1476-
pub fn structurally_resolved_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
1476+
pub fn structurally_resolve_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
14771477
let mut ty = self.resolve_vars_with_obligations(ty);
14781478

14791479
if self.next_trait_solver()

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
184184

185185
// If the arguments should be wrapped in a tuple (ex: closures), unwrap them here
186186
let (formal_input_tys, expected_input_tys) = if tuple_arguments == TupleArguments {
187-
let tuple_type = self.structurally_resolved_type(call_span, formal_input_tys[0]);
187+
let tuple_type = self.structurally_resolve_type(call_span, formal_input_tys[0]);
188188
match tuple_type.kind() {
189189
// We expected a tuple and got a tuple
190190
ty::Tuple(arg_types) => {
@@ -412,7 +412,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
412412

413413
// There are a few types which get autopromoted when passed via varargs
414414
// in C but we just error out instead and require explicit casts.
415-
let arg_ty = self.structurally_resolved_type(arg.span, arg_ty);
415+
let arg_ty = self.structurally_resolve_type(arg.span, arg_ty);
416416
match arg_ty.kind() {
417417
ty::Float(ty::FloatTy::F32) => {
418418
variadic_error(tcx.sess, arg.span, arg_ty, "c_double");

compiler/rustc_hir_typeck/src/method/confirm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
179179
assert_eq!(n, pick.autoderefs);
180180

181181
let mut adjustments = self.adjust_steps(&autoderef);
182-
let mut target = self.structurally_resolved_type(autoderef.span(), ty);
182+
let mut target = self.structurally_resolve_type(autoderef.span(), ty);
183183

184184
match pick.autoref_or_ptr_adjustment {
185185
Some(probe::AutorefOrPtrAdjustment::Autoref { mutbl, unsize }) => {

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
451451
} else {
452452
// Ended up encountering a type variable when doing autoderef,
453453
// but it may not be a type variable after processing obligations
454-
// in our local `FnCtxt`, so don't call `structurally_resolved_type`.
454+
// in our local `FnCtxt`, so don't call `structurally_resolve_type`.
455455
let ty = &bad_ty.ty;
456456
let ty = self
457457
.probe_instantiate_query_response(span, &orig_values, ty)

compiler/rustc_hir_typeck/src/pat.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
393393
// They can denote both statically and dynamically-sized byte arrays.
394394
let mut pat_ty = ty;
395395
if let hir::ExprKind::Lit(Spanned { node: ast::LitKind::ByteStr(..), .. }) = lt.kind {
396-
let expected = self.structurally_resolved_type(span, expected);
396+
let expected = self.structurally_resolve_type(span, expected);
397397
if let ty::Ref(_, inner_ty, _) = expected.kind()
398398
&& matches!(inner_ty.kind(), ty::Slice(_))
399399
{
@@ -501,7 +501,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
501501
// This check is needed if both sides are inference variables.
502502
// We require types to be resolved here so that we emit inference failure
503503
// rather than "_ is not a char or numeric".
504-
let ty = self.structurally_resolved_type(span, expected);
504+
let ty = self.structurally_resolve_type(span, expected);
505505
if !(ty.is_numeric() || ty.is_char() || ty.references_error()) {
506506
if let Some((ref mut fail, _, _)) = lhs {
507507
*fail = true;
@@ -1289,7 +1289,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12891289
let mut expected_len = elements.len();
12901290
if ddpos.as_opt_usize().is_some() {
12911291
// Require known type only when `..` is present.
1292-
if let ty::Tuple(tys) = self.structurally_resolved_type(span, expected).kind() {
1292+
if let ty::Tuple(tys) = self.structurally_resolve_type(span, expected).kind() {
12931293
expected_len = tys.len();
12941294
}
12951295
}
@@ -2042,7 +2042,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
20422042
def_bm: BindingMode,
20432043
ti: TopInfo<'tcx>,
20442044
) -> Ty<'tcx> {
2045-
let expected = self.structurally_resolved_type(span, expected);
2045+
let expected = self.structurally_resolve_type(span, expected);
20462046
let (element_ty, opt_slice_ty, inferred) = match *expected.kind() {
20472047
// An array, so we might have something like `let [a, b, c] = [0, 1, 2];`.
20482048
ty::Array(element_ty, len) => {

compiler/rustc_hir_typeck/src/place_op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
107107
index_expr: &hir::Expr<'_>,
108108
) -> Option<(/*index type*/ Ty<'tcx>, /*element type*/ Ty<'tcx>)> {
109109
let adjusted_ty =
110-
self.structurally_resolved_type(autoderef.span(), autoderef.final_ty(false));
110+
self.structurally_resolve_type(autoderef.span(), autoderef.final_ty(false));
111111
debug!(
112112
"try_index_step(expr={:?}, base_expr={:?}, adjusted_ty={:?}, \
113113
index_ty={:?})",

0 commit comments

Comments
 (0)