rustc -> rustc_middle part 1

This commit is contained in:
Mazdak Farrokhzad 2020-03-29 15:24:45 +02:00
parent 0afdf43dc1
commit 7710f2dd5c
147 changed files with 109 additions and 107 deletions

View file

@ -3132,39 +3132,6 @@ dependencies = [
"rustc-workspace-hack",
]
[[package]]
name = "rustc"
version = "0.0.0"
dependencies = [
"arena",
"backtrace",
"bitflags",
"byteorder",
"jobserver",
"log",
"measureme",
"parking_lot 0.10.0",
"polonius-engine",
"rustc-rayon",
"rustc-rayon-core",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_query_system",
"rustc_session",
"rustc_span",
"rustc_target",
"scoped-tls",
"serialize",
"smallvec 1.0.0",
]
[[package]]
name = "rustc-ap-arena"
version = "642.0.0"
@ -3603,7 +3570,6 @@ dependencies = [
"libc",
"log",
"measureme",
"rustc",
"rustc-demangle",
"rustc_ast",
"rustc_attr",
@ -3616,6 +3582,7 @@ dependencies = [
"rustc_incremental",
"rustc_index",
"rustc_llvm",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3634,7 +3601,6 @@ dependencies = [
"log",
"memmap",
"num_cpus",
"rustc",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
@ -3645,6 +3611,7 @@ dependencies = [
"rustc_incremental",
"rustc_index",
"rustc_metadata",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_symbol_mangling",
@ -3685,7 +3652,6 @@ dependencies = [
"env_logger 0.7.1",
"lazy_static 1.4.0",
"log",
"rustc",
"rustc_ast",
"rustc_ast_pretty",
"rustc_codegen_ssa",
@ -3698,6 +3664,7 @@ dependencies = [
"rustc_interface",
"rustc_lint",
"rustc_metadata",
"rustc_middle",
"rustc_mir",
"rustc_parse",
"rustc_plugin_impl",
@ -3797,11 +3764,11 @@ dependencies = [
"graphviz",
"log",
"rand 0.7.3",
"rustc",
"rustc_ast",
"rustc_data_structures",
"rustc_fs_util",
"rustc_hir",
"rustc_middle",
"rustc_session",
"rustc_span",
"serialize",
@ -3821,13 +3788,13 @@ version = "0.0.0"
dependencies = [
"graphviz",
"log",
"rustc",
"rustc_ast",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3840,7 +3807,6 @@ version = "0.0.0"
dependencies = [
"log",
"once_cell",
"rustc",
"rustc-rayon",
"rustc_ast",
"rustc_ast_lowering",
@ -3857,6 +3823,7 @@ dependencies = [
"rustc_infer",
"rustc_lint",
"rustc_metadata",
"rustc_middle",
"rustc_mir",
"rustc_mir_build",
"rustc_parse",
@ -3890,7 +3857,6 @@ name = "rustc_lint"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_ast",
"rustc_ast_pretty",
"rustc_attr",
@ -3900,6 +3866,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3933,7 +3900,6 @@ dependencies = [
"flate2",
"log",
"memmap",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
@ -3942,6 +3908,7 @@ dependencies = [
"rustc_hir",
"rustc_hir_pretty",
"rustc_index",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3951,6 +3918,39 @@ dependencies = [
"winapi 0.3.8",
]
[[package]]
name = "rustc_middle"
version = "0.0.0"
dependencies = [
"arena",
"backtrace",
"bitflags",
"byteorder",
"jobserver",
"log",
"measureme",
"parking_lot 0.10.0",
"polonius-engine",
"rustc-rayon",
"rustc-rayon-core",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_query_system",
"rustc_session",
"rustc_span",
"rustc_target",
"scoped-tls",
"serialize",
"smallvec 1.0.0",
]
[[package]]
name = "rustc_mir"
version = "0.0.0"
@ -3961,7 +3961,6 @@ dependencies = [
"log",
"log_settings",
"polonius-engine",
"rustc",
"rustc_apfloat",
"rustc_ast",
"rustc_ast_pretty",
@ -3973,6 +3972,7 @@ dependencies = [
"rustc_infer",
"rustc_lexer",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3987,7 +3987,6 @@ version = "0.0.0"
dependencies = [
"arena",
"log",
"rustc",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
@ -3997,6 +3996,7 @@ dependencies = [
"rustc_index",
"rustc_infer",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4028,7 +4028,6 @@ name = "rustc_passes"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
@ -4037,6 +4036,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4047,12 +4047,12 @@ dependencies = [
name = "rustc_plugin_impl"
version = "0.0.0"
dependencies = [
"rustc",
"rustc_ast",
"rustc_errors",
"rustc_hir",
"rustc_lint",
"rustc_metadata",
"rustc_middle",
"rustc_session",
"rustc_span",
]
@ -4062,12 +4062,12 @@ name = "rustc_privacy"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_typeck",
@ -4096,7 +4096,6 @@ dependencies = [
"arena",
"bitflags",
"log",
"rustc",
"rustc_ast",
"rustc_ast_lowering",
"rustc_ast_pretty",
@ -4107,6 +4106,7 @@ dependencies = [
"rustc_feature",
"rustc_hir",
"rustc_metadata",
"rustc_middle",
"rustc_session",
"rustc_span",
"smallvec 1.0.0",
@ -4119,12 +4119,12 @@ dependencies = [
"log",
"rls-data",
"rls-span",
"rustc",
"rustc_ast",
"rustc_ast_pretty",
"rustc_data_structures",
"rustc_hir",
"rustc_hir_pretty",
"rustc_middle",
"rustc_parse",
"rustc_session",
"rustc_span",
@ -4169,12 +4169,12 @@ version = "0.0.0"
dependencies = [
"log",
"punycode",
"rustc",
"rustc-demangle",
"rustc_ast",
"rustc_data_structures",
"rustc_hir",
"rustc_metadata",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4209,7 +4209,6 @@ version = "0.0.0"
dependencies = [
"fmt_macros",
"log",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
@ -4218,6 +4217,7 @@ dependencies = [
"rustc_index",
"rustc_infer",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4229,12 +4229,12 @@ name = "rustc_traits"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_ast",
"rustc_data_structures",
"rustc_hir",
"rustc_infer",
"rustc_macros",
"rustc_middle",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
@ -4246,10 +4246,10 @@ name = "rustc_ty"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_hir",
"rustc_infer",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4262,7 +4262,6 @@ version = "0.0.0"
dependencies = [
"arena",
"log",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
@ -4270,6 +4269,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",

View file

@ -169,7 +169,7 @@ pub struct AssertParamIsCopy<T: Copy + ?Sized> {
/// Implementations of `Clone` for primitive types.
///
/// Implementations that cannot be described in Rust
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc_middle.
mod impls {
use super::Clone;

View file

@ -759,7 +759,7 @@ impl<T: ?Sized> Unpin for *mut T {}
/// Implementations of `Copy` for primitive types.
///
/// Implementations that cannot be described in Rust
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc_middle.
mod copy_impls {
use super::Copy;

View file

@ -10,7 +10,7 @@ pub enum EntryPointType {
OtherMain, // Not an entry point, but some other function named main
}
// Beware, this is duplicated in librustc/middle/entry.rs, make sure to keep
// Beware, this is duplicated in librustc_middle/middle/entry.rs, make sure to keep
// them in sync.
pub fn entry_point_type(item: &Item, depth: usize) -> EntryPointType {
match item.kind {

View file

@ -1,4 +1,4 @@
//! Definitions shared by macros / syntax extensions and e.g. librustc.
//! Definitions shared by macros / syntax extensions and e.g. librustc_middle.
use crate::ast::Attribute;
use rustc_span::symbol::sym;

View file

@ -54,7 +54,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
/// instead of implementing everything in librustc.
/// instead of implementing everything in librustc_middle.
pub trait HashStableContext: rustc_span::HashStableContext {
fn hash_attr(&mut self, _: &ast::Attribute, hasher: &mut StableHasher);
}

View file

@ -97,7 +97,7 @@ struct LoweringContext<'a, 'hir: 'a> {
/// HACK(Centril): there is a cyclic dependency between the parser and lowering
/// if we don't have this function pointer. To avoid that dependency so that
/// librustc is independent of the parser, we use dynamic dispatch here.
/// librustc_middle is independent of the parser, we use dynamic dispatch here.
nt_to_tokenstream: NtToTokenstream,
/// Used to allocate HIR nodes

View file

@ -16,7 +16,7 @@ flate2 = "1.0"
libc = "0.2"
measureme = "0.7.1"
log = "0.4"
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc-demangle = "0.1"
rustc_attr = { path = "../librustc_attr" }
rustc_codegen_ssa = { path = "../librustc_codegen_ssa" }

View file

@ -22,7 +22,7 @@ tempfile = "3.1"
rustc_serialize = { path = "../libserialize", package = "serialize" }
rustc_ast = { path = "../librustc_ast" }
rustc_span = { path = "../librustc_span" }
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_apfloat = { path = "../librustc_apfloat" }
rustc_attr = { path = "../librustc_attr" }
rustc_symbol_mangling = { path = "../librustc_symbol_mangling" }

View file

@ -114,6 +114,6 @@ impl<F: Fn()> Drop for OnDrop<F> {
}
}
// See comments in src/librustc/lib.rs
// See comments in src/librustc_middle/lib.rs
#[doc(hidden)]
pub fn __noop_fix_for_27438() {}

View file

@ -13,7 +13,7 @@ crate-type = ["dylib"]
lazy_static = "1.0"
log = "0.4"
env_logger = { version = "0.7", default-features = false }
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
rustc_target = { path = "../librustc_target" }
rustc_lint = { path = "../librustc_lint" }

View file

@ -12,7 +12,7 @@ extern "C" {
```
A list of available external lang items is available in
`src/librustc/middle/weak_lang_items.rs`. Example:
`src/librustc_middle/middle/weak_lang_items.rs`. Example:
```
#![feature(lang_items)]

View file

@ -425,7 +425,7 @@ impl Handler {
}
// This is here to not allow mutation of flags;
// as of this writing it's only used in tests in librustc.
// as of this writing it's only used in tests in librustc_middle.
pub fn can_emit_warnings(&self) -> bool {
self.flags.can_emit_warnings
}

View file

@ -9,7 +9,7 @@ use rustc_span::def_id::{DefPathHash, LocalDefId};
/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
/// instead of implementing everything in librustc.
/// instead of implementing everything in librustc_middle.
pub trait HashStableContext:
rustc_ast::HashStableContext + rustc_target::HashStableContext
{

View file

@ -13,7 +13,7 @@ doctest = false
graphviz = { path = "../libgraphviz" }
log = "0.4"
rand = "0.7"
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_hir = { path = "../librustc_hir" }
rustc_serialize = { path = "../libserialize", package = "serialize" }

View file

@ -6,7 +6,7 @@
#![recursion_limit = "256"]
#[macro_use]
extern crate rustc;
extern crate rustc_middle;
#[macro_use]
extern crate log;

View file

@ -12,7 +12,7 @@ doctest = false
[dependencies]
graphviz = { path = "../libgraphviz" }
log = { version = "0.4", features = ["release_max_level_info", "std"] }
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
rustc_hir = { path = "../librustc_hir" }

View file

@ -30,7 +30,7 @@ extern crate rustc_data_structures;
#[macro_use]
extern crate log;
#[macro_use]
extern crate rustc;
extern crate rustc_middle;
pub mod infer;
pub mod traits;

View file

@ -21,7 +21,7 @@ rustc_parse = { path = "../librustc_parse" }
rustc_session = { path = "../librustc_session" }
rustc_span = { path = "../librustc_span" }
rustc_serialize = { path = "../libserialize", package = "serialize" }
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_ast_lowering = { path = "../librustc_ast_lowering" }
rustc_ast_passes = { path = "../librustc_ast_passes" }
rustc_incremental = { path = "../librustc_incremental" }

View file

@ -1,6 +1,6 @@
//! Throughout the compiler tree, there are several places which want to have
//! access to state or queries while being inside crates that are dependencies
//! of librustc. To facilitate this, we have the
//! of librustc_middle. To facilitate this, we have the
//! `rustc_data_structures::AtomicRef` type, which allows us to setup a global
//! static which can then be set in this file at program startup.
//!
@ -14,7 +14,7 @@ use rustc_errors::{Diagnostic, TRACK_DIAGNOSTICS};
use std::fmt;
/// This is a callback from librustc_ast as it cannot access the implicit state
/// in librustc otherwise.
/// in librustc_middle otherwise.
fn span_debug(span: rustc_span::Span, f: &mut fmt::Formatter<'_>) -> fmt::Result {
tls::with_opt(|tcx| {
if let Some(tcx) = tcx {
@ -26,7 +26,7 @@ fn span_debug(span: rustc_span::Span, f: &mut fmt::Formatter<'_>) -> fmt::Result
}
/// This is a callback from librustc_ast as it cannot access the implicit state
/// in librustc otherwise. It is used to when diagnostic messages are
/// in librustc_middle otherwise. It is used to when diagnostic messages are
/// emitted and stores them in the current query, if there is one.
fn track_diagnostic(diagnostic: &Diagnostic) {
tls::with_context_opt(|icx| {
@ -40,7 +40,7 @@ fn track_diagnostic(diagnostic: &Diagnostic) {
}
/// This is a callback from librustc_hir as it cannot access the implicit state
/// in librustc otherwise.
/// in librustc_middle otherwise.
fn def_id_debug(def_id: rustc_hir::def_id::DefId, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "DefId({}:{}", def_id.krate, def_id.index.index())?;
tls::with_opt(|opt_tcx| {

View file

@ -11,7 +11,7 @@ path = "lib.rs"
[dependencies]
log = "0.4"
unicode-security = "0.0.2"
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
rustc_attr = { path = "../librustc_attr" }
rustc_errors = { path = "../librustc_errors" }

View file

@ -50,7 +50,7 @@ use crate::nonstandard_style::{method_context, MethodLateContext};
use log::debug;
use std::fmt::Write;
// hardwired lints from librustc
// hardwired lints from librustc_middle
pub use rustc_session::lint::builtin::*;
declare_lint! {

View file

@ -14,7 +14,7 @@ flate2 = "1.0"
log = "0.4"
memmap = "0.7"
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_attr = { path = "../librustc_attr" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }

View file

@ -14,7 +14,7 @@ extern crate libc;
extern crate proc_macro;
#[macro_use]
extern crate rustc;
extern crate rustc_middle;
#[macro_use]
extern crate rustc_data_structures;

View file

@ -1,11 +1,11 @@
[package]
authors = ["The Rust Project Developers"]
name = "rustc"
name = "rustc_middle"
version = "0.0.0"
edition = "2018"
[lib]
name = "rustc"
name = "rustc_middle"
path = "lib.rs"
doctest = false

View file

@ -93,4 +93,6 @@ pub mod util {
}
// Allows macros to refer to this crate as `::rustc`
// FIXME(Centril): maybe change this at some point if `rustc_middle`
// is something we're going with long-term.
extern crate self as rustc;

View file

@ -1,6 +1,6 @@
use super::*;
// FIXME(#27438): right now the unit tests of librustc don't refer to any actual
// FIXME(#27438): right now the unit tests of librustc_middle don't refer to any actual
// functions generated in librustc_data_structures (all
// references are through generic functions), but statics are
// referenced from time to time. Due to this bug we won't

Some files were not shown because too many files have changed in this diff Show more