Skip to content

Commit 567b90f

Browse files
committed
auto merge of #19582 : nikomatsakis/rust/crateification, r=alexcrichton
r? @alexcrichton
2 parents 2bfb64e + 2854d1b commit 567b90f

File tree

18 files changed

+140
-153
lines changed

18 files changed

+140
-153
lines changed

mk/crates.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
56-
RUSTC_CRATES := rustc rustc_typeck rustc_driver rustc_trans rustc_back rustc_llvm
56+
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_driver rustc_trans rustc_back rustc_llvm
5757
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
5858
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5959
TOOLS := compiletest rustdoc rustc
@@ -67,11 +67,12 @@ DEPS_std := core libc rand alloc collections rustrt unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
6969
DEPS_syntax := std term serialize log fmt_macros arena libc
70-
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back \
70+
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
7171
rustc_typeck log syntax serialize rustc_llvm rustc_trans
7272
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7373
log syntax serialize rustc_llvm
7474
DEPS_rustc_typeck := rustc syntax
75+
DEPS_rustc_borrowck := rustc log graphviz syntax
7576
DEPS_rustc := syntax flate arena serialize getopts rbml \
7677
time log graphviz rustc_llvm rustc_back
7778
DEPS_rustc_llvm := native:rustllvm libc std
@@ -117,9 +118,10 @@ ONLY_RLIB_unicode := 1
117118
DOC_CRATES := $(filter-out rustc, \
118119
$(filter-out rustc_trans, \
119120
$(filter-out rustc_typeck, \
121+
$(filter-out rustc_borrowck, \
120122
$(filter-out rustc_driver, \
121-
$(filter-out syntax, $(CRATES))))))
122-
COMPILER_DOC_CRATES := rustc rustc_trans rustc_typeck rustc_driver syntax
123+
$(filter-out syntax, $(CRATES)))))))
124+
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_typeck rustc_driver syntax
123125

124126
# This macro creates some simple definitions for each crate being built, just
125127
# some munging of all of the parameters above.

mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $(eval $(call RUST_CRATE,coretest))
2121

2222
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
2323
TEST_DOC_CRATES = $(DOC_CRATES)
24-
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_trans,$(HOST_CRATES))
24+
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_trans,$(HOST_CRATES))
2525
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2626

2727
######################################################################

src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ pub mod back {
6161
pub mod middle {
6262
pub mod astconv_util;
6363
pub mod astencode;
64-
pub mod borrowck;
6564
pub mod cfg;
6665
pub mod check_const;
6766
pub mod check_static_recursion;

src/librustc/middle/borrowck/check_loans.rs renamed to src/librustc_borrowck/borrowck/check_loans.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,16 @@
1818
// 4. moves do not affect things loaned out in any way
1919
use self::UseError::*;
2020

21-
use middle::borrowck::*;
22-
use middle::borrowck::LoanPathElem::*;
23-
use middle::borrowck::LoanPathKind::*;
24-
use middle::expr_use_visitor as euv;
25-
use middle::mem_categorization as mc;
26-
use middle::region;
27-
use middle::ty::ParameterEnvironment;
28-
use middle::ty;
29-
use syntax::ast::NodeId;
21+
use borrowck::*;
22+
use borrowck::LoanPathElem::*;
23+
use borrowck::LoanPathKind::*;
24+
use rustc::middle::expr_use_visitor as euv;
25+
use rustc::middle::mem_categorization as mc;
26+
use rustc::middle::region;
27+
use rustc::middle::ty;
28+
use rustc::util::ppaux::Repr;
3029
use syntax::ast;
3130
use syntax::codemap::Span;
32-
use util::ppaux::Repr;
3331

3432
use std::rc::Rc;
3533

@@ -91,7 +89,7 @@ struct CheckLoanCtxt<'a, 'tcx: 'a> {
9189
dfcx_loans: &'a LoanDataFlow<'a, 'tcx>,
9290
move_data: move_data::FlowedMoveData<'a, 'tcx>,
9391
all_loans: &'a [Loan<'tcx>],
94-
param_env: &'a ParameterEnvironment<'tcx>,
92+
param_env: &'a ty::ParameterEnvironment<'tcx>,
9593
}
9694

