Skip to content

Commit 4726aea

Browse files
committed
---
yaml --- r: 162814 b: refs/heads/try c: 71d4e77 h: refs/heads/master v: v3
1 parent 76549fa commit 4726aea

File tree

132 files changed

+3613
-4306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+3613
-4306
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: 95d17711397d63425688d18140a58723caddff8e
5+
refs/heads/try: 71d4e77db8ad4b6d821da7e5d5300134ac95974e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/mk/crates.mk

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ 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
57-
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
56+
HOST_CRATES := syntax rustc rustc_trans rustdoc regex_macros fmt_macros \
57+
rustc_llvm rustc_back
5858
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5959
TOOLS := compiletest rustdoc rustc
6060

@@ -67,16 +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 \
71-
rustc_typeck log syntax serialize rustc_llvm rustc_trans
72-
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
73-
log syntax serialize rustc_llvm
74-
DEPS_rustc_typeck := rustc syntax
70+
DEPS_rustc_trans := rustc rustc_back rustc_llvm libc
7571
DEPS_rustc := syntax flate arena serialize getopts rbml \
7672
time log graphviz rustc_llvm rustc_back
7773
DEPS_rustc_llvm := native:rustllvm libc std
7874
DEPS_rustc_back := std syntax rustc_llvm flate log libc
79-
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
75+
DEPS_rustdoc := rustc rustc_trans native:hoedown serialize getopts \
8076
test time
8177
DEPS_flate := std native:miniz
8278
DEPS_arena := std
@@ -98,7 +94,7 @@ DEPS_fmt_macros = std
9894

9995
TOOL_DEPS_compiletest := test getopts
10096
TOOL_DEPS_rustdoc := rustdoc
101-
TOOL_DEPS_rustc := rustc_driver
97+
TOOL_DEPS_rustc := rustc_trans
10298
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
10399
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
104100
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
@@ -114,12 +110,8 @@ ONLY_RLIB_unicode := 1
114110
# You should not need to edit below this line
115111
################################################################################
116112

117-
DOC_CRATES := $(filter-out rustc, \
118-
$(filter-out rustc_trans, \
119-
$(filter-out rustc_typeck, \
120-
$(filter-out rustc_driver, \
121-
$(filter-out syntax, $(CRATES))))))
122-
COMPILER_DOC_CRATES := rustc rustc_trans rustc_typeck rustc_driver syntax
113+
DOC_CRATES := $(filter-out rustc, $(filter-out rustc_trans, $(filter-out syntax, $(CRATES))))
114+
COMPILER_DOC_CRATES := rustc rustc_trans syntax
123115

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

branches/try/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 = $(HOST_CRATES)
2525
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2626

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

branches/try/src/compiletest/compiletest.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,6 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
286286
test_shard: config.test_shard.clone(),
287287
nocapture: false,
288288
color: test::AutoColor,
289-
show_boxplot: false,
290-
boxplot_width: 50,
291-
show_all_stats: false,
292289
}
293290
}
294291

branches/try/src/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
extern crate "rustdoc" as this;
1313

1414
#[cfg(rustc)]
15-
extern crate "rustc_driver" as this;
15+
extern crate "rustc_trans" as this;
1616

1717
fn main() { this::main() }

branches/try/src/librustc/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ pub mod back {
5959
}
6060

