Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 567b90f

Browse files
committedDec 13, 2014
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>>>

‎src/librustc/middle/borrowck/gather_loans/restrictions.rs renamed to ‎src/librustc_borrowck/borrowck/gather_loans/restrictions.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
1313
pub use self::RestrictionResult::*;
1414

15-
use middle::borrowck::*;
16-
use middle::borrowck::LoanPathElem::*;
17-
use middle::borrowck::LoanPathKind::*;
18-
use middle::expr_use_visitor as euv;
19-
use middle::mem_categorization as mc;
20-
use middle::ty;
15+
use borrowck::*;
16+
use borrowck::LoanPathElem::*;
17+
use borrowck::LoanPathKind::*;
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;
2122
use syntax::codemap::Span;
22-
use util::ppaux::Repr;
2323

2424
use std::rc::Rc;
2525

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

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@ pub use self::bckerr_code::*;
1818
pub use self::AliasableViolationKind::*;
1919
pub use self::MovedValueUseKind::*;
2020

21-
use middle::cfg;
22-
use middle::dataflow::DataFlowContext;
23-
use middle::dataflow::BitwiseOperator;
24-
use middle::dataflow::DataFlowOperator;
25-
use middle::expr_use_visitor as euv;
26-
use middle::mem_categorization as mc;
27-
use middle::region;
28-
use middle::ty::{mod, ParameterEnvironment, Ty};
29-
use util::ppaux::{note_and_explain_region, Repr, UserString};
30-
21+
use rustc::middle::cfg;
22+
use rustc::middle::dataflow::DataFlowContext;
23+
use rustc::middle::dataflow::BitwiseOperator;
24+
use rustc::middle::dataflow::DataFlowOperator;
25+
use rustc::middle::expr_use_visitor as euv;
26+
use rustc::middle::mem_categorization as mc;
27+
use rustc::middle::region;
28+
use rustc::middle::ty::{mod, Ty};
29+
use rustc::util::ppaux::{note_and_explain_region, Repr, UserString};
3130
use std::rc::Rc;
3231
use std::string::String;
3332
use syntax::ast;
@@ -55,8 +54,6 @@ pub mod check_loans;
5554

5655
pub mod gather_loans;
5756

58-
pub mod graphviz;
59-
6057
pub mod move_data;
6158

6259
#[deriving(Clone)]
@@ -298,18 +295,6 @@ pub struct LoanPath<'tcx> {
298295
ty: ty::Ty<'tcx>,
299296
}
300297

