From c1e3d556bffa1a3a5a80fe1c5687cd2f062ce30d Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Tue, 11 Feb 2020 19:53:40 +0100 Subject: [PATCH] Move rustc_infer::traits to new crate rustc_trait_selection. --- Cargo.lock | 29 +++++++++++++++++++ src/librustc_interface/Cargo.toml | 1 + src/librustc_lint/Cargo.toml | 1 + src/librustc_mir/Cargo.toml | 1 + src/librustc_mir_build/Cargo.toml | 1 + src/librustc_passes/Cargo.toml | 1 + src/librustc_trait_selection/Cargo.toml | 27 +++++++++++++++++ .../opaque_types.rs} | 0 .../traits/auto_trait.rs | 0 .../traits/codegen/mod.rs | 0 .../traits/coherence.rs | 0 .../traits/engine.rs | 0 .../traits/error_reporting/mod.rs | 0 .../error_reporting/on_unimplemented.rs | 0 .../traits/error_reporting/suggestions.rs | 0 .../traits/fulfill.rs | 0 .../traits/misc.rs | 0 .../traits/mod.rs | 0 .../traits/object_safety.rs | 0 .../traits/on_unimplemented.rs | 0 .../traits/project.rs | 0 .../traits/projection_cache.rs | 0 .../traits/query/dropck_outlives.rs | 0 .../traits/query/evaluate_obligation.rs | 0 .../traits/query/method_autoderef.rs | 0 .../traits/query/mod.rs | 0 .../traits/query/normalize.rs | 0 .../traits/query/outlives_bounds.rs | 0 .../traits/query/type_op/ascribe_user_type.rs | 0 .../traits/query/type_op/custom.rs | 0 .../traits/query/type_op/eq.rs | 0 .../query/type_op/implied_outlives_bounds.rs | 0 .../traits/query/type_op/mod.rs | 0 .../traits/query/type_op/normalize.rs | 0 .../traits/query/type_op/outlives.rs | 0 .../traits/query/type_op/prove_predicate.rs | 0 .../traits/query/type_op/subtype.rs | 0 .../traits/select.rs | 0 .../traits/specialize/mod.rs | 0 .../traits/specialize/specialization_graph.rs | 0 .../traits/structural_impls.rs | 0 .../traits/structural_match.rs | 0 .../traits/util.rs | 0 .../traits/wf.rs | 0 src/librustc_traits/Cargo.toml | 1 + src/librustc_ty/Cargo.toml | 1 + src/librustc_typeck/Cargo.toml | 1 + 47 files changed, 64 insertions(+) create mode 100644 src/librustc_trait_selection/Cargo.toml rename src/{librustc_infer/infer/opaque_types/mod.rs => librustc_trait_selection/opaque_types.rs} (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/auto_trait.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/codegen/mod.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/coherence.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/engine.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/error_reporting/mod.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/error_reporting/on_unimplemented.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/error_reporting/suggestions.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/fulfill.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/misc.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/mod.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/object_safety.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/on_unimplemented.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/project.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/projection_cache.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/dropck_outlives.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/evaluate_obligation.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/method_autoderef.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/mod.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/normalize.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/outlives_bounds.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/ascribe_user_type.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/custom.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/eq.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/implied_outlives_bounds.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/mod.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/normalize.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/outlives.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/prove_predicate.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/query/type_op/subtype.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/select.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/specialize/mod.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/specialize/specialization_graph.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/structural_impls.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/structural_match.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/util.rs (100%) rename src/{librustc_infer => librustc_trait_selection}/traits/wf.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index aefd40bfaa5..ffb85dfc4da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3826,6 +3826,7 @@ dependencies = [ "rustc_session", "rustc_span", "rustc_target", + "rustc_trait_selection", "rustc_traits", "rustc_ty", "rustc_typeck", @@ -3860,6 +3861,7 @@ dependencies = [ "rustc_session", "rustc_span", "rustc_target", + "rustc_trait_selection", "unicode-security", ] @@ -3929,6 +3931,7 @@ dependencies = [ "rustc_macros", "rustc_span", "rustc_target", + "rustc_trait_selection", "serialize", "smallvec 1.0.0", ] @@ -3952,6 +3955,7 @@ dependencies = [ "rustc_session", "rustc_span", "rustc_target", + "rustc_trait_selection", "serialize", "smallvec 1.0.0", ] @@ -3992,6 +3996,7 @@ dependencies = [ "rustc_session", "rustc_span", "rustc_target", + "rustc_trait_selection", ] [[package]] @@ -4119,6 +4124,27 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b725dadae9fabc488df69a287f5a99c5eaf5d10853842a8a3dfac52476f544ee" +[[package]] +name = "rustc_trait_selection" +version = "0.0.0" +dependencies = [ + "fmt_macros", + "log", + "rustc", + "rustc_ast", + "rustc_attr", + "rustc_data_structures", + "rustc_errors", + "rustc_hir", + "rustc_index", + "rustc_infer", + "rustc_macros", + "rustc_session", + "rustc_span", + "rustc_target", + "smallvec 1.0.0", +] + [[package]] name = "rustc_traits" version = "0.0.0" @@ -4132,6 +4158,7 @@ dependencies = [ "rustc_macros", "rustc_span", "rustc_target", + "rustc_trait_selection", "smallvec 1.0.0", ] @@ -4146,6 +4173,7 @@ dependencies = [ "rustc_infer", "rustc_span", "rustc_target", + "rustc_trait_selection", ] [[package]] @@ -4164,6 +4192,7 @@ dependencies = [ "rustc_infer", "rustc_span", "rustc_target", + "rustc_trait_selection", "smallvec 1.0.0", ] diff --git a/src/librustc_interface/Cargo.toml b/src/librustc_interface/Cargo.toml index b29480a8810..e84181f1d75 100644 --- a/src/librustc_interface/Cargo.toml +++ b/src/librustc_interface/Cargo.toml @@ -42,6 +42,7 @@ rustc_errors = { path = "../librustc_errors" } rustc_plugin_impl = { path = "../librustc_plugin_impl" } rustc_privacy = { path = "../librustc_privacy" } rustc_resolve = { path = "../librustc_resolve" } +rustc_trait_selection = { path = "../librustc_trait_selection" } rustc_ty = { path = "../librustc_ty" } tempfile = "3.0.5" once_cell = "1" diff --git a/src/librustc_lint/Cargo.toml b/src/librustc_lint/Cargo.toml index 6470d25fe0a..9785af5eab2 100644 --- a/src/librustc_lint/Cargo.toml +++ b/src/librustc_lint/Cargo.toml @@ -24,3 +24,4 @@ rustc_feature = { path = "../librustc_feature" } rustc_index = { path = "../librustc_index" } rustc_session = { path = "../librustc_session" } rustc_infer = { path = "../librustc_infer" } +rustc_trait_selection = { path = "../librustc_trait_selection" } diff --git a/src/librustc_mir/Cargo.toml b/src/librustc_mir/Cargo.toml index 1ee581e64aa..cad50d50f3c 100644 --- a/src/librustc_mir/Cargo.toml +++ b/src/librustc_mir/Cargo.toml @@ -28,6 +28,7 @@ rustc_lexer = { path = "../librustc_lexer" } rustc_macros = { path = "../librustc_macros" } rustc_serialize = { path = "../libserialize", package = "serialize" } rustc_target = { path = "../librustc_target" } +rustc_trait_selection = { path = "../librustc_trait_selection" } rustc_ast = { path = "../librustc_ast" } rustc_span = { path = "../librustc_span" } rustc_apfloat = { path = "../librustc_apfloat" } diff --git a/src/librustc_mir_build/Cargo.toml b/src/librustc_mir_build/Cargo.toml index d53188a39e5..96716dbd604 100644 --- a/src/librustc_mir_build/Cargo.toml +++ b/src/librustc_mir_build/Cargo.toml @@ -25,5 +25,6 @@ rustc_serialize = { path = "../libserialize", package = "serialize" } rustc_session = { path = "../librustc_session" } rustc_span = { path = "../librustc_span" } rustc_target = { path = "../librustc_target" } +rustc_trait_selection = { path = "../librustc_trait_selection" } rustc_ast = { path = "../librustc_ast" } smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc_passes/Cargo.toml b/src/librustc_passes/Cargo.toml index af8e7a5b71e..8acb88f58d3 100644 --- a/src/librustc_passes/Cargo.toml +++ b/src/librustc_passes/Cargo.toml @@ -22,3 +22,4 @@ rustc_session = { path = "../librustc_session" } rustc_target = { path = "../librustc_target" } rustc_ast = { path = "../librustc_ast" } rustc_span = { path = "../librustc_span" } +rustc_trait_selection = { path = "../librustc_trait_selection" } diff --git a/src/librustc_trait_selection/Cargo.toml b/src/librustc_trait_selection/Cargo.toml new file mode 100644 index 00000000000..5b2da41d066 --- /dev/null +++ b/src/librustc_trait_selection/Cargo.toml @@ -0,0 +1,27 @@ +[package] +authors = ["The Rust Project Developers"] +name = "rustc_trait_selection" +version = "0.0.0" +edition = "2018" + +[lib] +name = "rustc_trait_selection" +path = "lib.rs" +doctest = false + +[dependencies] +fmt_macros = { path = "../libfmt_macros" } +log = { version = "0.4", features = ["release_max_level_info", "std"] } +rustc_attr = { path = "../librustc_attr" } +rustc = { path = "../librustc" } +rustc_ast = { path = "../librustc_ast" } +rustc_data_structures = { path = "../librustc_data_structures" } +rustc_errors = { path = "../librustc_errors" } +rustc_hir = { path = "../librustc_hir" } +rustc_index = { path = "../librustc_index" } +rustc_infer = { path = "../librustc_infer" } +rustc_macros = { path = "../librustc_macros" } +rustc_session = { path = "../librustc_session" } +rustc_span = { path = "../librustc_span" } +rustc_target = { path = "../librustc_target" } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc_infer/infer/opaque_types/mod.rs b/src/librustc_trait_selection/opaque_types.rs similarity index 100% rename from src/librustc_infer/infer/opaque_types/mod.rs rename to src/librustc_trait_selection/opaque_types.rs diff --git a/src/librustc_infer/traits/auto_trait.rs b/src/librustc_trait_selection/traits/auto_trait.rs similarity index 100% rename from src/librustc_infer/traits/auto_trait.rs rename to src/librustc_trait_selection/traits/auto_trait.rs diff --git a/src/librustc_infer/traits/codegen/mod.rs b/src/librustc_trait_selection/traits/codegen/mod.rs similarity index 100% rename from src/librustc_infer/traits/codegen/mod.rs rename to src/librustc_trait_selection/traits/codegen/mod.rs diff --git a/src/librustc_infer/traits/coherence.rs b/src/librustc_trait_selection/traits/coherence.rs similarity index 100% rename from src/librustc_infer/traits/coherence.rs rename to src/librustc_trait_selection/traits/coherence.rs diff --git a/src/librustc_infer/traits/engine.rs b/src/librustc_trait_selection/traits/engine.rs similarity index 100% rename from src/librustc_infer/traits/engine.rs rename to src/librustc_trait_selection/traits/engine.rs diff --git a/src/librustc_infer/traits/error_reporting/mod.rs b/src/librustc_trait_selection/traits/error_reporting/mod.rs similarity index 100% rename from src/librustc_infer/traits/error_reporting/mod.rs rename to src/librustc_trait_selection/traits/error_reporting/mod.rs diff --git a/src/librustc_infer/traits/error_reporting/on_unimplemented.rs b/src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs similarity index 100% rename from src/librustc_infer/traits/error_reporting/on_unimplemented.rs rename to src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs diff --git a/src/librustc_infer/traits/error_reporting/suggestions.rs b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs similarity index 100% rename from src/librustc_infer/traits/error_reporting/suggestions.rs rename to src/librustc_trait_selection/traits/error_reporting/suggestions.rs diff --git a/src/librustc_infer/traits/fulfill.rs b/src/librustc_trait_selection/traits/fulfill.rs similarity index 100% rename from src/librustc_infer/traits/fulfill.rs rename to src/librustc_trait_selection/traits/fulfill.rs diff --git a/src/librustc_infer/traits/misc.rs b/src/librustc_trait_selection/traits/misc.rs similarity index 100% rename from src/librustc_infer/traits/misc.rs rename to src/librustc_trait_selection/traits/misc.rs diff --git a/src/librustc_infer/traits/mod.rs b/src/librustc_trait_selection/traits/mod.rs similarity index 100% rename from src/librustc_infer/traits/mod.rs rename to src/librustc_trait_selection/traits/mod.rs diff --git a/src/librustc_infer/traits/object_safety.rs b/src/librustc_trait_selection/traits/object_safety.rs similarity index 100% rename from src/librustc_infer/traits/object_safety.rs rename to src/librustc_trait_selection/traits/object_safety.rs diff --git a/src/librustc_infer/traits/on_unimplemented.rs b/src/librustc_trait_selection/traits/on_unimplemented.rs similarity index 100% rename from src/librustc_infer/traits/on_unimplemented.rs rename to src/librustc_trait_selection/traits/on_unimplemented.rs diff --git a/src/librustc_infer/traits/project.rs b/src/librustc_trait_selection/traits/project.rs similarity index 100% rename from src/librustc_infer/traits/project.rs rename to src/librustc_trait_selection/traits/project.rs diff --git a/src/librustc_infer/traits/projection_cache.rs b/src/librustc_trait_selection/traits/projection_cache.rs similarity index 100% rename from src/librustc_infer/traits/projection_cache.rs rename to src/librustc_trait_selection/traits/projection_cache.rs diff --git a/src/librustc_infer/traits/query/dropck_outlives.rs b/src/librustc_trait_selection/traits/query/dropck_outlives.rs similarity index 100% rename from src/librustc_infer/traits/query/dropck_outlives.rs rename to src/librustc_trait_selection/traits/query/dropck_outlives.rs diff --git a/src/librustc_infer/traits/query/evaluate_obligation.rs b/src/librustc_trait_selection/traits/query/evaluate_obligation.rs similarity index 100% rename from src/librustc_infer/traits/query/evaluate_obligation.rs rename to src/librustc_trait_selection/traits/query/evaluate_obligation.rs diff --git a/src/librustc_infer/traits/query/method_autoderef.rs b/src/librustc_trait_selection/traits/query/method_autoderef.rs similarity index 100% rename from src/librustc_infer/traits/query/method_autoderef.rs rename to src/librustc_trait_selection/traits/query/method_autoderef.rs diff --git a/src/librustc_infer/traits/query/mod.rs b/src/librustc_trait_selection/traits/query/mod.rs similarity index 100% rename from src/librustc_infer/traits/query/mod.rs rename to src/librustc_trait_selection/traits/query/mod.rs diff --git a/src/librustc_infer/traits/query/normalize.rs b/src/librustc_trait_selection/traits/query/normalize.rs similarity index 100% rename from src/librustc_infer/traits/query/normalize.rs rename to src/librustc_trait_selection/traits/query/normalize.rs diff --git a/src/librustc_infer/traits/query/outlives_bounds.rs b/src/librustc_trait_selection/traits/query/outlives_bounds.rs similarity index 100% rename from src/librustc_infer/traits/query/outlives_bounds.rs rename to src/librustc_trait_selection/traits/query/outlives_bounds.rs diff --git a/src/librustc_infer/traits/query/type_op/ascribe_user_type.rs b/src/librustc_trait_selection/traits/query/type_op/ascribe_user_type.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/ascribe_user_type.rs rename to src/librustc_trait_selection/traits/query/type_op/ascribe_user_type.rs diff --git a/src/librustc_infer/traits/query/type_op/custom.rs b/src/librustc_trait_selection/traits/query/type_op/custom.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/custom.rs rename to src/librustc_trait_selection/traits/query/type_op/custom.rs diff --git a/src/librustc_infer/traits/query/type_op/eq.rs b/src/librustc_trait_selection/traits/query/type_op/eq.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/eq.rs rename to src/librustc_trait_selection/traits/query/type_op/eq.rs diff --git a/src/librustc_infer/traits/query/type_op/implied_outlives_bounds.rs b/src/librustc_trait_selection/traits/query/type_op/implied_outlives_bounds.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/implied_outlives_bounds.rs rename to src/librustc_trait_selection/traits/query/type_op/implied_outlives_bounds.rs diff --git a/src/librustc_infer/traits/query/type_op/mod.rs b/src/librustc_trait_selection/traits/query/type_op/mod.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/mod.rs rename to src/librustc_trait_selection/traits/query/type_op/mod.rs diff --git a/src/librustc_infer/traits/query/type_op/normalize.rs b/src/librustc_trait_selection/traits/query/type_op/normalize.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/normalize.rs rename to src/librustc_trait_selection/traits/query/type_op/normalize.rs diff --git a/src/librustc_infer/traits/query/type_op/outlives.rs b/src/librustc_trait_selection/traits/query/type_op/outlives.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/outlives.rs rename to src/librustc_trait_selection/traits/query/type_op/outlives.rs diff --git a/src/librustc_infer/traits/query/type_op/prove_predicate.rs b/src/librustc_trait_selection/traits/query/type_op/prove_predicate.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/prove_predicate.rs rename to src/librustc_trait_selection/traits/query/type_op/prove_predicate.rs diff --git a/src/librustc_infer/traits/query/type_op/subtype.rs b/src/librustc_trait_selection/traits/query/type_op/subtype.rs similarity index 100% rename from src/librustc_infer/traits/query/type_op/subtype.rs rename to src/librustc_trait_selection/traits/query/type_op/subtype.rs diff --git a/src/librustc_infer/traits/select.rs b/src/librustc_trait_selection/traits/select.rs similarity index 100% rename from src/librustc_infer/traits/select.rs rename to src/librustc_trait_selection/traits/select.rs diff --git a/src/librustc_infer/traits/specialize/mod.rs b/src/librustc_trait_selection/traits/specialize/mod.rs similarity index 100% rename from src/librustc_infer/traits/specialize/mod.rs rename to src/librustc_trait_selection/traits/specialize/mod.rs diff --git a/src/librustc_infer/traits/specialize/specialization_graph.rs b/src/librustc_trait_selection/traits/specialize/specialization_graph.rs similarity index 100% rename from src/librustc_infer/traits/specialize/specialization_graph.rs rename to src/librustc_trait_selection/traits/specialize/specialization_graph.rs diff --git a/src/librustc_infer/traits/structural_impls.rs b/src/librustc_trait_selection/traits/structural_impls.rs similarity index 100% rename from src/librustc_infer/traits/structural_impls.rs rename to src/librustc_trait_selection/traits/structural_impls.rs diff --git a/src/librustc_infer/traits/structural_match.rs b/src/librustc_trait_selection/traits/structural_match.rs similarity index 100% rename from src/librustc_infer/traits/structural_match.rs rename to src/librustc_trait_selection/traits/structural_match.rs diff --git a/src/librustc_infer/traits/util.rs b/src/librustc_trait_selection/traits/util.rs similarity index 100% rename from src/librustc_infer/traits/util.rs rename to src/librustc_trait_selection/traits/util.rs diff --git a/src/librustc_infer/traits/wf.rs b/src/librustc_trait_selection/traits/wf.rs similarity index 100% rename from src/librustc_infer/traits/wf.rs rename to src/librustc_trait_selection/traits/wf.rs diff --git a/src/librustc_traits/Cargo.toml b/src/librustc_traits/Cargo.toml index 0dc3ad29833..5e33efb1cf9 100644 --- a/src/librustc_traits/Cargo.toml +++ b/src/librustc_traits/Cargo.toml @@ -19,3 +19,4 @@ rustc_ast = { path = "../librustc_ast" } rustc_span = { path = "../librustc_span" } smallvec = { version = "1.0", features = ["union", "may_dangle"] } rustc_infer = { path = "../librustc_infer" } +rustc_trait_selection = { path = "../librustc_trait_selection" } diff --git a/src/librustc_ty/Cargo.toml b/src/librustc_ty/Cargo.toml index 6e64df3492b..3c790bc4cb1 100644 --- a/src/librustc_ty/Cargo.toml +++ b/src/librustc_ty/Cargo.toml @@ -16,3 +16,4 @@ rustc_hir = { path = "../librustc_hir" } rustc_infer = { path = "../librustc_infer" } rustc_span = { path = "../librustc_span" } rustc_target = { path = "../librustc_target" } +rustc_trait_selection = { path = "../librustc_trait_selection" } diff --git a/src/librustc_typeck/Cargo.toml b/src/librustc_typeck/Cargo.toml index 51a9b259c8f..83a48ee3995 100644 --- a/src/librustc_typeck/Cargo.toml +++ b/src/librustc_typeck/Cargo.toml @@ -24,3 +24,4 @@ rustc_ast = { path = "../librustc_ast" } rustc_span = { path = "../librustc_span" } rustc_index = { path = "../librustc_index" } rustc_infer = { path = "../librustc_infer" } +rustc_trait_selection = { path = "../librustc_trait_selection" }