From 1fc86a63f451b81606e4787692517dc613f333db Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 26 Sep 2022 13:00:29 +0200 Subject: [PATCH] rustc_typeck to rustc_hir_analysis --- Cargo.lock | 64 +++++++++---------- compiler/rustc_codegen_llvm/src/consts.rs | 2 +- .../rustc_codegen_ssa/src/traits/intrinsic.rs | 2 +- compiler/rustc_driver/Cargo.toml | 2 +- compiler/rustc_driver/src/pretty.rs | 2 +- .../Cargo.toml | 2 +- .../README.md | 0 .../src/astconv/errors.rs | 0 .../src/astconv/generics.rs | 0 .../src/astconv/mod.rs | 0 .../src/bounds.rs | 0 .../src/check/_match.rs | 0 .../src/check/autoderef.rs | 0 .../src/check/callee.rs | 0 .../src/check/cast.rs | 0 .../src/check/check.rs | 0 .../src/check/closure.rs | 0 .../src/check/coercion.rs | 0 .../src/check/compare_method.rs | 0 .../src/check/demand.rs | 0 .../src/check/diverges.rs | 0 .../src/check/dropck.rs | 2 +- .../src/check/expectation.rs | 0 .../src/check/expr.rs | 0 .../src/check/fallback.rs | 0 .../src/check/fn_ctxt/_impl.rs | 0 .../src/check/fn_ctxt/arg_matrix.rs | 0 .../src/check/fn_ctxt/checks.rs | 0 .../src/check/fn_ctxt/mod.rs | 0 .../src/check/fn_ctxt/suggestions.rs | 0 .../src/check/gather_locals.rs | 0 .../src/check/generator_interior.rs | 0 .../check/generator_interior/drop_ranges.rs | 0 .../drop_ranges/cfg_build.rs | 0 .../drop_ranges/cfg_propagate.rs | 0 .../drop_ranges/cfg_visualize.rs | 0 .../drop_ranges/record_consumed_borrow.rs | 0 .../src/check/inherited.rs | 0 .../src/check/intrinsic.rs | 0 .../src/check/intrinsicck.rs | 0 .../src/check/method/confirm.rs | 0 .../src/check/method/mod.rs | 0 .../src/check/method/prelude2021.rs | 0 .../src/check/method/probe.rs | 0 .../src/check/method/suggest.rs | 0 .../src/check/mod.rs | 0 .../src/check/op.rs | 0 .../src/check/pat.rs | 0 .../src/check/place_op.rs | 0 .../src/check/region.rs | 0 .../src/check/rvalue_scopes.rs | 0 .../src/check/upvar.rs | 0 .../src/check/wfcheck.rs | 0 .../src/check/writeback.rs | 0 .../src/check_unused.rs | 0 .../src/coherence/builtin.rs | 0 .../src/coherence/inherent_impls.rs | 0 .../src/coherence/inherent_impls_overlap.rs | 0 .../src/coherence/mod.rs | 0 .../src/coherence/orphan.rs | 0 .../src/coherence/unsafety.rs | 0 .../src/collect.rs | 0 .../src/collect/item_bounds.rs | 0 .../src/collect/type_of.rs | 0 .../src/constrained_generic_params.rs | 0 .../src/errors.rs | 0 .../src/expr_use_visitor.rs | 0 .../src/hir_wf_check.rs | 0 .../src/impl_wf_check.rs | 0 .../src/impl_wf_check/min_specialization.rs | 0 .../src/lib.rs | 0 .../src/mem_categorization.rs | 0 .../src/outlives/explicit.rs | 0 .../src/outlives/implicit_infer.rs | 0 .../src/outlives/mod.rs | 0 .../src/outlives/test.rs | 0 .../src/outlives/utils.rs | 0 .../src/structured_errors.rs | 0 .../missing_cast_for_variadic_arg.rs | 0 .../structured_errors/sized_unsized_cast.rs | 0 .../wrong_number_of_generic_args.rs | 0 .../src/variance/constraints.rs | 0 .../src/variance/mod.rs | 0 .../src/variance/solve.rs | 0 .../src/variance/terms.rs | 0 .../src/variance/test.rs | 0 .../src/variance/xform.rs | 0 .../src/infer/error_reporting/mod.rs | 2 +- compiler/rustc_infer/src/infer/mod.rs | 2 +- compiler/rustc_infer/src/lib.rs | 2 +- compiler/rustc_interface/Cargo.toml | 2 +- compiler/rustc_interface/src/passes.rs | 5 +- compiler/rustc_middle/src/ty/cast.rs | 2 +- compiler/rustc_middle/src/ty/context.rs | 2 +- compiler/rustc_middle/src/ty/rvalue_scopes.rs | 2 +- compiler/rustc_middle/src/ty/sty.rs | 4 +- compiler/rustc_mir_build/src/thir/cx/expr.rs | 2 +- .../rustc_mir_build/src/thir/pattern/mod.rs | 2 +- .../src/thir/pattern/usefulness.rs | 2 +- compiler/rustc_passes/src/check_attr.rs | 2 +- compiler/rustc_privacy/Cargo.toml | 2 +- compiler/rustc_privacy/src/lib.rs | 4 +- compiler/rustc_resolve/src/check_unused.rs | 2 +- compiler/rustc_resolve/src/lib.rs | 2 +- compiler/rustc_ty_utils/src/instance.rs | 2 +- src/librustdoc/clean/mod.rs | 4 +- src/librustdoc/clean/types.rs | 2 +- src/librustdoc/core.rs | 2 +- src/librustdoc/lib.rs | 2 +- .../trait-where-clause-const.rs | 2 +- ...eld-present-in-subfield-recursion-limit.rs | 2 +- .../src/default_union_representation.rs | 2 +- src/tools/clippy/clippy_lints/src/escape.rs | 4 +- .../clippy_lints/src/implicit_hasher.rs | 2 +- .../clippy_lints/src/large_const_arrays.rs | 2 +- src/tools/clippy/clippy_lints/src/lib.rs | 2 +- .../clippy_lints/src/loops/mut_range_bound.rs | 4 +- .../clippy/clippy_lints/src/loops/utils.rs | 2 +- .../src/matches/needless_match.rs | 2 +- .../clippy/clippy_lints/src/methods/mod.rs | 2 +- .../src/methods/unnecessary_to_owned.rs | 2 +- .../clippy_lints/src/missing_const_for_fn.rs | 2 +- .../src/needless_pass_by_value.rs | 4 +- .../clippy/clippy_lints/src/non_copy_const.rs | 2 +- .../src/operators/assign_op_pattern.rs | 2 +- .../clippy_lints/src/transmute/utils.rs | 2 +- .../src/types/redundant_allocation.rs | 2 +- .../clippy/clippy_lints/src/types/vec_box.rs | 2 +- src/tools/clippy/clippy_lints/src/use_self.rs | 2 +- .../clippy_lints/src/utils/internal_lints.rs | 2 +- .../clippy_lints/src/zero_sized_map_values.rs | 2 +- src/tools/clippy/clippy_utils/src/lib.rs | 4 +- src/tools/clippy/clippy_utils/src/sugg.rs | 4 +- src/tools/clippy/clippy_utils/src/usage.rs | 4 +- .../transmutes_expressible_as_ptr_casts.fixed | 2 +- .../ui/transmutes_expressible_as_ptr_casts.rs | 2 +- .../crates/hir-ty/src/autoderef.rs | 2 +- .../rust-analyzer/crates/hir-ty/src/infer.rs | 2 +- .../crates/hir-ty/src/infer/coerce.rs | 2 +- .../crates/hir-ty/src/method_resolution.rs | 2 +- 140 files changed, 101 insertions(+), 102 deletions(-) rename compiler/{rustc_typeck => rustc_hir_analysis}/Cargo.toml (97%) rename compiler/{rustc_typeck => rustc_hir_analysis}/README.md (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/astconv/errors.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/astconv/generics.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/astconv/mod.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/bounds.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/_match.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/autoderef.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/callee.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/cast.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/check.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/closure.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/coercion.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/compare_method.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/demand.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/diverges.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/dropck.rs (99%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/expectation.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/expr.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/fallback.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/fn_ctxt/_impl.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/fn_ctxt/arg_matrix.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/fn_ctxt/checks.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/fn_ctxt/mod.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/fn_ctxt/suggestions.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/gather_locals.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/generator_interior.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/generator_interior/drop_ranges.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/generator_interior/drop_ranges/cfg_build.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/generator_interior/drop_ranges/cfg_propagate.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/generator_interior/drop_ranges/cfg_visualize.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/inherited.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/intrinsic.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/intrinsicck.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/method/confirm.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/method/mod.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/method/prelude2021.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/method/probe.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/method/suggest.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/mod.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/op.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/pat.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/place_op.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/region.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/rvalue_scopes.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/upvar.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/wfcheck.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check/writeback.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/check_unused.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/coherence/builtin.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/coherence/inherent_impls.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/coherence/inherent_impls_overlap.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/coherence/mod.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/coherence/orphan.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/coherence/unsafety.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/collect.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/collect/item_bounds.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/collect/type_of.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/constrained_generic_params.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/errors.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/expr_use_visitor.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/hir_wf_check.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/impl_wf_check.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/impl_wf_check/min_specialization.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/lib.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/mem_categorization.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/outlives/explicit.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/outlives/implicit_infer.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/outlives/mod.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/outlives/test.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/outlives/utils.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/structured_errors.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/structured_errors/missing_cast_for_variadic_arg.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/structured_errors/sized_unsized_cast.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/structured_errors/wrong_number_of_generic_args.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/variance/constraints.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/variance/mod.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/variance/solve.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/variance/terms.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/variance/test.rs (100%) rename compiler/{rustc_typeck => rustc_hir_analysis}/src/variance/xform.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 16c0b644e4f..c99a07f40b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3394,6 +3394,7 @@ dependencies = [ "rustc_errors", "rustc_feature", "rustc_hir", + "rustc_hir_analysis", "rustc_hir_pretty", "rustc_interface", "rustc_lint", @@ -3407,7 +3408,6 @@ dependencies = [ "rustc_session", "rustc_span", "rustc_target", - "rustc_typeck", "serde_json", "tracing", "winapi", @@ -3512,6 +3512,35 @@ dependencies = [ "tracing", ] +[[package]] +name = "rustc_hir_analysis" +version = "0.0.0" +dependencies = [ + "rustc_arena", + "rustc_ast", + "rustc_attr", + "rustc_data_structures", + "rustc_errors", + "rustc_feature", + "rustc_graphviz", + "rustc_hir", + "rustc_hir_pretty", + "rustc_index", + "rustc_infer", + "rustc_lint", + "rustc_macros", + "rustc_middle", + "rustc_serialize", + "rustc_session", + "rustc_span", + "rustc_target", + "rustc_trait_selection", + "rustc_ty_utils", + "rustc_type_ir", + "smallvec", + "tracing", +] + [[package]] name = "rustc_hir_pretty" version = "0.0.0" @@ -3591,6 +3620,7 @@ dependencies = [ "rustc_errors", "rustc_expand", "rustc_hir", + "rustc_hir_analysis", "rustc_incremental", "rustc_lint", "rustc_macros", @@ -3613,7 +3643,6 @@ dependencies = [ "rustc_trait_selection", "rustc_traits", "rustc_ty_utils", - "rustc_typeck", "smallvec", "tracing", "winapi", @@ -3923,12 +3952,12 @@ dependencies = [ "rustc_data_structures", "rustc_errors", "rustc_hir", + "rustc_hir_analysis", "rustc_macros", "rustc_middle", "rustc_session", "rustc_span", "rustc_trait_selection", - "rustc_typeck", "tracing", ] @@ -4212,35 +4241,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "rustc_typeck" -version = "0.0.0" -dependencies = [ - "rustc_arena", - "rustc_ast", - "rustc_attr", - "rustc_data_structures", - "rustc_errors", - "rustc_feature", - "rustc_graphviz", - "rustc_hir", - "rustc_hir_pretty", - "rustc_index", - "rustc_infer", - "rustc_lint", - "rustc_macros", - "rustc_middle", - "rustc_serialize", - "rustc_session", - "rustc_span", - "rustc_target", - "rustc_trait_selection", - "rustc_ty_utils", - "rustc_type_ir", - "smallvec", - "tracing", -] - [[package]] name = "rustc_version" version = "0.4.0" diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs index a559f7f3d57..ee2fc65e37b 100644 --- a/compiler/rustc_codegen_llvm/src/consts.rs +++ b/compiler/rustc_codegen_llvm/src/consts.rs @@ -552,7 +552,7 @@ impl<'ll> StaticMethods for CodegenCx<'ll, '_> { // `#[used(compiler)]` is explicitly requested. This is to avoid similar breakage // on other targets, in particular MachO targets have *their* static constructor // lists broken if `llvm.compiler.used` is emitted rather than llvm.used. However, - // that check happens when assigning the `CodegenFnAttrFlags` in `rustc_typeck`, + // that check happens when assigning the `CodegenFnAttrFlags` in `rustc_hir_analysis`, // so we don't need to take care of it here. self.add_compiler_used_global(g); } diff --git a/compiler/rustc_codegen_ssa/src/traits/intrinsic.rs b/compiler/rustc_codegen_ssa/src/traits/intrinsic.rs index 7755e67938c..450672fb941 100644 --- a/compiler/rustc_codegen_ssa/src/traits/intrinsic.rs +++ b/compiler/rustc_codegen_ssa/src/traits/intrinsic.rs @@ -5,7 +5,7 @@ use rustc_span::Span; use rustc_target::abi::call::FnAbi; pub trait IntrinsicCallMethods<'tcx>: BackendTypes { - /// Remember to add all intrinsics here, in `compiler/rustc_typeck/src/check/mod.rs`, + /// Remember to add all intrinsics here, in `compiler/rustc_hir_analysis/src/check/mod.rs`, /// and in `library/core/src/intrinsics.rs`; if you need access to any LLVM intrinsics, /// add them to `compiler/rustc_codegen_llvm/src/context.rs`. fn codegen_intrinsic_call( diff --git a/compiler/rustc_driver/Cargo.toml b/compiler/rustc_driver/Cargo.toml index d1d02ed73f9..59e93777748 100644 --- a/compiler/rustc_driver/Cargo.toml +++ b/compiler/rustc_driver/Cargo.toml @@ -30,7 +30,7 @@ rustc_error_codes = { path = "../rustc_error_codes" } rustc_interface = { path = "../rustc_interface" } rustc_ast = { path = "../rustc_ast" } rustc_span = { path = "../rustc_span" } -rustc_typeck = { path = "../rustc_typeck" } +rustc_hir_analysis = { path = "../rustc_hir_analysis" } [target.'cfg(unix)'.dependencies] libc = "0.2" diff --git a/compiler/rustc_driver/src/pretty.rs b/compiler/rustc_driver/src/pretty.rs index e97da4322fa..f9b1316d2eb 100644 --- a/compiler/rustc_driver/src/pretty.rs +++ b/compiler/rustc_driver/src/pretty.rs @@ -502,7 +502,7 @@ fn print_with_analysis( ThirTree => { let mut out = String::new(); - abort_on_err(rustc_typeck::check_crate(tcx), tcx.sess); + abort_on_err(rustc_hir_analysis::check_crate(tcx), tcx.sess); debug!("pretty printing THIR tree"); for did in tcx.hir().body_owners() { let _ = writeln!( diff --git a/compiler/rustc_typeck/Cargo.toml b/compiler/rustc_hir_analysis/Cargo.toml similarity index 97% rename from compiler/rustc_typeck/Cargo.toml rename to compiler/rustc_hir_analysis/Cargo.toml index cae29c1d3c5..dd26b3da7bc 100644 --- a/compiler/rustc_typeck/Cargo.toml +++ b/compiler/rustc_hir_analysis/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rustc_typeck" +name = "rustc_hir_analysis" version = "0.0.0" edition = "2021" diff --git a/compiler/rustc_typeck/README.md b/compiler/rustc_hir_analysis/README.md similarity index 100% rename from compiler/rustc_typeck/README.md rename to compiler/rustc_hir_analysis/README.md diff --git a/compiler/rustc_typeck/src/astconv/errors.rs b/compiler/rustc_hir_analysis/src/astconv/errors.rs similarity index 100% rename from compiler/rustc_typeck/src/astconv/errors.rs rename to compiler/rustc_hir_analysis/src/astconv/errors.rs diff --git a/compiler/rustc_typeck/src/astconv/generics.rs b/compiler/rustc_hir_analysis/src/astconv/generics.rs similarity index 100% rename from compiler/rustc_typeck/src/astconv/generics.rs rename to compiler/rustc_hir_analysis/src/astconv/generics.rs diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs similarity index 100% rename from compiler/rustc_typeck/src/astconv/mod.rs rename to compiler/rustc_hir_analysis/src/astconv/mod.rs diff --git a/compiler/rustc_typeck/src/bounds.rs b/compiler/rustc_hir_analysis/src/bounds.rs similarity index 100% rename from compiler/rustc_typeck/src/bounds.rs rename to compiler/rustc_hir_analysis/src/bounds.rs diff --git a/compiler/rustc_typeck/src/check/_match.rs b/compiler/rustc_hir_analysis/src/check/_match.rs similarity index 100% rename from compiler/rustc_typeck/src/check/_match.rs rename to compiler/rustc_hir_analysis/src/check/_match.rs diff --git a/compiler/rustc_typeck/src/check/autoderef.rs b/compiler/rustc_hir_analysis/src/check/autoderef.rs similarity index 100% rename from compiler/rustc_typeck/src/check/autoderef.rs rename to compiler/rustc_hir_analysis/src/check/autoderef.rs diff --git a/compiler/rustc_typeck/src/check/callee.rs b/compiler/rustc_hir_analysis/src/check/callee.rs similarity index 100% rename from compiler/rustc_typeck/src/check/callee.rs rename to compiler/rustc_hir_analysis/src/check/callee.rs diff --git a/compiler/rustc_typeck/src/check/cast.rs b/compiler/rustc_hir_analysis/src/check/cast.rs similarity index 100% rename from compiler/rustc_typeck/src/check/cast.rs rename to compiler/rustc_hir_analysis/src/check/cast.rs diff --git a/compiler/rustc_typeck/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs similarity index 100% rename from compiler/rustc_typeck/src/check/check.rs rename to compiler/rustc_hir_analysis/src/check/check.rs diff --git a/compiler/rustc_typeck/src/check/closure.rs b/compiler/rustc_hir_analysis/src/check/closure.rs similarity index 100% rename from compiler/rustc_typeck/src/check/closure.rs rename to compiler/rustc_hir_analysis/src/check/closure.rs diff --git a/compiler/rustc_typeck/src/check/coercion.rs b/compiler/rustc_hir_analysis/src/check/coercion.rs similarity index 100% rename from compiler/rustc_typeck/src/check/coercion.rs rename to compiler/rustc_hir_analysis/src/check/coercion.rs diff --git a/compiler/rustc_typeck/src/check/compare_method.rs b/compiler/rustc_hir_analysis/src/check/compare_method.rs similarity index 100% rename from compiler/rustc_typeck/src/check/compare_method.rs rename to compiler/rustc_hir_analysis/src/check/compare_method.rs diff --git a/compiler/rustc_typeck/src/check/demand.rs b/compiler/rustc_hir_analysis/src/check/demand.rs similarity index 100% rename from compiler/rustc_typeck/src/check/demand.rs rename to compiler/rustc_hir_analysis/src/check/demand.rs diff --git a/compiler/rustc_typeck/src/check/diverges.rs b/compiler/rustc_hir_analysis/src/check/diverges.rs similarity index 100% rename from compiler/rustc_typeck/src/check/diverges.rs rename to compiler/rustc_hir_analysis/src/check/diverges.rs diff --git a/compiler/rustc_typeck/src/check/dropck.rs b/compiler/rustc_hir_analysis/src/check/dropck.rs similarity index 99% rename from compiler/rustc_typeck/src/check/dropck.rs rename to compiler/rustc_hir_analysis/src/check/dropck.rs index ab143c05982..e5b212eb757 100644 --- a/compiler/rustc_typeck/src/check/dropck.rs +++ b/compiler/rustc_hir_analysis/src/check/dropck.rs @@ -1,4 +1,4 @@ -// FIXME(@lcnr): Move this module out of `rustc_typeck`. +// FIXME(@lcnr): Move this module out of `rustc_hir_analysis`. // // We don't do any drop checking during hir typeck. use crate::hir::def_id::{DefId, LocalDefId}; diff --git a/compiler/rustc_typeck/src/check/expectation.rs b/compiler/rustc_hir_analysis/src/check/expectation.rs similarity index 100% rename from compiler/rustc_typeck/src/check/expectation.rs rename to compiler/rustc_hir_analysis/src/check/expectation.rs diff --git a/compiler/rustc_typeck/src/check/expr.rs b/compiler/rustc_hir_analysis/src/check/expr.rs similarity index 100% rename from compiler/rustc_typeck/src/check/expr.rs rename to compiler/rustc_hir_analysis/src/check/expr.rs diff --git a/compiler/rustc_typeck/src/check/fallback.rs b/compiler/rustc_hir_analysis/src/check/fallback.rs similarity index 100% rename from compiler/rustc_typeck/src/check/fallback.rs rename to compiler/rustc_hir_analysis/src/check/fallback.rs diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs b/compiler/rustc_hir_analysis/src/check/fn_ctxt/_impl.rs similarity index 100% rename from compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs rename to compiler/rustc_hir_analysis/src/check/fn_ctxt/_impl.rs diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs b/compiler/rustc_hir_analysis/src/check/fn_ctxt/arg_matrix.rs similarity index 100% rename from compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs rename to compiler/rustc_hir_analysis/src/check/fn_ctxt/arg_matrix.rs diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs b/compiler/rustc_hir_analysis/src/check/fn_ctxt/checks.rs similarity index 100% rename from compiler/rustc_typeck/src/check/fn_ctxt/checks.rs rename to compiler/rustc_hir_analysis/src/check/fn_ctxt/checks.rs diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/mod.rs b/compiler/rustc_hir_analysis/src/check/fn_ctxt/mod.rs similarity index 100% rename from compiler/rustc_typeck/src/check/fn_ctxt/mod.rs rename to compiler/rustc_hir_analysis/src/check/fn_ctxt/mod.rs diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/suggestions.rs b/compiler/rustc_hir_analysis/src/check/fn_ctxt/suggestions.rs similarity index 100% rename from compiler/rustc_typeck/src/check/fn_ctxt/suggestions.rs rename to compiler/rustc_hir_analysis/src/check/fn_ctxt/suggestions.rs diff --git a/compiler/rustc_typeck/src/check/gather_locals.rs b/compiler/rustc_hir_analysis/src/check/gather_locals.rs similarity index 100% rename from compiler/rustc_typeck/src/check/gather_locals.rs rename to compiler/rustc_hir_analysis/src/check/gather_locals.rs diff --git a/compiler/rustc_typeck/src/check/generator_interior.rs b/compiler/rustc_hir_analysis/src/check/generator_interior.rs similarity index 100% rename from compiler/rustc_typeck/src/check/generator_interior.rs rename to compiler/rustc_hir_analysis/src/check/generator_interior.rs diff --git a/compiler/rustc_typeck/src/check/generator_interior/drop_ranges.rs b/compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges.rs similarity index 100% rename from compiler/rustc_typeck/src/check/generator_interior/drop_ranges.rs rename to compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges.rs diff --git a/compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs b/compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges/cfg_build.rs similarity index 100% rename from compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs rename to compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges/cfg_build.rs diff --git a/compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_propagate.rs b/compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges/cfg_propagate.rs similarity index 100% rename from compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_propagate.rs rename to compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges/cfg_propagate.rs diff --git a/compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_visualize.rs b/compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges/cfg_visualize.rs similarity index 100% rename from compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_visualize.rs rename to compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges/cfg_visualize.rs diff --git a/compiler/rustc_typeck/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs b/compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs similarity index 100% rename from compiler/rustc_typeck/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs rename to compiler/rustc_hir_analysis/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs diff --git a/compiler/rustc_typeck/src/check/inherited.rs b/compiler/rustc_hir_analysis/src/check/inherited.rs similarity index 100% rename from compiler/rustc_typeck/src/check/inherited.rs rename to compiler/rustc_hir_analysis/src/check/inherited.rs diff --git a/compiler/rustc_typeck/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs similarity index 100% rename from compiler/rustc_typeck/src/check/intrinsic.rs rename to compiler/rustc_hir_analysis/src/check/intrinsic.rs diff --git a/compiler/rustc_typeck/src/check/intrinsicck.rs b/compiler/rustc_hir_analysis/src/check/intrinsicck.rs similarity index 100% rename from compiler/rustc_typeck/src/check/intrinsicck.rs rename to compiler/rustc_hir_analysis/src/check/intrinsicck.rs diff --git a/compiler/rustc_typeck/src/check/method/confirm.rs b/compiler/rustc_hir_analysis/src/check/method/confirm.rs similarity index 100% rename from compiler/rustc_typeck/src/check/method/confirm.rs rename to compiler/rustc_hir_analysis/src/check/method/confirm.rs diff --git a/compiler/rustc_typeck/src/check/method/mod.rs b/compiler/rustc_hir_analysis/src/check/method/mod.rs similarity index 100% rename from compiler/rustc_typeck/src/check/method/mod.rs rename to compiler/rustc_hir_analysis/src/check/method/mod.rs diff --git a/compiler/rustc_typeck/src/check/method/prelude2021.rs b/compiler/rustc_hir_analysis/src/check/method/prelude2021.rs similarity index 100% rename from compiler/rustc_typeck/src/check/method/prelude2021.rs rename to compiler/rustc_hir_analysis/src/check/method/prelude2021.rs diff --git a/compiler/rustc_typeck/src/check/method/probe.rs b/compiler/rustc_hir_analysis/src/check/method/probe.rs similarity index 100% rename from compiler/rustc_typeck/src/check/method/probe.rs rename to compiler/rustc_hir_analysis/src/check/method/probe.rs diff --git a/compiler/rustc_typeck/src/check/method/suggest.rs b/compiler/rustc_hir_analysis/src/check/method/suggest.rs similarity index 100% rename from compiler/rustc_typeck/src/check/method/suggest.rs rename to compiler/rustc_hir_analysis/src/check/method/suggest.rs diff --git a/compiler/rustc_typeck/src/check/mod.rs b/compiler/rustc_hir_analysis/src/check/mod.rs similarity index 100% rename from compiler/rustc_typeck/src/check/mod.rs rename to compiler/rustc_hir_analysis/src/check/mod.rs diff --git a/compiler/rustc_typeck/src/check/op.rs b/compiler/rustc_hir_analysis/src/check/op.rs similarity index 100% rename from compiler/rustc_typeck/src/check/op.rs rename to compiler/rustc_hir_analysis/src/check/op.rs diff --git a/compiler/rustc_typeck/src/check/pat.rs b/compiler/rustc_hir_analysis/src/check/pat.rs similarity index 100% rename from compiler/rustc_typeck/src/check/pat.rs rename to compiler/rustc_hir_analysis/src/check/pat.rs diff --git a/compiler/rustc_typeck/src/check/place_op.rs b/compiler/rustc_hir_analysis/src/check/place_op.rs similarity index 100% rename from compiler/rustc_typeck/src/check/place_op.rs rename to compiler/rustc_hir_analysis/src/check/place_op.rs diff --git a/compiler/rustc_typeck/src/check/region.rs b/compiler/rustc_hir_analysis/src/check/region.rs similarity index 100% rename from compiler/rustc_typeck/src/check/region.rs rename to compiler/rustc_hir_analysis/src/check/region.rs diff --git a/compiler/rustc_typeck/src/check/rvalue_scopes.rs b/compiler/rustc_hir_analysis/src/check/rvalue_scopes.rs similarity index 100% rename from compiler/rustc_typeck/src/check/rvalue_scopes.rs rename to compiler/rustc_hir_analysis/src/check/rvalue_scopes.rs diff --git a/compiler/rustc_typeck/src/check/upvar.rs b/compiler/rustc_hir_analysis/src/check/upvar.rs similarity index 100% rename from compiler/rustc_typeck/src/check/upvar.rs rename to compiler/rustc_hir_analysis/src/check/upvar.rs diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs similarity index 100% rename from compiler/rustc_typeck/src/check/wfcheck.rs rename to compiler/rustc_hir_analysis/src/check/wfcheck.rs diff --git a/compiler/rustc_typeck/src/check/writeback.rs b/compiler/rustc_hir_analysis/src/check/writeback.rs similarity index 100% rename from compiler/rustc_typeck/src/check/writeback.rs rename to compiler/rustc_hir_analysis/src/check/writeback.rs diff --git a/compiler/rustc_typeck/src/check_unused.rs b/compiler/rustc_hir_analysis/src/check_unused.rs similarity index 100% rename from compiler/rustc_typeck/src/check_unused.rs rename to compiler/rustc_hir_analysis/src/check_unused.rs diff --git a/compiler/rustc_typeck/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs similarity index 100% rename from compiler/rustc_typeck/src/coherence/builtin.rs rename to compiler/rustc_hir_analysis/src/coherence/builtin.rs diff --git a/compiler/rustc_typeck/src/coherence/inherent_impls.rs b/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs similarity index 100% rename from compiler/rustc_typeck/src/coherence/inherent_impls.rs rename to compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs diff --git a/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs similarity index 100% rename from compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs rename to compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs diff --git a/compiler/rustc_typeck/src/coherence/mod.rs b/compiler/rustc_hir_analysis/src/coherence/mod.rs similarity index 100% rename from compiler/rustc_typeck/src/coherence/mod.rs rename to compiler/rustc_hir_analysis/src/coherence/mod.rs diff --git a/compiler/rustc_typeck/src/coherence/orphan.rs b/compiler/rustc_hir_analysis/src/coherence/orphan.rs similarity index 100% rename from compiler/rustc_typeck/src/coherence/orphan.rs rename to compiler/rustc_hir_analysis/src/coherence/orphan.rs diff --git a/compiler/rustc_typeck/src/coherence/unsafety.rs b/compiler/rustc_hir_analysis/src/coherence/unsafety.rs similarity index 100% rename from compiler/rustc_typeck/src/coherence/unsafety.rs rename to compiler/rustc_hir_analysis/src/coherence/unsafety.rs diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs similarity index 100% rename from compiler/rustc_typeck/src/collect.rs rename to compiler/rustc_hir_analysis/src/collect.rs diff --git a/compiler/rustc_typeck/src/collect/item_bounds.rs b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs similarity index 100% rename from compiler/rustc_typeck/src/collect/item_bounds.rs rename to compiler/rustc_hir_analysis/src/collect/item_bounds.rs diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_hir_analysis/src/collect/type_of.rs similarity index 100% rename from compiler/rustc_typeck/src/collect/type_of.rs rename to compiler/rustc_hir_analysis/src/collect/type_of.rs diff --git a/compiler/rustc_typeck/src/constrained_generic_params.rs b/compiler/rustc_hir_analysis/src/constrained_generic_params.rs similarity index 100% rename from compiler/rustc_typeck/src/constrained_generic_params.rs rename to compiler/rustc_hir_analysis/src/constrained_generic_params.rs diff --git a/compiler/rustc_typeck/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs similarity index 100% rename from compiler/rustc_typeck/src/errors.rs rename to compiler/rustc_hir_analysis/src/errors.rs diff --git a/compiler/rustc_typeck/src/expr_use_visitor.rs b/compiler/rustc_hir_analysis/src/expr_use_visitor.rs similarity index 100% rename from compiler/rustc_typeck/src/expr_use_visitor.rs rename to compiler/rustc_hir_analysis/src/expr_use_visitor.rs diff --git a/compiler/rustc_typeck/src/hir_wf_check.rs b/compiler/rustc_hir_analysis/src/hir_wf_check.rs similarity index 100% rename from compiler/rustc_typeck/src/hir_wf_check.rs rename to compiler/rustc_hir_analysis/src/hir_wf_check.rs diff --git a/compiler/rustc_typeck/src/impl_wf_check.rs b/compiler/rustc_hir_analysis/src/impl_wf_check.rs similarity index 100% rename from compiler/rustc_typeck/src/impl_wf_check.rs rename to compiler/rustc_hir_analysis/src/impl_wf_check.rs diff --git a/compiler/rustc_typeck/src/impl_wf_check/min_specialization.rs b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs similarity index 100% rename from compiler/rustc_typeck/src/impl_wf_check/min_specialization.rs rename to compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs similarity index 100% rename from compiler/rustc_typeck/src/lib.rs rename to compiler/rustc_hir_analysis/src/lib.rs diff --git a/compiler/rustc_typeck/src/mem_categorization.rs b/compiler/rustc_hir_analysis/src/mem_categorization.rs similarity index 100% rename from compiler/rustc_typeck/src/mem_categorization.rs rename to compiler/rustc_hir_analysis/src/mem_categorization.rs diff --git a/compiler/rustc_typeck/src/outlives/explicit.rs b/compiler/rustc_hir_analysis/src/outlives/explicit.rs similarity index 100% rename from compiler/rustc_typeck/src/outlives/explicit.rs rename to compiler/rustc_hir_analysis/src/outlives/explicit.rs diff --git a/compiler/rustc_typeck/src/outlives/implicit_infer.rs b/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs similarity index 100% rename from compiler/rustc_typeck/src/outlives/implicit_infer.rs rename to compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs diff --git a/compiler/rustc_typeck/src/outlives/mod.rs b/compiler/rustc_hir_analysis/src/outlives/mod.rs similarity index 100% rename from compiler/rustc_typeck/src/outlives/mod.rs rename to compiler/rustc_hir_analysis/src/outlives/mod.rs diff --git a/compiler/rustc_typeck/src/outlives/test.rs b/compiler/rustc_hir_analysis/src/outlives/test.rs similarity index 100% rename from compiler/rustc_typeck/src/outlives/test.rs rename to compiler/rustc_hir_analysis/src/outlives/test.rs diff --git a/compiler/rustc_typeck/src/outlives/utils.rs b/compiler/rustc_hir_analysis/src/outlives/utils.rs similarity index 100% rename from compiler/rustc_typeck/src/outlives/utils.rs rename to compiler/rustc_hir_analysis/src/outlives/utils.rs diff --git a/compiler/rustc_typeck/src/structured_errors.rs b/compiler/rustc_hir_analysis/src/structured_errors.rs similarity index 100% rename from compiler/rustc_typeck/src/structured_errors.rs rename to compiler/rustc_hir_analysis/src/structured_errors.rs diff --git a/compiler/rustc_typeck/src/structured_errors/missing_cast_for_variadic_arg.rs b/compiler/rustc_hir_analysis/src/structured_errors/missing_cast_for_variadic_arg.rs similarity index 100% rename from compiler/rustc_typeck/src/structured_errors/missing_cast_for_variadic_arg.rs rename to compiler/rustc_hir_analysis/src/structured_errors/missing_cast_for_variadic_arg.rs diff --git a/compiler/rustc_typeck/src/structured_errors/sized_unsized_cast.rs b/compiler/rustc_hir_analysis/src/structured_errors/sized_unsized_cast.rs similarity index 100% rename from compiler/rustc_typeck/src/structured_errors/sized_unsized_cast.rs rename to compiler/rustc_hir_analysis/src/structured_errors/sized_unsized_cast.rs diff --git a/compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs similarity index 100% rename from compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs rename to compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs diff --git a/compiler/rustc_typeck/src/variance/constraints.rs b/compiler/rustc_hir_analysis/src/variance/constraints.rs similarity index 100% rename from compiler/rustc_typeck/src/variance/constraints.rs rename to compiler/rustc_hir_analysis/src/variance/constraints.rs diff --git a/compiler/rustc_typeck/src/variance/mod.rs b/compiler/rustc_hir_analysis/src/variance/mod.rs similarity index 100% rename from compiler/rustc_typeck/src/variance/mod.rs rename to compiler/rustc_hir_analysis/src/variance/mod.rs diff --git a/compiler/rustc_typeck/src/variance/solve.rs b/compiler/rustc_hir_analysis/src/variance/solve.rs similarity index 100% rename from compiler/rustc_typeck/src/variance/solve.rs rename to compiler/rustc_hir_analysis/src/variance/solve.rs diff --git a/compiler/rustc_typeck/src/variance/terms.rs b/compiler/rustc_hir_analysis/src/variance/terms.rs similarity index 100% rename from compiler/rustc_typeck/src/variance/terms.rs rename to compiler/rustc_hir_analysis/src/variance/terms.rs diff --git a/compiler/rustc_typeck/src/variance/test.rs b/compiler/rustc_hir_analysis/src/variance/test.rs similarity index 100% rename from compiler/rustc_typeck/src/variance/test.rs rename to compiler/rustc_hir_analysis/src/variance/test.rs diff --git a/compiler/rustc_typeck/src/variance/xform.rs b/compiler/rustc_hir_analysis/src/variance/xform.rs similarity index 100% rename from compiler/rustc_typeck/src/variance/xform.rs rename to compiler/rustc_hir_analysis/src/variance/xform.rs diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index 99469d1e1e7..99de5b65981 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -1862,7 +1862,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { // In some (most?) cases cause.body_id points to actual body, but in some cases // it's an actual definition. According to the comments (e.g. in - // librustc_typeck/check/compare_method.rs:compare_predicate_entailment) the latter + // rustc_hir_analysis/check/compare_method.rs:compare_predicate_entailment) the latter // is relied upon by some other code. This might (or might not) need cleanup. let body_owner_def_id = self.tcx.hir().opt_local_def_id(cause.body_id).unwrap_or_else(|| { diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index efc9c1ca46f..b9fd79e0d2f 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -581,7 +581,7 @@ impl<'tcx> TyCtxtInferExt<'tcx> for TyCtxt<'tcx> { } impl<'tcx> InferCtxtBuilder<'tcx> { - /// Used only by `rustc_typeck` during body type-checking/inference, + /// Used only by `rustc_hir_analysis` during body type-checking/inference, /// will initialize `in_progress_typeck_results` with fresh `TypeckResults`. /// Will also change the scope for opaque type defining use checks to the given owner. pub fn with_fresh_in_progress_typeck_results(mut self, table_owner: OwnerId) -> Self { diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index b91c098ab03..e040634edb0 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -2,7 +2,7 @@ //! //! - **Type inference.** The type inference code can be found in the `infer` module; //! this code handles low-level equality and subtyping operations. The -//! type check pass in the compiler is found in the `rustc_typeck` crate. +//! type check pass in the compiler is found in the `rustc_hir_analysis` crate. //! //! For more information about how rustc works, see the [rustc dev guide]. //! diff --git a/compiler/rustc_interface/Cargo.toml b/compiler/rustc_interface/Cargo.toml index da4002d09ad..f3c38875b37 100644 --- a/compiler/rustc_interface/Cargo.toml +++ b/compiler/rustc_interface/Cargo.toml @@ -38,7 +38,7 @@ rustc_mir_build = { path = "../rustc_mir_build" } rustc_mir_transform = { path = "../rustc_mir_transform" } rustc_monomorphize = { path = "../rustc_monomorphize" } rustc_passes = { path = "../rustc_passes" } -rustc_typeck = { path = "../rustc_typeck" } +rustc_hir_analysis = { path = "../rustc_hir_analysis" } rustc_lint = { path = "../rustc_lint" } rustc_errors = { path = "../rustc_errors" } rustc_plugin_impl = { path = "../rustc_plugin_impl" } diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index c41b154c3e0..ad3e020b581 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -37,7 +37,6 @@ use rustc_session::{Limit, Session}; use rustc_span::symbol::{sym, Symbol}; use rustc_span::FileName; use rustc_trait_selection::traits; -use rustc_typeck as typeck; use std::any::Any; use std::cell::RefCell; @@ -736,7 +735,7 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock = LazyLock::new(|| { rustc_mir_transform::provide(providers); rustc_monomorphize::provide(providers); rustc_privacy::provide(providers); - typeck::provide(providers); + rustc_hir_analysis::provide(providers); ty::provide(providers); traits::provide(providers); rustc_passes::provide(providers); @@ -880,7 +879,7 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { }); // passes are timed inside typeck - typeck::check_crate(tcx)?; + rustc_hir_analysis::check_crate(tcx)?; sess.time("misc_checking_2", || { parallel!( diff --git a/compiler/rustc_middle/src/ty/cast.rs b/compiler/rustc_middle/src/ty/cast.rs index 981e2d3b6d2..2de27102bcc 100644 --- a/compiler/rustc_middle/src/ty/cast.rs +++ b/compiler/rustc_middle/src/ty/cast.rs @@ -38,7 +38,7 @@ pub enum CastTy<'tcx> { } /// Cast Kind. See [RFC 401](https://rust-lang.github.io/rfcs/0401-coercions.html) -/// (or librustc_typeck/check/cast.rs). +/// (or rustc_hir_analysis/check/cast.rs). #[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)] pub enum CastKind { CoercionCast, diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index e430c327efe..4781585b82c 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -574,7 +574,7 @@ pub struct TypeckResults<'tcx> { /// Tracks the rvalue scoping rules which defines finer scoping for rvalue expressions /// by applying extended parameter rules. - /// Details may be find in `rustc_typeck::check::rvalue_scopes`. + /// Details may be find in `rustc_hir_analysis::check::rvalue_scopes`. pub rvalue_scopes: RvalueScopes, /// Stores the type, expression, span and optional scope span of all types diff --git a/compiler/rustc_middle/src/ty/rvalue_scopes.rs b/compiler/rustc_middle/src/ty/rvalue_scopes.rs index e86dafae338..e79b79a25ae 100644 --- a/compiler/rustc_middle/src/ty/rvalue_scopes.rs +++ b/compiler/rustc_middle/src/ty/rvalue_scopes.rs @@ -3,7 +3,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_hir as hir; /// `RvalueScopes` is a mapping from sub-expressions to _extended_ lifetime as determined by -/// rules laid out in `rustc_typeck::check::rvalue_scopes`. +/// rules laid out in `rustc_hir_analysis::check::rvalue_scopes`. #[derive(TyEncodable, TyDecodable, Clone, Debug, Default, Eq, PartialEq, HashStable)] pub struct RvalueScopes { map: FxHashMap>, diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index f4f4bb37c1a..2f6ec836c3c 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -315,7 +315,7 @@ impl<'tcx> ClosureSubsts<'tcx> { /// closure. // FIXME(eddyb) this should be unnecessary, as the shallowly resolved // type is known at the time of the creation of `ClosureSubsts`, - // see `rustc_typeck::check::closure`. + // see `rustc_hir_analysis::check::closure`. pub fn sig_as_fn_ptr_ty(self) -> Ty<'tcx> { self.split().closure_sig_as_fn_ptr_ty.expect_ty() } @@ -2121,7 +2121,7 @@ impl<'tcx> Ty<'tcx> { /// /// Note that during type checking, we use an inference variable /// to represent the closure kind, because it has not yet been - /// inferred. Once upvar inference (in `rustc_typeck/src/check/upvar.rs`) + /// inferred. Once upvar inference (in `rustc_hir_analysis/src/check/upvar.rs`) /// is complete, that type variable will be unified. pub fn to_opt_closure_kind(self) -> Option { match self.kind() { diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index 3f8a9d21cd8..bcf2ed68172 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -998,7 +998,7 @@ impl<'tcx> Cx<'tcx> { .temporary_scope(self.region_scope_tree, closure_expr.hir_id.local_id); let var_ty = place.base_ty; - // The result of capture analysis in `rustc_typeck/check/upvar.rs`represents a captured path + // The result of capture analysis in `rustc_hir_analysis/check/upvar.rs`represents a captured path // as it's seen for use within the closure and not at the time of closure creation. // // That is we see expect to see it start from a captured upvar and not something that is local diff --git a/compiler/rustc_mir_build/src/thir/pattern/mod.rs b/compiler/rustc_mir_build/src/thir/pattern/mod.rs index 11645f840c1..cd186421bb1 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/mod.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/mod.rs @@ -86,7 +86,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> { // ``` // // the type assigned to `Some(n)` in `unadjusted_pat` would be `Option` (this is - // determined in rustc_typeck::check::match). The adjustments would be + // determined in rustc_hir_analysis::check::match). The adjustments would be // // `vec![&&Option, &Option]`. // diff --git a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs index 02e047afaf3..22b58837148 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs @@ -746,7 +746,7 @@ impl<'p, 'tcx> Witness<'p, 'tcx> { /// Report that a match of a `non_exhaustive` enum marked with `non_exhaustive_omitted_patterns` /// is not exhaustive enough. /// -/// NB: The partner lint for structs lives in `compiler/rustc_typeck/src/check/pat.rs`. +/// NB: The partner lint for structs lives in `compiler/rustc_hir_analysis/src/check/pat.rs`. fn lint_non_exhaustive_omitted_patterns<'p, 'tcx>( cx: &MatchCheckCtxt<'p, 'tcx>, scrut_ty: Ty<'tcx>, diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index a21521ff68b..897a0db930c 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -1744,7 +1744,7 @@ impl CheckAttrVisitor<'_> { } } Some(_) => { - // This error case is handled in rustc_typeck::collect. + // This error case is handled in rustc_hir_analysis::collect. } None => { // Default case (compiler) when arg isn't defined. diff --git a/compiler/rustc_privacy/Cargo.toml b/compiler/rustc_privacy/Cargo.toml index 5785921fb1e..832fdc9f016 100644 --- a/compiler/rustc_privacy/Cargo.toml +++ b/compiler/rustc_privacy/Cargo.toml @@ -14,5 +14,5 @@ rustc_middle = { path = "../rustc_middle" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } rustc_trait_selection = { path = "../rustc_trait_selection" } -rustc_typeck = { path = "../rustc_typeck" } +rustc_hir_analysis = { path = "../rustc_hir_analysis" } tracing = "0.1" diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 41d5f54b366..7ab07a671c4 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -1207,7 +1207,7 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> { // Types in signatures. // FIXME: This is very ineffective. Ideally each HIR type should be converted // into a semantic type only once and the result should be cached somehow. - if self.visit(rustc_typeck::hir_ty_to_ty(self.tcx, hir_ty)).is_break() { + if self.visit(rustc_hir_analysis::hir_ty_to_ty(self.tcx, hir_ty)).is_break() { return; } } @@ -1236,7 +1236,7 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> { if self.maybe_typeck_results.is_none() { // Avoid calling `hir_trait_to_predicates` in bodies, it will ICE. // The traits' privacy in bodies is already checked as a part of trait object types. - let bounds = rustc_typeck::hir_trait_to_predicates( + let bounds = rustc_hir_analysis::hir_trait_to_predicates( self.tcx, trait_ref, // NOTE: This isn't really right, but the actual type doesn't matter here. It's diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs index 8b58b32b656..01c3801f223 100644 --- a/compiler/rustc_resolve/src/check_unused.rs +++ b/compiler/rustc_resolve/src/check_unused.rs @@ -6,7 +6,7 @@ // `use` items. // // Unused trait imports can't be checked until the method resolution. We save -// candidates here, and do the actual check in librustc_typeck/check_unused.rs. +// candidates here, and do the actual check in rustc_hir_analysis/check_unused.rs. // // Checking for unused imports is split into three steps: // diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 583030b0e50..9b52decd9c7 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -4,7 +4,7 @@ //! Paths in macros, imports, expressions, types, patterns are resolved here. //! Label and lifetime names are resolved here as well. //! -//! Type-relative name resolution (methods, fields, associated items) happens in `rustc_typeck`. +//! Type-relative name resolution (methods, fields, associated items) happens in `rustc_hir_analysis`. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(box_patterns)] diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 05738b6c48a..fa1dc90e4a2 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -187,7 +187,7 @@ fn resolve_associated_item<'tcx>( // we know the error would've been caught (e.g. in an upstream crate). // // A better approach might be to just introduce a query (returning - // `Result<(), ErrorGuaranteed>`) for the check that `rustc_typeck` + // `Result<(), ErrorGuaranteed>`) for the check that `rustc_hir_analysis` // performs (i.e. that the definition's type in the `impl` matches // the declaration in the `trait`), so that we can cheaply check // here if it failed, instead of approximating it. diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index bd68dffb823..704292c1048 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -17,6 +17,7 @@ use rustc_hir as hir; use rustc_hir::def::{CtorKind, DefKind, Res}; use rustc_hir::def_id::{DefId, LOCAL_CRATE}; use rustc_hir::PredicateOrigin; +use rustc_hir_analysis::hir_ty_to_ty; use rustc_infer::infer::region_constraints::{Constraint, RegionConstraintData}; use rustc_middle::middle::resolve_lifetime as rl; use rustc_middle::ty::fold::TypeFolder; @@ -26,7 +27,6 @@ use rustc_middle::{bug, span_bug}; use rustc_span::hygiene::{AstPass, MacroKind}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{self, ExpnKind}; -use rustc_typeck::hir_ty_to_ty; use std::assert_matches::assert_matches; use std::collections::hash_map::Entry; @@ -632,7 +632,7 @@ fn clean_ty_generics<'tcx>( let mut impl_trait = BTreeMap::>::default(); // Bounds in the type_params and lifetimes fields are repeated in the - // predicates field (see rustc_typeck::collect::ty_generics), so remove + // predicates field (see rustc_hir_analysis::collect::ty_generics), so remove // them. let stripped_params = gens .params diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index f06d2cf108d..e53e93c4def 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -21,6 +21,7 @@ use rustc_hir::def::{CtorKind, DefKind, Res}; use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; use rustc_hir::lang_items::LangItem; use rustc_hir::{BodyId, Mutability}; +use rustc_hir_analysis::check::intrinsic::intrinsic_operation_unsafety; use rustc_index::vec::IndexVec; use rustc_middle::ty::fast_reject::SimplifiedType; use rustc_middle::ty::{self, TyCtxt}; @@ -31,7 +32,6 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{self, FileName, Loc}; use rustc_target::abi::VariantIdx; use rustc_target::spec::abi::Abi; -use rustc_typeck::check::intrinsic::intrinsic_operation_unsafety; use crate::clean::cfg::Cfg; use crate::clean::clean_visibility; diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 76562d26a55..09a26cbac3e 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -293,7 +293,7 @@ pub(crate) fn create_config( override_queries: Some(|_sess, providers, _external_providers| { // Most lints will require typechecking, so just don't run them. providers.lint_mod = |_, _| {}; - // Prevent `rustc_typeck::check_crate` from calling `typeck` on all bodies. + // Prevent `rustc_hir_analysis::check_crate` from calling `typeck` on all bodies. providers.typeck_item_bodies = |_, _| {}; // hack so that `used_trait_imports` won't try to call typeck providers.used_trait_imports = |_, _| { diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 23e3de45fa5..ef01b854e5a 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -41,6 +41,7 @@ extern crate rustc_errors; extern crate rustc_expand; extern crate rustc_feature; extern crate rustc_hir; +extern crate rustc_hir_analysis; extern crate rustc_hir_pretty; extern crate rustc_index; extern crate rustc_infer; @@ -59,7 +60,6 @@ extern crate rustc_session; extern crate rustc_span; extern crate rustc_target; extern crate rustc_trait_selection; -extern crate rustc_typeck; extern crate test; // See docs in https://github.com/rust-lang/rust/blob/master/compiler/rustc/src/main.rs diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs index 7a88ec35c8f..47c38c979c3 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs +++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs @@ -1,6 +1,6 @@ // Like trait-where-clause.rs, but we are calling from a const context. // Checking the validity of traits' where clauses happen at a later stage. -// (`rustc_const_eval` instead of `rustc_typeck`) Therefore one file as a +// (`rustc_const_eval` instead of `rustc_hir_analysis`) Therefore one file as a // test is not enough. #![feature(const_trait_impl)] diff --git a/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs b/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs index 98b408daa02..a7a3f98180a 100644 --- a/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs +++ b/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs @@ -1,4 +1,4 @@ -// In rustc_typeck::check::expr::no_such_field_err we recursively +// In rustc_hir_analysis::check::expr::no_such_field_err we recursively // look in subfields for the field. This recursive search is limited // in depth for compile-time reasons and to avoid infinite recursion // in case of cycles. This file tests that the limit in the recursion diff --git a/src/tools/clippy/clippy_lints/src/default_union_representation.rs b/src/tools/clippy/clippy_lints/src/default_union_representation.rs index d559ad423df..3905a6c2e21 100644 --- a/src/tools/clippy/clippy_lints/src/default_union_representation.rs +++ b/src/tools/clippy/clippy_lints/src/default_union_representation.rs @@ -4,7 +4,7 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::layout::LayoutOf; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::sym; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; declare_clippy_lint! { /// ### What it does diff --git a/src/tools/clippy/clippy_lints/src/escape.rs b/src/tools/clippy/clippy_lints/src/escape.rs index a6ddb26e2de..8ccc969646e 100644 --- a/src/tools/clippy/clippy_lints/src/escape.rs +++ b/src/tools/clippy/clippy_lints/src/escape.rs @@ -10,7 +10,7 @@ use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::source_map::Span; use rustc_span::symbol::kw; use rustc_target::spec::abi::Abi; -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; +use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; #[derive(Copy, Clone)] pub struct BoxedLocal { @@ -177,7 +177,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> { } } - fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} + fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} } impl<'a, 'tcx> EscapeDelegate<'a, 'tcx> { diff --git a/src/tools/clippy/clippy_lints/src/implicit_hasher.rs b/src/tools/clippy/clippy_lints/src/implicit_hasher.rs index 804fdc2da08..a920c3bba2a 100644 --- a/src/tools/clippy/clippy_lints/src/implicit_hasher.rs +++ b/src/tools/clippy/clippy_lints/src/implicit_hasher.rs @@ -12,7 +12,7 @@ use rustc_middle::ty::{Ty, TypeckResults}; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::source_map::Span; use rustc_span::symbol::sym; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; use if_chain::if_chain; diff --git a/src/tools/clippy/clippy_lints/src/large_const_arrays.rs b/src/tools/clippy/clippy_lints/src/large_const_arrays.rs index 984c5cd4e37..d6eb53ae29b 100644 --- a/src/tools/clippy/clippy_lints/src/large_const_arrays.rs +++ b/src/tools/clippy/clippy_lints/src/large_const_arrays.rs @@ -7,7 +7,7 @@ use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, ConstKind}; use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::{BytePos, Pos, Span}; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; declare_clippy_lint! { /// ### What it does diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs index 00bf6445c12..c3db194c4ad 100644 --- a/src/tools/clippy/clippy_lints/src/lib.rs +++ b/src/tools/clippy/clippy_lints/src/lib.rs @@ -43,7 +43,7 @@ extern crate rustc_session; extern crate rustc_span; extern crate rustc_target; extern crate rustc_trait_selection; -extern crate rustc_typeck; +extern crate rustc_hir_analysis; #[macro_use] extern crate clippy_utils; diff --git a/src/tools/clippy/clippy_lints/src/loops/mut_range_bound.rs b/src/tools/clippy/clippy_lints/src/loops/mut_range_bound.rs index be7f96e9bb0..6d585c2e45d 100644 --- a/src/tools/clippy/clippy_lints/src/loops/mut_range_bound.rs +++ b/src/tools/clippy/clippy_lints/src/loops/mut_range_bound.rs @@ -8,7 +8,7 @@ use rustc_infer::infer::TyCtxtInferExt; use rustc_lint::LateContext; use rustc_middle::{mir::FakeReadCause, ty}; use rustc_span::source_map::Span; -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; +use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; pub(super) fn check(cx: &LateContext<'_>, arg: &Expr<'_>, body: &Expr<'_>) { if_chain! { @@ -114,7 +114,7 @@ impl<'tcx> Delegate<'tcx> for MutatePairDelegate<'_, 'tcx> { } } - fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} + fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} } impl MutatePairDelegate<'_, '_> { diff --git a/src/tools/clippy/clippy_lints/src/loops/utils.rs b/src/tools/clippy/clippy_lints/src/loops/utils.rs index 4801a84eb92..f1f58db80b3 100644 --- a/src/tools/clippy/clippy_lints/src/loops/utils.rs +++ b/src/tools/clippy/clippy_lints/src/loops/utils.rs @@ -10,7 +10,7 @@ use rustc_middle::hir::nested_filter; use rustc_middle::ty::{self, Ty}; use rustc_span::source_map::Spanned; use rustc_span::symbol::{sym, Symbol}; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; use std::iter::Iterator; #[derive(Debug, PartialEq, Eq)] diff --git a/src/tools/clippy/clippy_lints/src/matches/needless_match.rs b/src/tools/clippy/clippy_lints/src/matches/needless_match.rs index 634eef82e53..58ea43e69d9 100644 --- a/src/tools/clippy/clippy_lints/src/matches/needless_match.rs +++ b/src/tools/clippy/clippy_lints/src/matches/needless_match.rs @@ -11,7 +11,7 @@ use rustc_hir::LangItem::OptionNone; use rustc_hir::{Arm, BindingAnnotation, ByRef, Expr, ExprKind, FnRetTy, Guard, Node, Pat, PatKind, Path, QPath}; use rustc_lint::LateContext; use rustc_span::sym; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; pub(crate) fn check_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], expr: &Expr<'_>) { if arms.len() > 1 && expr_ty_matches_p_ty(cx, ex, expr) && check_all_arms(cx, ex, arms) { diff --git a/src/tools/clippy/clippy_lints/src/methods/mod.rs b/src/tools/clippy/clippy_lints/src/methods/mod.rs index ddb6d1ca26c..428a354ec6b 100644 --- a/src/tools/clippy/clippy_lints/src/methods/mod.rs +++ b/src/tools/clippy/clippy_lints/src/methods/mod.rs @@ -115,7 +115,7 @@ use rustc_middle::ty::{self, TraitRef, Ty}; use rustc_semver::RustcVersion; use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::{sym, Span}; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; declare_clippy_lint! { /// ### What it does diff --git a/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs b/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs index 79d784c342c..559f32a563e 100644 --- a/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs +++ b/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs @@ -18,7 +18,7 @@ use rustc_middle::ty::{self, ParamTy, PredicateKind, ProjectionPredicate, TraitP use rustc_semver::RustcVersion; use rustc_span::{sym, Symbol}; use rustc_trait_selection::traits::{query::evaluate_obligation::InferCtxtExt as _, Obligation, ObligationCause}; -use rustc_typeck::check::{FnCtxt, Inherited}; +use rustc_hir_analysis::check::{FnCtxt, Inherited}; use std::cmp::max; use super::UNNECESSARY_TO_OWNED; diff --git a/src/tools/clippy/clippy_lints/src/missing_const_for_fn.rs b/src/tools/clippy/clippy_lints/src/missing_const_for_fn.rs index f24b41411c8..00376f0d790 100644 --- a/src/tools/clippy/clippy_lints/src/missing_const_for_fn.rs +++ b/src/tools/clippy/clippy_lints/src/missing_const_for_fn.rs @@ -13,7 +13,7 @@ use rustc_middle::lint::in_external_macro; use rustc_semver::RustcVersion; use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::Span; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; declare_clippy_lint! { /// ### What it does diff --git a/src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs b/src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs index 060037ed496..4f46872439c 100644 --- a/src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs +++ b/src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs @@ -22,7 +22,7 @@ use rustc_span::{sym, Span}; use rustc_target::spec::abi::Abi; use rustc_trait_selection::traits; use rustc_trait_selection::traits::misc::can_type_implement_copy; -use rustc_typeck::expr_use_visitor as euv; +use rustc_hir_analysis::expr_use_visitor as euv; use std::borrow::Cow; declare_clippy_lint! { @@ -341,5 +341,5 @@ impl<'tcx> euv::Delegate<'tcx> for MovedVariablesCtxt { fn mutate(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: HirId) {} - fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} + fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} } diff --git a/src/tools/clippy/clippy_lints/src/non_copy_const.rs b/src/tools/clippy/clippy_lints/src/non_copy_const.rs index 616ef9e2f86..48ff737dae7 100644 --- a/src/tools/clippy/clippy_lints/src/non_copy_const.rs +++ b/src/tools/clippy/clippy_lints/src/non_copy_const.rs @@ -20,7 +20,7 @@ use rustc_middle::ty::adjustment::Adjust; use rustc_middle::ty::{self, Ty}; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::{sym, InnerSpan, Span, DUMMY_SP}; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; // FIXME: this is a correctness problem but there's no suitable // warn-by-default category. diff --git a/src/tools/clippy/clippy_lints/src/operators/assign_op_pattern.rs b/src/tools/clippy/clippy_lints/src/operators/assign_op_pattern.rs index 2c22c8b3d08..f134c6c4cdb 100644 --- a/src/tools/clippy/clippy_lints/src/operators/assign_op_pattern.rs +++ b/src/tools/clippy/clippy_lints/src/operators/assign_op_pattern.rs @@ -11,7 +11,7 @@ use rustc_lint::LateContext; use rustc_middle::mir::FakeReadCause; use rustc_middle::ty::BorrowKind; use rustc_trait_selection::infer::TyCtxtInferExt; -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; +use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; use super::ASSIGN_OP_PATTERN; diff --git a/src/tools/clippy/clippy_lints/src/transmute/utils.rs b/src/tools/clippy/clippy_lints/src/transmute/utils.rs index 8e90d20265c..fdf847bf445 100644 --- a/src/tools/clippy/clippy_lints/src/transmute/utils.rs +++ b/src/tools/clippy/clippy_lints/src/transmute/utils.rs @@ -2,7 +2,7 @@ use rustc_hir::Expr; use rustc_lint::LateContext; use rustc_middle::ty::{cast::CastKind, Ty}; use rustc_span::DUMMY_SP; -use rustc_typeck::check::{cast::{self, CastCheckResult}, FnCtxt, Inherited}; +use rustc_hir_analysis::check::{cast::{self, CastCheckResult}, FnCtxt, Inherited}; // check if the component types of the transmuted collection and the result have different ABI, // size or alignment diff --git a/src/tools/clippy/clippy_lints/src/types/redundant_allocation.rs b/src/tools/clippy/clippy_lints/src/types/redundant_allocation.rs index a1312fcda0b..d81c5c83845 100644 --- a/src/tools/clippy/clippy_lints/src/types/redundant_allocation.rs +++ b/src/tools/clippy/clippy_lints/src/types/redundant_allocation.rs @@ -5,7 +5,7 @@ use rustc_errors::Applicability; use rustc_hir::{self as hir, def_id::DefId, QPath, TyKind}; use rustc_lint::LateContext; use rustc_span::symbol::sym; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; use super::{utils, REDUNDANT_ALLOCATION}; diff --git a/src/tools/clippy/clippy_lints/src/types/vec_box.rs b/src/tools/clippy/clippy_lints/src/types/vec_box.rs index b2f536ca781..236f9955722 100644 --- a/src/tools/clippy/clippy_lints/src/types/vec_box.rs +++ b/src/tools/clippy/clippy_lints/src/types/vec_box.rs @@ -8,7 +8,7 @@ use rustc_lint::LateContext; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::TypeVisitable; use rustc_span::symbol::sym; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; use super::VEC_BOX; diff --git a/src/tools/clippy/clippy_lints/src/use_self.rs b/src/tools/clippy/clippy_lints/src/use_self.rs index ce51cb693fc..6a767967ef4 100644 --- a/src/tools/clippy/clippy_lints/src/use_self.rs +++ b/src/tools/clippy/clippy_lints/src/use_self.rs @@ -16,7 +16,7 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_semver::RustcVersion; use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::Span; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; declare_clippy_lint! { /// ### What it does diff --git a/src/tools/clippy/clippy_lints/src/utils/internal_lints.rs b/src/tools/clippy/clippy_lints/src/utils/internal_lints.rs index 17d9a041857..78c036186f5 100644 --- a/src/tools/clippy/clippy_lints/src/utils/internal_lints.rs +++ b/src/tools/clippy/clippy_lints/src/utils/internal_lints.rs @@ -32,7 +32,7 @@ use rustc_session::{declare_lint_pass, declare_tool_lint, impl_lint_pass}; use rustc_span::source_map::Spanned; use rustc_span::symbol::Symbol; use rustc_span::{sym, BytePos, Span}; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; use std::borrow::{Borrow, Cow}; diff --git a/src/tools/clippy/clippy_lints/src/zero_sized_map_values.rs b/src/tools/clippy/clippy_lints/src/zero_sized_map_values.rs index 386f3c527f1..703ba2ef4b0 100644 --- a/src/tools/clippy/clippy_lints/src/zero_sized_map_values.rs +++ b/src/tools/clippy/clippy_lints/src/zero_sized_map_values.rs @@ -7,7 +7,7 @@ use rustc_middle::ty::layout::LayoutOf as _; use rustc_middle::ty::{Adt, Ty, TypeVisitable}; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::sym; -use rustc_typeck::hir_ty_to_ty; +use rustc_hir_analysis::hir_ty_to_ty; declare_clippy_lint! { /// ### What it does diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs index b1abd3b04c9..627d6b51944 100644 --- a/src/tools/clippy/clippy_utils/src/lib.rs +++ b/src/tools/clippy/clippy_utils/src/lib.rs @@ -32,7 +32,7 @@ extern crate rustc_session; extern crate rustc_span; extern crate rustc_target; extern crate rustc_trait_selection; -extern crate rustc_typeck; +extern crate rustc_hir_analysis; #[macro_use] pub mod sym_helper; @@ -1386,7 +1386,7 @@ pub fn is_integer_literal(expr: &Expr<'_>, value: u128) -> bool { /// Examples of coercions can be found in the Nomicon at /// . /// -/// See `rustc_middle::ty::adjustment::Adjustment` and `rustc_typeck::check::coercion` for more +/// See `rustc_middle::ty::adjustment::Adjustment` and `rustc_hir_analysis::check::coercion` for more /// information on adjustments and coercions. pub fn is_adjusted(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { cx.typeck_results().adjustments().get(e.hir_id).is_some() diff --git a/src/tools/clippy/clippy_utils/src/sugg.rs b/src/tools/clippy/clippy_utils/src/sugg.rs index f08275a4ac7..e53c40e9576 100644 --- a/src/tools/clippy/clippy_utils/src/sugg.rs +++ b/src/tools/clippy/clippy_utils/src/sugg.rs @@ -16,7 +16,7 @@ use rustc_middle::hir::place::ProjectionKind; use rustc_middle::mir::{FakeReadCause, Mutability}; use rustc_middle::ty; use rustc_span::source_map::{BytePos, CharPos, Pos, Span, SyntaxContext}; -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; +use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; use std::borrow::Cow; use std::fmt::{Display, Write as _}; use std::ops::{Add, Neg, Not, Sub}; @@ -1056,7 +1056,7 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> { fn mutate(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {} - fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} + fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} } #[cfg(test)] diff --git a/src/tools/clippy/clippy_utils/src/usage.rs b/src/tools/clippy/clippy_utils/src/usage.rs index a7c08839f52..76bfec75726 100644 --- a/src/tools/clippy/clippy_utils/src/usage.rs +++ b/src/tools/clippy/clippy_utils/src/usage.rs @@ -9,7 +9,7 @@ use rustc_lint::LateContext; use rustc_middle::hir::nested_filter; use rustc_middle::mir::FakeReadCause; use rustc_middle::ty; -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; +use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; /// Returns a set of mutated local variable IDs, or `None` if mutations could not be determined. pub fn mutated_variables<'tcx>(expr: &'tcx Expr<'_>, cx: &LateContext<'tcx>) -> Option { @@ -73,7 +73,7 @@ impl<'tcx> Delegate<'tcx> for MutVarsDelegate { self.update(cmt); } - fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} + fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} } pub struct ParamBindingIdCollector { diff --git a/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.fixed b/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.fixed index 539239fc18f..7263abac15d 100644 --- a/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.fixed +++ b/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.fixed @@ -8,7 +8,7 @@ use std::mem::{size_of, transmute}; -// rustc_typeck::check::cast contains documentation about when a cast `e as U` is +// rustc_hir_analysis::check::cast contains documentation about when a cast `e as U` is // valid, which we quote from below. fn main() { // We should see an error message for each transmute, and no error messages for diff --git a/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.rs b/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.rs index b9e446dc89a..d8e4421d4c1 100644 --- a/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.rs +++ b/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.rs @@ -8,7 +8,7 @@ use std::mem::{size_of, transmute}; -// rustc_typeck::check::cast contains documentation about when a cast `e as U` is +// rustc_hir_analysis::check::cast contains documentation about when a cast `e as U` is // valid, which we quote from below. fn main() { // We should see an error message for each transmute, and no error messages for diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs b/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs index 344036dd813..e106c4c2cfd 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs @@ -1,7 +1,7 @@ //! In certain situations, rust automatically inserts derefs as necessary: for //! example, field accesses `foo.bar` still work when `foo` is actually a //! reference to a type with the field `bar`. This is an approximation of the -//! logic in rustc (which lives in librustc_typeck/check/autoderef.rs). +//! logic in rustc (which lives in rustc_hir_analysis/check/autoderef.rs). use std::sync::Arc; diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs b/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs index e37763e8ea7..9dbeba4f9f4 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs @@ -2,7 +2,7 @@ //! the type of each expression and pattern. //! //! For type inference, compare the implementations in rustc (the various -//! check_* methods in librustc_typeck/check/mod.rs are a good entry point) and +//! check_* methods in rustc_hir_analysis/check/mod.rs are a good entry point) and //! IntelliJ-Rust (org.rust.lang.core.types.infer). Our entry point for //! inference here is the `infer` function, which infers the types of all //! expressions in a given function. diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs b/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs index f54440bf5b3..8df25c83c6e 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs @@ -3,7 +3,7 @@ //! like going from `&Vec` to `&[T]`. //! //! See and -//! `librustc_typeck/check/coercion.rs`. +//! `rustc_hir_analysis/check/coercion.rs`. use std::{iter, sync::Arc}; diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs b/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs index 41fcef73d9b..cc21990d553 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs @@ -1,7 +1,7 @@ //! This module is concerned with finding methods that a given type provides. //! For details about how this works in rustc, see the method lookup page in the //! [rustc guide](https://rust-lang.github.io/rustc-guide/method-lookup.html) -//! and the corresponding code mostly in librustc_typeck/check/method/probe.rs. +//! and the corresponding code mostly in rustc_hir_analysis/check/method/probe.rs. use std::{iter, ops::ControlFlow, sync::Arc}; use arrayvec::ArrayVec;