Skip to content

Commit cf52540

Browse files
committed
---
yaml --- r: 151477 b: refs/heads/try2 c: a990920 h: refs/heads/master i: 151475: 59759ea v: v3
1 parent bea251c commit cf52540

File tree

16 files changed

+581
-353
lines changed

16 files changed

+581
-353
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: dc30c483810ca0ee3641f4bab8e6f2a44a883fee
8+
refs/heads/try2: a990920c6fff9b762c3d0968ff0a5fdcce6d2b39
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
5454
workcache url log regex graphviz core
55-
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros
55+
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

@@ -61,7 +61,7 @@ DEPS_std := core libc native:rustrt native:compiler-rt native:backtrace
6161
DEPS_green := std rand native:context_switch
6262
DEPS_rustuv := std native:uv native:uv_support
6363
DEPS_native := std
64-
DEPS_syntax := std term serialize collections log
64+
DEPS_syntax := std term serialize collections log fmt_macros
6565
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
6666
collections time log
6767
DEPS_rustdoc := rustc native:hoedown serialize sync getopts collections \
@@ -88,6 +88,7 @@ DEPS_workcache := std serialize collections log
8888
DEPS_log := std sync
8989
DEPS_regex := std collections
9090
DEPS_regex_macros = syntax std regex
91+
DEPS_fmt_macros = std
9192

9293
TOOL_DEPS_compiletest := test green rustuv getopts
9394
TOOL_DEPS_rustdoc := rustdoc native

branches/try2/src/libstd/fmt/parse.rs renamed to branches/try2/src/libfmt_macros/lib.rs

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

11-
//! Parsing of format strings
11+
//! Macro support for format strings
1212
//!
1313
//! These structures are used when parsing format strings for the compiler.
1414
//! Parsing does not happen at runtime: structures of `std::fmt::rt` are
1515
//! generated instead.
1616
17-
use prelude::*;
17+
#![crate_id = "fmt_macros#0.11-pre"]
18+
#![license = "MIT/ASL2"]
19+
#![crate_type = "rlib"]
20+
#![crate_type = "dylib"]
21+
#![feature(macro_rules, globs)]
22+
#![experimental]
1823

19-
use char;
20-
use owned::Box;
21-
use str;
24+
use std::char;
25+
use std::str;
2226

