Skip to content

Move rustc_back modules where they belong. #46305

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

Merged
merged 3 commits into from
Dec 5, 2017
Merged
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
6 changes: 2 additions & 4 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(drain_filter)]
#![feature(from_ref)]
#![feature(i128)]
#![feature(i128_type)]
#![feature(inclusive_range)]
4 changes: 2 additions & 2 deletions src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
use self::TargetLint::*;

use rustc_back::slice;
use std::slice;
use lint::{EarlyLintPassObject, LateLintPassObject};
use lint::{Level, Lint, LintId, LintPass, LintBuffer};
use lint::levels::{LintLevelSets, LintLevelsBuilder};
@@ -308,7 +308,7 @@ impl LintStore {
Some(ids) => CheckLintNameResult::Ok(&ids.0),
}
}
Some(&Id(ref id)) => CheckLintNameResult::Ok(slice::ref_slice(id)),
Some(&Id(ref id)) => CheckLintNameResult::Ok(slice::from_ref(id)),
}
}
}
4 changes: 2 additions & 2 deletions src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ use syntax_pos::Span;
use errors::DiagnosticBuilder;
use util::common::ErrorReported;
use util::nodemap::{NodeMap, NodeSet, FxHashSet, FxHashMap, DefIdMap};
use rustc_back::slice;
use std::slice;

