diff options
| author | lcnr <rust@lcnr.de> | 2021-07-17 16:43:23 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2021-08-26 11:00:30 +0200 |
| commit | cc47998e2877f13712a12b3814cc2bbf07fbae09 (patch) | |
| tree | 46d88e9a1a7ae272191acb1c7e17f067dca95124 /compiler/rustc_mir/src | |
| parent | bfaf13af4e5071b09248979e51c6614bf1353f52 (diff) | |
| download | rust-cc47998e2877f13712a12b3814cc2bbf07fbae09.tar.gz rust-cc47998e2877f13712a12b3814cc2bbf07fbae09.zip | |
add `tcx` to `fn walk`
Diffstat (limited to 'compiler/rustc_mir/src')
| -rw-r--r-- | compiler/rustc_mir/src/monomorphize/collector.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir/src/transform/check_consts/check.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir/src/transform/function_item_references.rs | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_mir/src/monomorphize/collector.rs b/compiler/rustc_mir/src/monomorphize/collector.rs index 95c4237f383..f03036267ac 100644 --- a/compiler/rustc_mir/src/monomorphize/collector.rs +++ b/compiler/rustc_mir/src/monomorphize/collector.rs @@ -573,7 +573,7 @@ fn check_type_length_limit<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) { let type_length = instance .substs .iter() - .flat_map(|arg| arg.walk()) + .flat_map(|arg| arg.walk(tcx)) .filter(|arg| match arg.unpack() { GenericArgKind::Type(_) | GenericArgKind::Const(_) => true, GenericArgKind::Lifetime(_) => false, diff --git a/compiler/rustc_mir/src/transform/check_consts/check.rs b/compiler/rustc_mir/src/transform/check_consts/check.rs index 09e908e6757..0361ddc915d 100644 --- a/compiler/rustc_mir/src/transform/check_consts/check.rs +++ b/compiler/rustc_mir/src/transform/check_consts/check.rs @@ -365,7 +365,7 @@ impl Checker<'mir, 'tcx> { fn check_local_or_return_ty(&mut self, ty: Ty<'tcx>, local: Local) { let kind = self.body.local_kind(local); - for ty in ty.walk() { + for ty in ty.walk(self.tcx) { let ty = match ty.unpack() { GenericArgKind::Type(ty) => ty, diff --git a/compiler/rustc_mir/src/transform/function_item_references.rs b/compiler/rustc_mir/src/transform/function_item_references.rs index 26fe796cb91..ba2c91a9347 100644 --- a/compiler/rustc_mir/src/transform/function_item_references.rs +++ b/compiler/rustc_mir/src/transform/function_item_references.rs @@ -49,7 +49,7 @@ impl<'a, 'tcx> Visitor<'tcx> for FunctionItemRefChecker<'a, 'tcx> { // Handle calls to `transmute` if self.tcx.is_diagnostic_item(sym::transmute, def_id) { let arg_ty = args[0].ty(self.body, self.tcx); - for generic_inner_ty in arg_ty.walk() { + for generic_inner_ty in arg_ty.walk(self.tcx) { if let GenericArgKind::Type(inner_ty) = generic_inner_ty.unpack() { if let Some((fn_id, fn_substs)) = FunctionItemRefChecker::is_fn_ref(inner_ty) @@ -110,7 +110,7 @@ impl<'a, 'tcx> FunctionItemRefChecker<'a, 'tcx> { let arg_defs = self.tcx.fn_sig(def_id).skip_binder().inputs(); for (arg_num, arg_def) in arg_defs.iter().enumerate() { // For all types reachable from the argument type in the fn sig - for generic_inner_ty in arg_def.walk() { + for generic_inner_ty in arg_def.walk(self.tcx) { if let GenericArgKind::Type(inner_ty) = generic_inner_ty.unpack() { // If the inner type matches the type bound by `Pointer` if TyS::same_type(inner_ty, bound_ty) { |
