Skip to content

Commit a4fa23a

Browse files
committed
Auto merge of #46305 - irinagpopa:backstory, r=alexcrichton,eddyb
Move rustc_back modules where they belong.
2 parents cd8a352 + 2c175df commit a4fa23a

File tree

38 files changed

+57
-195
lines changed

38 files changed

+57
-195
lines changed

src/Cargo.lock

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/librustc/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#![feature(const_fn)]
4747
#![feature(core_intrinsics)]
4848
#![feature(drain_filter)]
49+
#![feature(from_ref)]
4950
#![feature(i128)]
5051
#![feature(i128_type)]
5152
#![feature(inclusive_range)]

src/librustc/lint/context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
2727
use self::TargetLint::*;
2828

29-
use rustc_back::slice;
29+
use std::slice;
3030
use lint::{EarlyLintPassObject, LateLintPassObject};
3131
use lint::{Level, Lint, LintId, LintPass, LintBuffer};
3232
use lint::levels::{LintLevelSets, LintLevelsBuilder};
@@ -308,7 +308,7 @@ impl LintStore {
308308
Some(ids) => CheckLintNameResult::Ok(&ids.0),
309309
}
310310
}
311-
Some(&Id(ref id)) => CheckLintNameResult::Ok(slice::ref_slice(id)),
311+
Some(&Id(ref id)) => CheckLintNameResult::Ok(slice::from_ref(id)),
312312
}
313313
}
314314
}

src/librustc/middle/resolve_lifetime.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use syntax_pos::Span;
3131
use errors::DiagnosticBuilder;
3232
use util::common::ErrorReported;
3333
use util::nodemap::{NodeMap, NodeSet, FxHashSet, FxHashMap, DefIdMap};
34-
use rustc_back::slice;
34+
use std::slice;
3535

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