2327
/// A piece is a portion of the format string which represents the next part
2428
/// to emit. These are emitted as a stream by the `Parser` class.
@@ -164,7 +168,7 @@ pub struct PluralArm<'a> {
164168
/// is specially placed in the `Plural` variant of `Method`.
165169
///
166170
/// http://www.icu-project.org/apiref/icu4c/classicu_1_1PluralRules.html
167-
#[deriving(Eq, TotalEq, Hash)]
171+
#[deriving(Eq, TotalEq, Hash, Show)]
168172
#[allow(missing_doc)]
169173
pub enum PluralKeyword {
170174
/// The plural form for zero objects.
@@ -683,7 +687,6 @@ impl<'a> Parser<'a> {
683687
#[cfg(test)]
684688
mod tests {
685689
use super::*;
686-
use prelude::*;
687690

688691
fn same(fmt: &'static str, p: &[Piece<'static>]) {
689692
let mut parser = Parser::new(fmt);

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,18 +1620,20 @@ impl<'a> Resolver<'a> {
16201620

16211621
match def {
16221622
DefMod(_) | DefForeignMod(_) => {}
1623-
DefVariant(_, variant_id, is_struct) => {
1623+
DefVariant(enum_did, variant_id, is_struct) => {
16241624
debug!("(building reduced graph for external crate) building \
16251625
variant {}",
16261626
final_ident);
1627-
// We assume the parent is visible, or else we wouldn't have seen
1628-
// it. Also variants are public-by-default if the parent was also
1629-
// public.
1627+
// If this variant is public, then it was publicly reexported,
1628+
// otherwise we need to inherit the visibility of the enum
1629+
// definition.
1630+
let is_exported = is_public ||
1631+
self.external_exports.contains(&enum_did);
16301632
if is_struct {
1631-
child_name_bindings.define_type(def, DUMMY_SP, true);
1633+
child_name_bindings.define_type(def, DUMMY_SP, is_exported);
16321634
self.structs.insert(variant_id);
16331635
} else {
1634-
child_name_bindings.define_value(def, DUMMY_SP, true);
1636+
child_name_bindings.define_value(def, DUMMY_SP, is_exported);
16351637
}
16361638
}
16371639
DefFn(..) | DefStaticMethod(..) | DefStatic(..) => {

branches/try2/src/librustc/middle/ty_fold.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ pub trait TypeFolder {
7171
fn fold_trait_store(&mut self, s: ty::TraitStore) -> ty::TraitStore {
7272
super_fold_trait_store(self, s)
7373
}
74+
75+
fn fold_autoref(&mut self, ar: &ty::AutoRef) -> ty::AutoRef {
76+
super_fold_autoref(self, ar)
77+
}
7478
}
7579

7680
pub fn fold_opt_ty<T:TypeFolder>(this: &mut T,
@@ -200,6 +204,19 @@ pub fn super_fold_trait_store<T:TypeFolder>(this: &mut T,
200204
}
201205
}
202206

207+
pub fn super_fold_autoref<T:TypeFolder>(this: &mut T,
208+
autoref: &ty::AutoRef)
209+
-> ty::AutoRef
210+
{
211+
match *autoref {
212+
ty::AutoPtr(r, m) => ty::AutoPtr(this.fold_region(r), m),
213+
ty::AutoBorrowVec(r, m) => ty::AutoBorrowVec(this.fold_region(r), m),
214+
ty::AutoBorrowVecRef(r, m) => ty::AutoBorrowVecRef(this.fold_region(r), m),
215+
ty::AutoUnsafe(m) => ty::AutoUnsafe(m),
216+
ty::AutoBorrowObj(r, m) => ty::AutoBorrowObj(this.fold_region(r), m),
217+
}
218+
}
219+
203220
///////////////////////////////////////////////////////////////////////////
204221
// Some sample folders
205222

branches/try2/src/librustc/middle/typeck/check/mod.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ enum IsBinopAssignment{
221221

222222
#[deriving(Clone)]
223223
pub struct FnCtxt<'a> {
224+
// This flag is set to true if, during the writeback phase, we encounter
225+
// a type error in this function.
226+
writeback_errors: Cell<bool>,
227+
224228
// Number of errors that had been reported when we started
225229
// checking this function. On exit, if we find that *more* errors
226230
// have been reported, we will skip regionck and other work that
@@ -280,6 +284,7 @@ fn blank_fn_ctxt<'a>(ccx: &'a CrateCtxt<'a>,
280284
region_bnd: ast::NodeId)
281285
-> FnCtxt<'a> {
282286
FnCtxt {
287+
writeback_errors: Cell::new(false),
283288
err_count_on_creation: ccx.tcx.sess.err_count(),
284289
ret_ty: rty,
285290
ps: RefCell::new(FnStyleState::function(ast::NormalFn, 0)),
@@ -469,6 +474,7 @@ fn check_fn<'a>(ccx: &'a CrateCtxt<'a>,
469474
// Create the function context. This is either derived from scratch or,
470475
// in the case of function expressions, based on the outer context.
471476
let fcx = FnCtxt {
477+
writeback_errors: Cell::new(false),
472478
err_count_on_creation: err_count_on_creation,
473479
ret_ty: ret_ty,
474480
ps: RefCell::new(FnStyleState::function(fn_style, id)),
@@ -1198,11 +1204,10 @@ impl<'a> FnCtxt<'a> {
11981204

11991205
pub fn opt_node_ty_substs(&self,
12001206
id: ast::NodeId,
1201-
f: |&ty::substs| -> bool)
1202-
-> bool {
1207+
f: |&ty::substs|) {
12031208
match self.inh.node_type_substs.borrow().find(&id) {
1204-
Some(s) => f(s),
1205-
None => true
1209+
Some(s) => { f(s) }
1210+
None => { }
12061211
}
12071212
}
12081213

branches/try2/src/librustc/middle/typeck/check/vtable.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,6 @@ pub fn early_resolve_expr(ex: &ast::Expr, fcx: &FnCtxt, is_early: bool) {
644644
insert_vtables(fcx, MethodCall::expr(ex.id), vtbls);
645645
}
646646
}
647-
true
648647
});
649648
}
650649

0 commit comments

Comments
 (0)