6161
pub mod middle {
62-
pub mod astconv_util;
6362
pub mod astencode;
6463
pub mod borrowck;
6564
pub mod cfg;
@@ -80,7 +79,6 @@ pub mod middle {
8079
pub mod fast_reject;
8180
pub mod graph;
8281
pub mod intrinsicck;
83-
pub mod infer;
8482
pub mod lang_items;
8583
pub mod liveness;
8684
pub mod mem_categorization;
@@ -95,6 +93,7 @@ pub mod middle {
9593
pub mod traits;
9694
pub mod ty;
9795
pub mod ty_fold;
96+
pub mod typeck;
9897
pub mod weak_lang_items;
9998
}
10099

branches/try/src/librustc/lint/builtin.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ use self::MethodContext::*;
2929
use metadata::csearch;
3030
use middle::def::*;
3131
use middle::ty::{mod, Ty};
32+
use middle::typeck::astconv::ast_ty_to_ty;
33+
use middle::typeck::{mod, infer};
3234
use middle::{def, pat_util, stability};
3335
use middle::const_eval::{eval_const_expr_partial, const_int, const_uint};
3436
use util::ppaux::{ty_to_string};
@@ -82,7 +84,7 @@ impl LintPass for UnusedCasts {
8284

8385
fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
8486
if let ast::ExprCast(ref expr, ref ty) = e.node {
85-
let t_t = ty::expr_ty(cx.tcx, e);
87+
let t_t = ast_ty_to_ty(cx, &infer::new_infer_ctxt(cx.tcx), &**ty);
8688
if ty::expr_ty(cx.tcx, &**expr) == t_t {
8789
cx.span_lint(UNUSED_TYPECASTS, ty.span, "unnecessary type cast");
8890
}
@@ -1587,22 +1589,22 @@ impl LintPass for Stability {
15871589
}
15881590
ast::ExprMethodCall(i, _, _) => {
15891591
span = i.span;
1590-
let method_call = ty::MethodCall::expr(e.id);
1592+
let method_call = typeck::MethodCall::expr(e.id);
15911593
match cx.tcx.method_map.borrow().get(&method_call) {
15921594
Some(method) => {
15931595
match method.origin {
1594-
ty::MethodStatic(def_id) => {
1596+
typeck::MethodStatic(def_id) => {
15951597
def_id
15961598
}
1597-
ty::MethodStaticUnboxedClosure(def_id) => {
1599+
typeck::MethodStaticUnboxedClosure(def_id) => {
15981600
def_id
15991601
}
1600-
ty::MethodTypeParam(ty::MethodParam {
1602+
typeck::MethodTypeParam(typeck::MethodParam {
16011603
ref trait_ref,
16021604
method_num: index,
16031605
..
16041606
}) |
1605-
ty::MethodTraitObject(ty::MethodObject {
1607+
typeck::MethodTraitObject(typeck::MethodObject {
16061608
ref trait_ref,
16071609
method_num: index,
16081610
..

branches/try/src/librustc/lint/context.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@
2626
use self::TargetLint::*;
2727

2828
use middle::privacy::ExportedItems;
29+
use middle::subst;
2930
use middle::ty::{mod, Ty};
31+
use middle::typeck::astconv::AstConv;
32+
use middle::typeck::infer;
3033
use session::{early_error, Session};
3134
use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass, LintPassObject};
3235
use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid};
3336
use lint::builtin;
3437
use util::nodemap::FnvHashMap;
3538

39+
use std::rc::Rc;
3640
use std::cell::RefCell;
3741
use std::tuple::Tuple2;
3842
use std::mem;
@@ -537,6 +541,42 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
537541
}
538542
}
539543

544+
impl<'a, 'tcx> AstConv<'tcx> for Context<'a, 'tcx>{
545+
fn tcx<'a>(&'a self) -> &'a ty::ctxt<'tcx> { self.tcx }
546+
547+
fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype<'tcx> {
548+
ty::lookup_item_type(self.tcx, id)
549+
}
550+
551+
fn get_trait_def(&self, id: ast::DefId) -> Rc<ty::TraitDef<'tcx>> {
552+
ty::lookup_trait_def(self.tcx, id)
553+
}
554+
555+
fn ty_infer(&self, _span: Span) -> Ty<'tcx> {
556+
infer::new_infer_ctxt(self.tcx).next_ty_var()
557+
}
558+
559+
fn associated_types_of_trait_are_valid(&self, _: Ty<'tcx>, _: ast::DefId)
560+
-> bool {
561+
// FIXME(pcwalton): This is wrong.
562+
true
563+
}
564+
565+
fn associated_type_binding(&self,
566+
_: Span,
567+
_: Option<Ty<'tcx>>,
568+
trait_id: ast::DefId,
569+
associated_type_id: ast::DefId)
570+
-> Ty<'tcx> {
571+
// FIXME(pcwalton): This is wrong.
572+
let trait_def = self.get_trait_def(trait_id);
573+
let index = ty::associated_type_parameter_index(self.tcx,
574+
&*trait_def,
575+
associated_type_id);
576+
ty::mk_param(self.tcx, subst::TypeSpace, index, associated_type_id)
577+
}
578+
}
579+
540580
impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
541581
fn visit_item(&mut self, it: &ast::Item) {
542582
self.with_lint_attrs(it.attrs.as_slice(), |cx| {

branches/try/src/librustc/metadata/csearch.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use middle::def;
2121
use middle::lang_items;
2222
use middle::resolve;
2323
use middle::ty;
24+
use middle::typeck;
2425
use middle::subst::VecPerParamSpace;
2526

2627
use rbml;
@@ -267,7 +268,7 @@ pub fn get_impl_trait<'tcx>(tcx: &ty::ctxt<'tcx>,
267268
// Given a def_id for an impl, return information about its vtables
268269
pub fn get_impl_vtables<'tcx>(tcx: &ty::ctxt<'tcx>,
269270
def: ast::DefId)
270-
-> ty::vtable_res<'tcx> {
271+
-> typeck::vtable_res<'tcx> {
271272
let cstore = &tcx.sess.cstore;
272273
let cdata = cstore.get_crate_data(def.krate);
273274
decoder::get_impl_vtables(&*cdata, def.node, tcx)

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use middle::resolve::{TraitItemKind, TypeTraitItemKind};
3030
use middle::subst;
3131
use middle::ty::{ImplContainer, TraitContainer};
3232
use middle::ty::{mod, Ty};
33+
use middle::typeck;
3334
use middle::astencode::vtable_decoder_helpers;
3435

3536
use std::hash::Hash;
@@ -421,7 +422,7 @@ pub fn get_impl_trait<'tcx>(cdata: Cmd,
421422
pub fn get_impl_vtables<'tcx>(cdata: Cmd,
422423
id: ast::NodeId,
423424
tcx: &ty::ctxt<'tcx>)
424-
-> ty::vtable_res<'tcx>
425+
-> typeck::vtable_res<'tcx>
425426
{
426427
let item_doc = lookup_item(id, cdata.data());
427428
let vtables_doc = reader::get_doc(item_doc, tag_item_impl_vtables);

branches/try/src/librustc/middle/astconv_util.rs

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)