Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librustc_interface => 2018 #58837

Merged
merged 2 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/librustc_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "rustc_interface"
version = "0.0.0"
edition = "2018"

[lib]
name = "rustc_interface"
Expand All @@ -10,7 +11,7 @@ crate-type = ["dylib"]

[dependencies]
log = "0.4"
rustc-rayon = "0.1.1"
rayon = { version = "0.1.1", package = "rustc-rayon" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
scoped-tls = "1.0"
syntax = { path = "../libsyntax" }
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_interface/interface.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use queries::Queries;
use crate::queries::Queries;
use crate::util;
use crate::profile;
pub use crate::passes::BoxedResolver;

use rustc::lint;
use rustc::session::config::{self, Input};
use rustc::session::{DiagnosticOutput, Session};
Expand All @@ -15,10 +19,6 @@ use std::result;
use std::sync::{Arc, Mutex};
use syntax;
use syntax::source_map::{FileLoader, SourceMap};
use util;
use profile;

pub use passes::BoxedResolver;

pub type Result<T> = result::Result<T, ErrorReported>;

Expand Down
27 changes: 2 additions & 25 deletions src/librustc_interface/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,14 @@
#![feature(generators)]
#![cfg_attr(unix, feature(libc))]

#![deny(rust_2018_idioms)]

#![allow(unused_imports)]

#![recursion_limit="256"]

#[cfg(unix)]
extern crate libc;
#[macro_use]
extern crate log;
extern crate rustc;
extern crate rustc_codegen_utils;
extern crate rustc_allocator;
extern crate rustc_borrowck;
extern crate rustc_incremental;
extern crate rustc_traits;
#[macro_use]
extern crate rustc_data_structures;
extern crate rustc_errors;
extern crate rustc_lint;
extern crate rustc_metadata;
extern crate rustc_mir;
extern crate rustc_passes;
extern crate rustc_plugin;
extern crate rustc_privacy;
extern crate rustc_rayon as rayon;
extern crate rustc_resolve;
extern crate rustc_typeck;
extern crate smallvec;
extern crate serialize;
extern crate syntax;
extern crate syntax_pos;
extern crate syntax_ext;

pub mod interface;
mod passes;
Expand Down
12 changes: 7 additions & 5 deletions src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use interface::{Compiler, Result};
use util;
use proc_macro_decls;
use crate::interface::{Compiler, Result};
use crate::util;
use crate::proc_macro_decls;

use log::{debug, info, warn, log_enabled};
use rustc::dep_graph::DepGraph;
use rustc::hir;
use rustc::hir::lowering::lower_crate;
Expand All @@ -20,6 +21,7 @@ use rustc::session::search_paths::PathKind;
use rustc_allocator as allocator;
use rustc_borrowck as borrowck;
use rustc_codegen_utils::codegen_backend::CodegenBackend;
use rustc_data_structures::{box_region_allow_access, declare_box_region_type, parallel};
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::stable_hasher::StableHasher;
use rustc_data_structures::sync::{Lrc, ParallelIterator, par_iter};
Expand Down Expand Up @@ -758,7 +760,7 @@ pub fn prepare_outputs(
Ok(outputs)
}

pub fn default_provide(providers: &mut ty::query::Providers) {
pub fn default_provide(providers: &mut ty::query::Providers<'_>) {
providers.analysis = analysis;
proc_macro_decls::provide(providers);
plugin::build::provide(providers);
Expand All @@ -783,7 +785,7 @@ pub fn default_provide(providers: &mut ty::query::Providers) {
lint::provide(providers);
}

pub fn default_provide_extern(providers: &mut ty::query::Providers) {
pub fn default_provide_extern(providers: &mut ty::query::Providers<'_>) {
cstore::provide_extern(providers);
}

Expand Down
3 changes: 2 additions & 1 deletion src/librustc_interface/profile/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use log::debug;
use rustc::dep_graph::DepNode;
use rustc::session::Session;
use rustc::util::common::{ProfQDumpParams, ProfileQueriesMsg, profq_msg, profq_set_chan};
use std::sync::mpsc::{Receiver};
use std::io::{Write};
use rustc::dep_graph::{DepNode};
use std::time::{Duration, Instant};

pub mod trace;
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_interface/queries.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use interface::{Compiler, Result};
use passes::{self, BoxedResolver, ExpansionResult, BoxedGlobalCtxt, PluginInfo};
use crate::interface::{Compiler, Result};
use crate::passes::{self, BoxedResolver, ExpansionResult, BoxedGlobalCtxt, PluginInfo};

use rustc_incremental::DepGraphFuture;
use rustc_data_structures::sync::Lrc;
use rustc::session::config::{Input, OutputFilenames, OutputType};
Expand Down
1 change: 1 addition & 0 deletions src/librustc_interface/util.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use log::info;
use rustc::session::config::{Input, OutputFilenames, ErrorOutputType};
use rustc::session::{self, config, early_error, filesearch, Session, DiagnosticOutput};
use rustc::session::CrateDisambiguator;
Expand Down