301-
impl<'tcx> LoanPath<'tcx> {
302-
pub fn eq_debug(&self, that: &LoanPath<'tcx>, tcx: &ty::ctxt<'tcx>) -> bool {
303-
let r = self.kind == that.kind;
304-
if r && self.ty != that.ty {
305-
panic!("eq variants ineq types: {} == {}, {} != {}",
306-
self.repr(tcx), that.repr(tcx),
307-
self.ty.repr(tcx), that.ty.repr(tcx));
308-
}
309-
r
310-
}
311-
}
312-
313298
impl<'tcx> PartialEq for LoanPath<'tcx> {
314299
fn eq(&self, that: &LoanPath<'tcx>) -> bool {
315300
let r = self.kind == that.kind;
@@ -560,7 +545,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
560545
lp: &LoanPath<'tcx>,
561546
the_move: &move_data::Move,
562547
moved_lp: &LoanPath<'tcx>,
563-
param_env: &ParameterEnvironment<'tcx>) {
548+
param_env: &ty::ParameterEnvironment<'tcx>) {
564549
let verb = match use_kind {
565550
MovedInUse => "use",
566551
MovedInCapture => "capture",

‎src/librustc/middle/borrowck/move_data.rs renamed to ‎src/librustc_borrowck/borrowck/move_data.rs

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313
1414
pub use self::MoveKind::*;
1515

16+
use borrowck::*;
17+
use borrowck::LoanPathKind::{LpVar, LpUpvar, LpDowncast, LpExtend};
18+
use borrowck::LoanPathElem::{LpInterior};
19+
use rustc::middle::cfg;
20+
use rustc::middle::dataflow::DataFlowContext;
21+
use rustc::middle::dataflow::BitwiseOperator;
22+
use rustc::middle::dataflow::DataFlowOperator;
23+
use rustc::middle::expr_use_visitor as euv;
24+
use rustc::middle::mem_categorization as mc;
25+
use rustc::middle::ty;
26+
use rustc::util::nodemap::{FnvHashMap, NodeSet};
27+
use rustc::util::ppaux::Repr;
1628
use std::cell::RefCell;
1729
use std::rc::Rc;
1830
use std::uint;
19-
use middle::borrowck::*;
20-
use middle::borrowck::LoanPathKind::{LpVar, LpUpvar, LpDowncast, LpExtend};
21-
use middle::borrowck::LoanPathElem::{LpInterior};
22-
use middle::cfg;
23-
use middle::dataflow::DataFlowContext;
24-
use middle::dataflow::BitwiseOperator;
25-
use middle::dataflow::DataFlowOperator;
26-
use middle::expr_use_visitor as euv;
27-
use middle::mem_categorization as mc;
28-
use middle::ty;
2931
use syntax::ast;
3032
use syntax::ast_util;
3133
use syntax::codemap::Span;
32-
use util::nodemap::{FnvHashMap, NodeSet};
33-
use util::ppaux::Repr;
3434

3535
#[path="fragments.rs"]
3636
pub mod fragments;
@@ -220,37 +220,6 @@ fn loan_path_is_precise(loan_path: &LoanPath) -> bool {
220220
}
221221
}
222222

223-
impl Move {
224-
pub fn to_string<'tcx>(&self, move_data: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) -> String {
225-
format!("Move{} path: {}, id: {}, kind: {} {}",
226-
"{",
227-
move_data.path_loan_path(self.path).repr(tcx),
228-
self.id,
229-
self.kind,
230-
"}")
231-
}
232-
}
233-
234-
impl Assignment {
235-
pub fn to_string<'tcx>(&self, move_data: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) -> String {
236-
format!("Assignment{} path: {}, id: {} {}",
237-
"{",
238-
move_data.path_loan_path(self.path).repr(tcx),
239-
self.id,
240-
"}")
241-
}
242-
}
243-
244-
impl VariantMatch {
245-
pub fn to_string<'tcx>(&self, move_data: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) -> String {
246-
format!("VariantMatch{} path: {}, id: {} {}",
247-
"{",
248-
move_data.path_loan_path(self.path).repr(tcx),
249-
self.id,
250-
"}")
251-
}
252-
}
253-
254223
impl<'tcx> MoveData<'tcx> {
255224
pub fn new() -> MoveData<'tcx> {
256225
MoveData {

‎src/librustc/middle/borrowck/graphviz.rs renamed to ‎src/librustc_borrowck/graphviz.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@
1414
1515
pub use self::Variant::*;
1616

17-
/// For clarity, rename the graphviz crate locally to dot.
18-
use graphviz as dot;
19-
pub use middle::cfg::graphviz::{Node, Edge};
20-
use middle::cfg::graphviz as cfg_dot;
21-
22-
use middle::borrowck;
23-
use middle::borrowck::{BorrowckCtxt, LoanPath};
24-
use middle::cfg::{CFGIndex};
25-
use middle::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit};
26-
use middle::dataflow;
27-
17+
pub use rustc::middle::cfg::graphviz::{Node, Edge};
18+
use rustc::middle::cfg::graphviz as cfg_dot;
19+
20+
use borrowck;
21+
use borrowck::{BorrowckCtxt, LoanPath};
22+
use dot;
23+
use rustc::middle::cfg::{CFGIndex};
24+
use rustc::middle::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit};
25+
use rustc::middle::dataflow;
2826
use std::rc::Rc;
2927