531531
fn visit_lifetime(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
532532
if lifetime_ref.is_elided() {
533-
self.resolve_elided_lifetimes(slice::ref_slice(lifetime_ref));
533+
self.resolve_elided_lifetimes(slice::from_ref(lifetime_ref));
534534
return;
535535
}
536536
if lifetime_ref.is_static() {

src/librustc/mir/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use ty::subst::{Subst, Substs};
2525
use ty::{self, AdtDef, ClosureSubsts, Region, Ty, TyCtxt, GeneratorInterior};
2626
use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};
2727
use util::ppaux;
28-
use rustc_back::slice;
28+
use std::slice;
2929
use hir::{self, InlineAsm};
3030
use std::ascii;
3131
use std::borrow::{Cow};
@@ -754,28 +754,28 @@ impl<'tcx> TerminatorKind<'tcx> {
754754
pub fn successors(&self) -> Cow<[BasicBlock]> {
755755
use self::TerminatorKind::*;
756756
match *self {
757-
Goto { target: ref b } => slice::ref_slice(b).into_cow(),
757+
Goto { target: ref b } => slice::from_ref(b).into_cow(),
758758
SwitchInt { targets: ref b, .. } => b[..].into_cow(),
759759
Resume | GeneratorDrop => (&[]).into_cow(),
760760
Return => (&[]).into_cow(),
761761
Unreachable => (&[]).into_cow(),
762762
Call { destination: Some((_, t)), cleanup: Some(c), .. } => vec![t, c].into_cow(),
763763
Call { destination: Some((_, ref t)), cleanup: None, .. } =>
764-
slice::ref_slice(t).into_cow(),
765-
Call { destination: None, cleanup: Some(ref c), .. } => slice::ref_slice(c).into_cow(),
764+
slice::from_ref(t).into_cow(),
765+
Call { destination: None, cleanup: Some(ref c), .. } => slice::from_ref(c).into_cow(),
766766
Call { destination: None, cleanup: None, .. } => (&[]).into_cow(),
767767
Yield { resume: t, drop: Some(c), .. } => vec![t, c].into_cow(),
768-
Yield { resume: ref t, drop: None, .. } => slice::ref_slice(t).into_cow(),
768+
Yield { resume: ref t, drop: None, .. } => slice::from_ref(t).into_cow(),
769769
DropAndReplace { target, unwind: Some(unwind), .. } |
770770
Drop { target, unwind: Some(unwind), .. } => {
771771
vec![target, unwind].into_cow()
772772
}
773773
DropAndReplace { ref target, unwind: None, .. } |
774774
Drop { ref target, unwind: None, .. } => {
775-
slice::ref_slice(target).into_cow()
775+
slice::from_ref(target).into_cow()
776776
}
777777
Assert { target, cleanup: Some(unwind), .. } => vec![target, unwind].into_cow(),
778-
Assert { ref target, .. } => slice::ref_slice(target).into_cow(),
778+
Assert { ref target, .. } => slice::from_ref(target).into_cow(),
779779
FalseEdges { ref real_target, ref imaginary_targets } => {
780780
let mut s = vec![*real_target];
781781
s.extend_from_slice(imaginary_targets);

src/librustc_back/lib.rs

-5
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,15 @@
2828

2929
#![feature(box_syntax)]
3030
#![feature(const_fn)]
31-
#![feature(libc)]
3231

3332
extern crate syntax;
34-
extern crate libc;
3533
extern crate rand;
3634
extern crate serialize;
3735
#[macro_use] extern crate log;
3836

3937
extern crate serialize as rustc_serialize; // used by deriving
4038

41-
pub mod tempdir;
4239
pub mod target;
43-
pub mod slice;
44-
pub mod dynamic_lib;
4540

4641
use std::str::FromStr;
4742

src/librustc_back/slice.rs

-19
This file was deleted.

src/librustc_back/tempdir.rs

-114
This file was deleted.

src/librustc_borrowck/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ syntax = { path = "../libsyntax" }
1515
syntax_pos = { path = "../libsyntax_pos" }
1616
graphviz = { path = "../libgraphviz" }
1717
rustc = { path = "../librustc" }
18-
rustc_back = { path = "../librustc_back" }
1918
rustc_mir = { path = "../librustc_mir" }
2019
rustc_errors = { path = "../librustc_errors" }

src/librustc_borrowck/borrowck/unused.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc::hir::{self, HirId};
1313
use rustc::lint::builtin::UNUSED_MUT;
1414
use rustc::ty;
1515
use rustc::util::nodemap::{FxHashMap, FxHashSet};
16-
use rustc_back::slice;
16+
use std::slice;
1717
use syntax::ptr::P;
1818

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

103103
fn visit_local(&mut self, local: &hir::Local) {
104-
self.check_unused_mut_pat(slice::ref_slice(&local.pat));
104+
self.check_unused_mut_pat(slice::from_ref(&local.pat));
105105
}
106106
}
107107

src/librustc_borrowck/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
#![allow(non_camel_case_types)]
1717

18+
#![feature(from_ref)]
1819
#![feature(match_default_bindings)]
1920
#![feature(quote)]
2021

2122
#[macro_use] extern crate log;
2223
extern crate syntax;
2324
extern crate syntax_pos;
2425
extern crate rustc_errors as errors;
25-
extern crate rustc_back;
2626

2727
// for "clarity", rename the graphviz crate to dot; graphviz within `borrowck`
2828
// refers to the borrowck-specific graphviz adapter traits.

src/librustc_const_eval/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ crate-type = ["dylib"]
1212
arena = { path = "../libarena" }
1313
log = "0.3"
1414
rustc = { path = "../librustc" }
15-
rustc_back = { path = "../librustc_back" }
1615
rustc_const_math = { path = "../librustc_const_math" }
1716
rustc_data_structures = { path = "../librustc_data_structures" }
1817
rustc_errors = { path = "../librustc_errors" }

src/librustc_const_eval/check_match.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use rustc::hir::def_id::DefId;
3131
use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
3232
use rustc::hir::{self, Pat, PatKind};
3333

34-
use rustc_back::slice;
34+
use std::slice;
3535

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

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

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

123123
for arg in &body.arguments {
124124
self.check_irrefutable(&arg.pat, "function argument");
125-
self.check_patterns(false, slice::ref_slice(&arg.pat));
125+
self.check_patterns(false, slice::from_ref(&arg.pat));
126126
}
127127
}
128128
}

src/librustc_const_eval/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
#![feature(box_patterns)]
2525
#![feature(box_syntax)]
2626
#![feature(i128_type)]
27+
#![feature(from_ref)]
2728

2829
extern crate arena;
2930
#[macro_use] extern crate syntax;
3031
#[macro_use] extern crate log;
3132
#[macro_use] extern crate rustc;
32-
extern crate rustc_back;
3333
extern crate rustc_const_math;
3434
extern crate rustc_data_structures;
3535
extern crate rustc_errors;

src/librustc_metadata/creader.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ impl<'a> CrateLoader<'a> {
556556
use std::{env, mem};
557557
use proc_macro::TokenStream;
558558
use proc_macro::__internal::Registry;
559-
use rustc_back::dynamic_lib::DynamicLibrary;
559+
use dynamic_lib::DynamicLibrary;
560560
use syntax_ext::deriving::custom::ProcMacroDerive;
561561
use syntax_ext::proc_macro_impl::{AttrProcMacro, BangProcMacro};
562562

0 commit comments

Comments
 (0)