9795
impl<'a, 'tcx> euv::Delegate<'tcx> for CheckLoanCtxt<'a, 'tcx> {
@@ -196,12 +194,12 @@ pub fn check_loans<'a, 'b, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
196194
dfcx_loans: &LoanDataFlow<'b, 'tcx>,
197195
move_data: move_data::FlowedMoveData<'c, 'tcx>,
198196
all_loans: &[Loan<'tcx>],
199-
fn_id: NodeId,
197+
fn_id: ast::NodeId,
200198
decl: &ast::FnDecl,
201199
body: &ast::Block) {
202200
debug!("check_loans(body id={})", body.id);
203201

204-
let param_env = ParameterEnvironment::for_item(bccx.tcx, fn_id);
202+
let param_env = ty::ParameterEnvironment::for_item(bccx.tcx, fn_id);
205203

206204
let mut clcx = CheckLoanCtxt {
207205
bccx: bccx,

src/librustc/middle/borrowck/fragments.rs renamed to src/librustc_borrowck/borrowck/fragments.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@
1414
1515
use self::Fragment::*;
1616

17-
use session::config;
18-
use middle::borrowck::{LoanPath};
19-
use middle::borrowck::LoanPathKind::{LpVar, LpUpvar, LpDowncast, LpExtend};
20-
use middle::borrowck::LoanPathElem::{LpDeref, LpInterior};
21-
use middle::borrowck::move_data::{InvalidMovePathIndex};
22-
use middle::borrowck::move_data::{MoveData, MovePathIndex};
23-
use middle::ty;
24-
use middle::mem_categorization as mc;
25-
use util::ppaux::{Repr, UserString};
26-
17+
use borrowck::{LoanPath};
18+
use borrowck::LoanPathKind::{LpVar, LpUpvar, LpDowncast, LpExtend};
19+
use borrowck::LoanPathElem::{LpDeref, LpInterior};
20+
use borrowck::move_data::{InvalidMovePathIndex};
21+
use borrowck::move_data::{MoveData, MovePathIndex};
22+
use rustc::session::config;
23+
use rustc::middle::ty;
24+
use rustc::middle::mem_categorization as mc;
25+
use rustc::util::ppaux::{Repr, UserString};
2726
use std::mem;
2827
use std::rc::Rc;
2928
use std::slice;

src/librustc/middle/borrowck/gather_loans/gather_moves.rs renamed to src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@
1010

1111
//! Computes moves.
1212
13-
use middle::borrowck::*;
14-
use middle::borrowck::LoanPathKind::*;
15-
use middle::borrowck::gather_loans::move_error::MoveSpanAndPath;
16-
use middle::borrowck::gather_loans::move_error::{MoveError, MoveErrorCollector};
17-
use middle::borrowck::move_data::*;
18-
use middle::expr_use_visitor as euv;
19-
use middle::mem_categorization as mc;
20-
use middle::ty;
13+
use borrowck::*;
14+
use borrowck::LoanPathKind::*;
15+
use borrowck::gather_loans::move_error::MoveSpanAndPath;
16+
use borrowck::gather_loans::move_error::{MoveError, MoveErrorCollector};
17+
use borrowck::move_data::*;
18+
use rustc::middle::expr_use_visitor as euv;
19+
use rustc::middle::mem_categorization as mc;
20+
use rustc::middle::ty;
21+
use rustc::util::ppaux::Repr;
22+
use std::rc::Rc;
2123
use syntax::ast;
2224
use syntax::codemap::Span;
23-
use util::ppaux::Repr;
24-
25-
use std::rc::Rc;
2625

2726
struct GatherMoveInfo<'tcx> {
2827
id: ast::NodeId,

src/librustc/middle/borrowck/gather_loans/lifetime.rs renamed to src/librustc_borrowck/borrowck/gather_loans/lifetime.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
//! This module implements the check that the lifetime of a borrow
1212
//! does not exceed the lifetime of the value being borrowed.
1313
14-
use middle::borrowck::*;
15-
use middle::expr_use_visitor as euv;
16-
use middle::mem_categorization as mc;
17-
use middle::region;
18-
use middle::ty;
19-
use util::ppaux::Repr;
14+
use borrowck::*;
15+
use rustc::middle::expr_use_visitor as euv;
16+
use rustc::middle::mem_categorization as mc;
17+
use rustc::middle::region;
18+
use rustc::middle::ty;
19+
use rustc::util::ppaux::Repr;
2020
use syntax::ast;
2121
use syntax::codemap::Span;
2222

src/librustc/middle/borrowck/gather_loans/mod.rs renamed to src/librustc_borrowck/borrowck/gather_loans/mod.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@
1616
// their associated scopes. In phase two, checking loans, we will then make
1717
// sure that all of these loans are honored.
1818

19-
use middle::borrowck::*;
20-
use middle::borrowck::LoanPathKind::*;
21-
use middle::borrowck::move_data::MoveData;
22-
use middle::expr_use_visitor as euv;
23-
use middle::mem_categorization as mc;
24-
use middle::region;
25-
use middle::ty::ParameterEnvironment;
26-
use middle::ty;
27-
use util::ppaux::{Repr};
28-
19+
use borrowck::*;
20+
use borrowck::LoanPathKind::*;
21+
use borrowck::move_data::MoveData;
22+
use rustc::middle::expr_use_visitor as euv;
23+
use rustc::middle::mem_categorization as mc;
24+
use rustc::middle::region;
25+
use rustc::middle::ty;
26+
use rustc::util::ppaux::{Repr};
2927
use syntax::ast;
3028
use syntax::codemap::Span;
3129
use syntax::visit;
@@ -51,7 +49,7 @@ pub fn gather_loans_in_fn<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
5149
move_error_collector: move_error::MoveErrorCollector::new(),
5250
};
5351

54-
let param_env = ParameterEnvironment::for_item(bccx.tcx, fn_id);
52+
let param_env = ty::ParameterEnvironment::for_item(bccx.tcx, fn_id);
5553

5654
{
5755
let mut euv = euv::ExprUseVisitor::new(&mut glcx,

src/librustc/middle/borrowck/gather_loans/move_error.rs renamed to src/librustc_borrowck/borrowck/gather_loans/move_error.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use middle::mem_categorization as mc;
12-
use middle::borrowck::BorrowckCtxt;
13-
use middle::ty;
14-
11+
use borrowck::BorrowckCtxt;
12+
use rustc::middle::mem_categorization as mc;
13+
use rustc::middle::ty;
14+
use rustc::util::ppaux::UserString;
1515
use std::cell::RefCell;
1616
use syntax::ast;
1717
use syntax::codemap;
1818
use syntax::print::pprust;
19-
use util::ppaux::UserString;
2019

2120
pub struct MoveErrorCollector<'tcx> {
2221
errors: RefCell<Vec<MoveError<'tcx>>>

0 commit comments

Comments
 (0)