diff --git a/Cargo.lock b/Cargo.lock index 54ad60e7150..14e41ca2096 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3642,6 +3642,7 @@ dependencies = [ "rustc_span", "rustc_target", "rustc_traits", + "rustc_ty", "rustc_typeck", "serialize", "smallvec 1.0.0", @@ -3918,6 +3919,17 @@ dependencies = [ "syntax", ] +[[package]] +name = "rustc_ty" +version = "0.0.0" +dependencies = [ + "log", + "rustc", + "rustc_data_structures", + "rustc_hir", + "rustc_span", +] + [[package]] name = "rustc_typeck" version = "0.0.0" diff --git a/src/librustc_interface/Cargo.toml b/src/librustc_interface/Cargo.toml index eb0551c6065..c7d387caa2d 100644 --- a/src/librustc_interface/Cargo.toml +++ b/src/librustc_interface/Cargo.toml @@ -39,6 +39,7 @@ rustc_errors = { path = "../librustc_errors" } rustc_plugin_impl = { path = "../librustc_plugin_impl" } rustc_privacy = { path = "../librustc_privacy" } rustc_resolve = { path = "../librustc_resolve" } +rustc_ty = { path = "../librustc_ty" } tempfile = "3.0.5" once_cell = "1" diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs index 8bd06465628..c45f83f2130 100644 --- a/src/librustc_passes/lib.rs +++ b/src/librustc_passes/lib.rs @@ -31,7 +31,6 @@ pub mod loops; mod reachable; mod region; pub mod stability; -mod ty; pub fn provide(providers: &mut Providers<'_>) { check_const::provide(providers); @@ -44,5 +43,4 @@ pub fn provide(providers: &mut Providers<'_>) { reachable::provide(providers); region::provide(providers); stability::provide(providers); - ty::provide(providers); } diff --git a/src/librustc_ty/Cargo.toml b/src/librustc_ty/Cargo.toml new file mode 100644 index 00000000000..fb0d93fe5eb --- /dev/null +++ b/src/librustc_ty/Cargo.toml @@ -0,0 +1,16 @@ +[package] +authors = ["The Rust Project Developers"] +name = "rustc_ty" +version = "0.0.0" +edition = "2018" + +[lib] +name = "rustc_ty" +path = "lib.rs" + +[dependencies] +log = "0.4" +rustc = { path = "../librustc" } +rustc_data_structures = { path = "../librustc_data_structures" } +rustc_hir = { path = "../librustc_hir" } +rustc_span = { path = "../librustc_span" } diff --git a/src/librustc_ty/lib.rs b/src/librustc_ty/lib.rs new file mode 100644 index 00000000000..2548d2cff97 --- /dev/null +++ b/src/librustc_ty/lib.rs @@ -0,0 +1,25 @@ +//! Various checks +//! +//! # Note +//! +//! This API is completely unstable and subject to change. + +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![feature(bool_to_option)] +#![feature(in_band_lifetimes)] +#![feature(nll)] +#![feature(slice_patterns)] +#![recursion_limit = "256"] + +#[macro_use] +extern crate rustc; +#[macro_use] +extern crate log; + +use rustc::ty::query::Providers; + +mod ty; + +pub fn provide(providers: &mut Providers<'_>) { + ty::provide(providers); +} diff --git a/src/librustc_passes/ty.rs b/src/librustc_ty/ty.rs similarity index 100% rename from src/librustc_passes/ty.rs rename to src/librustc_ty/ty.rs