3028
#[deriving(Show)]

‎src/librustc_borrowck/lib.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_name = "rustc_borrowck"]
12+
#![experimental]
13+
#![crate_type = "dylib"]
14+
#![crate_type = "rlib"]
15+
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
16+
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
17+
html_root_url = "http://doc.rust-lang.org/nightly/")]
18+
19+
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
20+
#![feature(slicing_syntax, tuple_indexing, unsafe_destructor)]
21+
#![feature(rustc_diagnostic_macros)]
22+
#![allow(non_camel_case_types)]
23+
24+
#[phase(plugin, link)] extern crate log;
25+
#[phase(plugin, link)] extern crate syntax;
26+
27+
// for "clarity", rename the graphviz crate to dot; graphviz within `borrowck`
28+
// refers to the borrowck-specific graphviz adapter traits.
29+
extern crate "graphviz" as dot;
30+
extern crate rustc;
31+
32+
pub use borrowck::check_crate;
33+
pub use borrowck::build_borrowck_dataflow_data_for_fn;
34+
pub use borrowck::FnPartsWithCFG;
35+
36+
mod borrowck;
37+
38+
pub mod graphviz;
39+

‎src/librustc_driver/driver.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use rustc::plugin::load::Plugins;
1919
use rustc::plugin::registry::Registry;
2020
use rustc::plugin;
2121
use rustc::util::common::time;
22+
use rustc_borrowck as borrowck;
2223
use rustc_trans::back::link;
2324
use rustc_trans::back::write;
2425
use rustc_trans::save;
@@ -420,7 +421,7 @@ pub fn phase_3_run_analysis_passes<'tcx>(sess: Session,
420421
middle::liveness::check_crate(&ty_cx));
421422

422423
time(time_passes, "borrow checking", (), |_|
423-
middle::borrowck::check_crate(&ty_cx));
424+
borrowck::check_crate(&ty_cx));
424425

425426
time(time_passes, "rvalue checking", (), |_|
426427
middle::check_rvalues::check_crate(&ty_cx, krate));

‎src/librustc_driver/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ extern crate getopts;
3232
extern crate graphviz;
3333
extern crate libc;
3434
extern crate rustc;
35-
extern crate rustc_typeck;
3635
extern crate rustc_back;
36+
extern crate rustc_borrowck;
3737
extern crate rustc_trans;
38+
extern crate rustc_typeck;
3839
#[phase(plugin, link)] extern crate log;
3940
#[phase(plugin, link)] extern crate syntax;
4041
extern crate serialize;

‎src/librustc_driver/pretty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ use rustc_trans::back::link;
2020
use driver;
2121

2222
use rustc::middle::ty;
23-
use rustc::middle::borrowck::{mod, FnPartsWithCFG};
24-
use rustc::middle::borrowck::graphviz as borrowck_dot;
2523
use rustc::middle::cfg;
2624
use rustc::middle::cfg::graphviz::LabelledCFG;
2725
use rustc::session::Session;
2826
use rustc::session::config::{mod, Input};
2927
use rustc::util::ppaux;
28+
use rustc_borrowck as borrowck;
29+
use rustc_borrowck::graphviz as borrowck_dot;
3030

3131
use syntax::ast;
3232
use syntax::ast_map::{mod, blocks, NodePrinter};
@@ -565,7 +565,7 @@ fn print_flowgraph<W:io::Writer>(variants: Vec<borrowck_dot::Variant>,
565565
return Ok(())
566566
}
567567
blocks::FnLikeCode(fn_like) => {
568-
let fn_parts = FnPartsWithCFG::from_fn_like(&fn_like, &cfg);
568+
let fn_parts = borrowck::FnPartsWithCFG::from_fn_like(&fn_like, &cfg);
569569
let (bccx, analysis_data) =
570570
borrowck::build_borrowck_dataflow_data_for_fn(ty_cx, fn_parts);
571571

0 commit comments

Comments
 (0)
Please sign in to comment.