use hir;
use hir::intravisit::{self, Visitor, NestedVisitorMap};
@@ -530,7 +530,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {

fn visit_lifetime(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
if lifetime_ref.is_elided() {
self.resolve_elided_lifetimes(slice::ref_slice(lifetime_ref));
self.resolve_elided_lifetimes(slice::from_ref(lifetime_ref));
return;
}
if lifetime_ref.is_static() {
14 changes: 7 additions & 7 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ use ty::subst::{Subst, Substs};
use ty::{self, AdtDef, ClosureSubsts, Region, Ty, TyCtxt, GeneratorInterior};
use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};
use util::ppaux;
use rustc_back::slice;
use std::slice;
use hir::{self, InlineAsm};
use std::ascii;
use std::borrow::{Cow};
@@ -754,28 +754,28 @@ impl<'tcx> TerminatorKind<'tcx> {
pub fn successors(&self) -> Cow<[BasicBlock]> {
use self::TerminatorKind::*;
match *self {
Goto { target: ref b } => slice::ref_slice(b).into_cow(),
Goto { target: ref b } => slice::from_ref(b).into_cow(),
SwitchInt { targets: ref b, .. } => b[..].into_cow(),
Resume | GeneratorDrop => (&[]).into_cow(),
Return => (&[]).into_cow(),
Unreachable => (&[]).into_cow(),
Call { destination: Some((_, t)), cleanup: Some(c), .. } => vec![t, c].into_cow(),
Call { destination: Some((_, ref t)), cleanup: None, .. } =>
slice::ref_slice(t).into_cow(),
Call { destination: None, cleanup: Some(ref c), .. } => slice::ref_slice(c).into_cow(),
slice::from_ref(t).into_cow(),
Call { destination: None, cleanup: Some(ref c), .. } => slice::from_ref(c).into_cow(),
Call { destination: None, cleanup: None, .. } => (&[]).into_cow(),
Yield { resume: t, drop: Some(c), .. } => vec![t, c].into_cow(),
Yield { resume: ref t, drop: None, .. } => slice::ref_slice(t).into_cow(),
Yield { resume: ref t, drop: None, .. } => slice::from_ref(t).into_cow(),
DropAndReplace { target, unwind: Some(unwind), .. } |
Drop { target, unwind: Some(unwind), .. } => {
vec![target, unwind].into_cow()
}
DropAndReplace { ref target, unwind: None, .. } |
Drop { ref target, unwind: None, .. } => {
slice::ref_slice(target).into_cow()
slice::from_ref(target).into_cow()
}
Assert { target, cleanup: Some(unwind), .. } => vec![target, unwind].into_cow(),
Assert { ref target, .. } => slice::ref_slice(target).into_cow(),
Assert { ref target, .. } => slice::from_ref(target).into_cow(),
FalseEdges { ref real_target, ref imaginary_targets } => {
let mut s = vec![*real_target];
s.extend_from_slice(imaginary_targets);
5 changes: 0 additions & 5 deletions src/librustc_back/lib.rs
Original file line number Diff line number Diff line change
@@ -28,20 +28,15 @@

#![feature(box_syntax)]
#![feature(const_fn)]
#![feature(libc)]

extern crate syntax;
extern crate libc;
extern crate rand;
extern crate serialize;
#[macro_use] extern crate log;

extern crate serialize as rustc_serialize; // used by deriving

pub mod tempdir;
pub mod target;
pub mod slice;
pub mod dynamic_lib;

use std::str::FromStr;

19 changes: 0 additions & 19 deletions src/librustc_back/slice.rs

This file was deleted.

114 changes: 0 additions & 114 deletions src/librustc_back/tempdir.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/librustc_borrowck/Cargo.toml
Original file line number Diff line number Diff line change
@@ -15,6 +15,5 @@ syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
graphviz = { path = "../libgraphviz" }
rustc = { path = "../librustc" }
rustc_back = { path = "../librustc_back" }
rustc_mir = { path = "../librustc_mir" }
rustc_errors = { path = "../librustc_errors" }
6 changes: 3 additions & 3 deletions src/librustc_borrowck/borrowck/unused.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ use rustc::hir::{self, HirId};
use rustc::lint::builtin::UNUSED_MUT;
use rustc::ty;
use rustc::util::nodemap::{FxHashMap, FxHashSet};
use rustc_back::slice;
use std::slice;
use syntax::ptr::P;

use borrowck::BorrowckCtxt;
@@ -26,7 +26,7 @@ pub fn check<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, body: &'tcx hir::Body) {
}.visit_expr(&body.value);
let mut cx = UnusedMutCx { bccx, used_mut };
for arg in body.arguments.iter() {
cx.check_unused_mut_pat(slice::ref_slice(&arg.pat));
cx.check_unused_mut_pat(slice::from_ref(&arg.pat));
}
cx.visit_expr(&body.value);
}
@@ -101,7 +101,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnusedMutCx<'a, 'tcx> {
}

fn visit_local(&mut self, local: &hir::Local) {
self.check_unused_mut_pat(slice::ref_slice(&local.pat));
self.check_unused_mut_pat(slice::from_ref(&local.pat));
}
}

2 changes: 1 addition & 1 deletion src/librustc_borrowck/lib.rs
Original file line number Diff line number Diff line change
@@ -15,14 +15,14 @@

#![allow(non_camel_case_types)]

#![feature(from_ref)]
#![feature(match_default_bindings)]
#![feature(quote)]

#[macro_use] extern crate log;
extern crate syntax;
extern crate syntax_pos;
extern crate rustc_errors as errors;
extern crate rustc_back;

// for "clarity", rename the graphviz crate to dot; graphviz within `borrowck`
// refers to the borrowck-specific graphviz adapter traits.
1 change: 0 additions & 1 deletion src/librustc_const_eval/Cargo.toml
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ crate-type = ["dylib"]
arena = { path = "../libarena" }
log = "0.3"
rustc = { path = "../librustc" }
rustc_back = { path = "../librustc_back" }
rustc_const_math = { path = "../librustc_const_math" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
6 changes: 3 additions & 3 deletions src/librustc_const_eval/check_match.rs
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ use rustc::hir::def_id::DefId;
use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
use rustc::hir::{self, Pat, PatKind};

use rustc_back::slice;
use std::slice;

use syntax::ast;
use syntax::ptr::P;
@@ -114,15 +114,15 @@ impl<'a, 'tcx> Visitor<'tcx> for MatchVisitor<'a, 'tcx> {
});

// Check legality of move bindings and `@` patterns.
self.check_patterns(false, slice::ref_slice(&loc.pat));
self.check_patterns(false, slice::from_ref(&loc.pat));
}

fn visit_body(&mut self, body: &'tcx hir::Body) {
intravisit::walk_body(self, body);

for arg in &body.arguments {
self.check_irrefutable(&arg.pat, "function argument");
self.check_patterns(false, slice::ref_slice(&arg.pat));
self.check_patterns(false, slice::from_ref(&arg.pat));
}
}
}
2 changes: 1 addition & 1 deletion src/librustc_const_eval/lib.rs
Original file line number Diff line number Diff line change
@@ -24,12 +24,12 @@
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(i128_type)]
#![feature(from_ref)]

extern crate arena;
#[macro_use] extern crate syntax;
#[macro_use] extern crate log;
#[macro_use] extern crate rustc;
extern crate rustc_back;
extern crate rustc_const_math;
extern crate rustc_data_structures;
extern crate rustc_errors;
2 changes: 1 addition & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
@@ -556,7 +556,7 @@ impl<'a> CrateLoader<'a> {
use std::{env, mem};
use proc_macro::TokenStream;
use proc_macro::__internal::Registry;
use rustc_back::dynamic_lib::DynamicLibrary;
use dynamic_lib::DynamicLibrary;
use syntax_ext::deriving::custom::ProcMacroDerive;
use syntax_ext::proc_macro_impl::{AttrProcMacro, BangProcMacro};

File renamed without changes.
Loading