Skip to content

Commit cc8a8e0

Browse files
committed
---
yaml --- r: 108791 b: refs/heads/dist-snap c: 4c2353a h: refs/heads/master i: 108789: f882f08 108787: a72e670 108783: 5bcad1a v: v3
1 parent cbb2848 commit cc8a8e0

30 files changed

+67
-90
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 4eea6f7f244958374d3546b0c018f609de12d21d
9+
refs/heads/dist-snap: 4c2353adee4094ebcd99653ef168d607fe843144
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ This API is completely unstable and subject to change.
3030
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
3131
#[feature(quote)];
3232

33-
#[allow(visible_private_types)];
34-
3533
extern crate extra;
3634
extern crate flate;
3735
extern crate arena;

branches/dist-snap/src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use syntax::ast;
4646
use syntax::codemap;
4747
use syntax::crateid::CrateId;
4848

49-
type Cmd = @crate_metadata;
49+
pub type Cmd = @crate_metadata;
5050

5151
// A function that takes a def_id relative to the crate being searched and
5252
// returns a def_id relative to the compilation environment, i.e. if we hit a

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use syntax;
5252
use writer = serialize::ebml::writer;
5353

5454
// used by astencode:
55-
type abbrev_map = @RefCell<HashMap<ty::t, tyencode::ty_abbrev>>;
55+
pub type abbrev_map = @RefCell<HashMap<ty::t, tyencode::ty_abbrev>>;
5656

5757
/// A borrowed version of ast::InlinedItem.
5858
pub enum InlinedItemRef<'a> {
@@ -76,7 +76,7 @@ pub struct EncodeParams<'a> {
7676
encode_inlined_item: EncodeInlinedItem<'a>,
7777
}
7878

79-
struct Stats {
79+
pub struct Stats {
8080
inline_bytes: Cell<u64>,
8181
attr_bytes: Cell<u64>,
8282
dep_bytes: Cell<u64>,

branches/dist-snap/src/librustc/metadata/tydecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub enum DefIdSource {
5454
// Identifies a region parameter (`fn foo<'X>() { ... }`).
5555
RegionParameter,
5656
}
57-
type conv_did<'a> =
57+
pub type conv_did<'a> =
5858
'a |source: DefIdSource, ast::DefId| -> ast::DefId;
5959

6060
pub struct PState<'a> {

branches/dist-snap/src/librustc/middle/borrowck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ impl Repr for LoanPath {
907907

908908
///////////////////////////////////////////////////////////////////////////
909909

910-
struct TcxTyper {
910+
pub struct TcxTyper {
911911
tcx: ty::ctxt,
912912
method_map: typeck::MethodMap,
913913
}

branches/dist-snap/src/librustc/middle/check_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use syntax::{ast_util, ast_map};
2020
use syntax::visit::Visitor;
2121
use syntax::visit;
2222

23-
struct CheckCrateVisitor {
23+
pub struct CheckCrateVisitor {
2424
sess: Session,
2525
def_map: resolve::DefMap,
2626
method_map: typeck::MethodMap,

branches/dist-snap/src/librustc/middle/liveness.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ use syntax::{visit, ast_util};
126126
use syntax::visit::{Visitor, FnKind};
127127

128128
#[deriving(Eq)]
129-
struct Variable(uint);
129+
pub struct Variable(uint);
130130
#[deriving(Eq)]
131-
struct LiveNode(uint);
131+
pub struct LiveNode(uint);
132132

133133
impl Variable {
134134
fn get(&self) -> uint { let Variable(v) = *self; v }
@@ -145,7 +145,7 @@ impl Clone for LiveNode {
145145
}
146146

147147
#[deriving(Eq)]
148-
enum LiveNodeKind {
148+
pub enum LiveNodeKind {
149149
FreeVarNode(Span),
150150
ExprNode(Span),
151151
VarDefNode(Span),
@@ -226,32 +226,32 @@ impl LiveNode {
226226

227227
fn invalid_node() -> LiveNode { LiveNode(uint::MAX) }
228228

229-
struct CaptureInfo {
229+
pub struct CaptureInfo {
230230
ln: LiveNode,
231231
is_move: bool,
232232
var_nid: NodeId
233233
}
234234

235-
enum LocalKind {
235+
pub enum LocalKind {
236236
FromMatch(BindingMode),
237237
FromLetWithInitializer,
238238
FromLetNoInitializer
239239
}
240240

241-
struct LocalInfo {
241+
pub struct LocalInfo {
242242
id: NodeId,
243243
ident: Ident,
244244
is_mutbl: bool,
245245
kind: LocalKind,
246246
}
247247

248-
enum VarKind {
248+
pub enum VarKind {
249249
Arg(NodeId, Ident),
250250
Local(LocalInfo),
251251
ImplicitRet
252252
}
253253

254-
struct IrMaps {
254+
pub struct IrMaps {
255255
tcx: ty::ctxt,
256256
method_map: typeck::MethodMap,
257257
capture_map: moves::CaptureMap,
@@ -560,7 +560,7 @@ fn visit_expr(v: &mut LivenessVisitor, expr: &Expr, this: @IrMaps) {
560560
// the same basic propagation framework in all cases.
561561

562562
#[deriving(Clone)]
563-
struct Users {
563+
pub struct Users {
564564
reader: LiveNode,
565565
writer: LiveNode,
566566
used: bool
@@ -574,7 +574,7 @@ fn invalid_users() -> Users {
574574
}
575575
}
576576

577-
struct Specials {
577+
pub struct Specials {
578578
exit_ln: LiveNode,
579579
fallthrough_ln: LiveNode,
580580
no_ret_var: Variable
@@ -584,7 +584,7 @@ static ACC_READ: uint = 1u;
584584
static ACC_WRITE: uint = 2u;
585585
static ACC_USE: uint = 4u;
586586

587-
type LiveNodeMap = @RefCell<HashMap<NodeId, LiveNode>>;
587+
pub type LiveNodeMap = @RefCell<HashMap<NodeId, LiveNode>>;
588588

589589
pub struct Liveness {
590590
tcx: ty::ctxt,
@@ -1554,7 +1554,7 @@ fn check_fn(_v: &Liveness,
15541554
// do not check contents of nested fns
15551555
}
15561556

1557-
enum ReadKind {
1557+
pub enum ReadKind {
15581558
PossiblyUninitializedVariable,
15591559
PossiblyUninitializedField,
15601560
MovedValue,

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,8 @@ fn arg_kind(cx: &FunctionContext, t: ty::t) -> datum::Rvalue {
13221322
}
13231323

13241324
// work around bizarre resolve errors
1325-
type RvalueDatum = datum::Datum<datum::Rvalue>;
1326-
type LvalueDatum = datum::Datum<datum::Lvalue>;
1325+
pub type RvalueDatum = datum::Datum<datum::Rvalue>;
1326+
pub type LvalueDatum = datum::Datum<datum::Lvalue>;
13271327

13281328
// create_datums_for_fn_args: creates rvalue datums for each of the
13291329
// incoming function arguments. These will later be stored into

branches/dist-snap/src/librustc/middle/trans/cleanup.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ pub static EXIT_BREAK: uint = 0;
5151
pub static EXIT_LOOP: uint = 1;
5252
pub static EXIT_MAX: uint = 2;
5353

54-
enum CleanupScopeKind<'a> {
54+
pub enum CleanupScopeKind<'a> {
5555
CustomScopeKind,
5656
AstScopeKind(ast::NodeId),
5757
LoopScopeKind(ast::NodeId, [&'a Block<'a>, ..EXIT_MAX])
5858
}
5959

6060
#[deriving(Eq)]
61-
enum EarlyExitLabel {
61+
pub enum EarlyExitLabel {
6262
UnwindExit,
6363
ReturnExit,
6464
LoopExit(ast::NodeId, uint)
6565
}
6666

67-
struct CachedEarlyExit {
67+
pub struct CachedEarlyExit {
6868
label: EarlyExitLabel,
6969
cleanup_block: BasicBlockRef,
7070
}

branches/dist-snap/src/librustc/middle/trans/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ impl Repr for param_substs {
212212
}
213213

214214
// work around bizarre resolve errors
215-
type RvalueDatum = datum::Datum<datum::Rvalue>;
216-
type LvalueDatum = datum::Datum<datum::Lvalue>;
215+
pub type RvalueDatum = datum::Datum<datum::Rvalue>;
216+
pub type LvalueDatum = datum::Datum<datum::Lvalue>;
217217

218218
// Function context. Every LLVM function we create will have one of
219219
// these.

branches/dist-snap/src/librustc/middle/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ pub struct creader_cache_key {
158158
len: uint
159159
}
160160

161-
type creader_cache = RefCell<HashMap<creader_cache_key, t>>;
161+
pub type creader_cache = RefCell<HashMap<creader_cache_key, t>>;
162162

163-
struct intern_key {
163+
pub struct intern_key {
164164
sty: *sty,
165165
}
166166

@@ -1068,7 +1068,7 @@ pub struct ty_param_substs_and_ty {
10681068
ty: ty::t
10691069
}
10701070

1071-
type type_cache = RefCell<HashMap<ast::DefId, ty_param_bounds_and_ty>>;
1071+
pub type type_cache = RefCell<HashMap<ast::DefId, ty_param_bounds_and_ty>>;
10721072

10731073
pub type node_type_table = RefCell<HashMap<uint,t>>;
10741074

branches/dist-snap/src/librustc/middle/typeck/check/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,4 +729,4 @@ pub fn check_pointer_pat(pcx: &pat_ctxt,
729729
}
730730

731731
#[deriving(Eq)]
732-
enum PointerKind { Send, Borrowed }
732+
pub enum PointerKind { Send, Borrowed }

branches/dist-snap/src/librustc/middle/typeck/check/method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub struct Candidate {
236236
/// now we must check that the type `T` is correct). Unfortunately,
237237
/// because traits are not types, this is a pain to do.
238238
#[deriving(Clone)]
239-
enum RcvrMatchCondition {
239+
pub enum RcvrMatchCondition {
240240
RcvrMatchesIfObject(ast::DefId),
241241
RcvrMatchesIfSubtype(ty::t)
242242
}

branches/dist-snap/src/librustc/middle/typeck/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ fn rollback_to<V:Clone + Vid,T:Clone>(vb: &mut ValsAndBindings<V, T>,
500500
}
501501
}
502502

503-
struct Snapshot {
503+
pub struct Snapshot {
504504
ty_var_bindings_len: uint,
505505
int_var_bindings_len: uint,
506506
float_var_bindings_len: uint,

branches/dist-snap/src/librustc/middle/typeck/infer/region_inference/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,27 @@ use syntax::opt_vec::OptVec;
3535
mod doc;
3636

3737
#[deriving(Eq, Hash)]
38-
enum Constraint {
38+
pub enum Constraint {
3939
ConstrainVarSubVar(RegionVid, RegionVid),
4040
ConstrainRegSubVar(Region, RegionVid),
4141
ConstrainVarSubReg(RegionVid, Region),
4242
ConstrainRegSubReg(Region, Region),
4343
}
4444

4545
#[deriving(Eq, Hash)]
46-
struct TwoRegions {
46+
pub struct TwoRegions {
4747
a: Region,
4848
b: Region,
4949
}
5050

51-
enum UndoLogEntry {
51+
pub enum UndoLogEntry {
5252
Snapshot,
5353
AddVar(RegionVid),
5454
AddConstraint(Constraint),
5555
AddCombination(CombineMapType, TwoRegions)
5656
}
5757

58-
enum CombineMapType {
58+
pub enum CombineMapType {
5959
Lub, Glb
6060
}
6161

@@ -84,7 +84,7 @@ pub enum RegionResolutionError {
8484
SubregionOrigin, Region),
8585
}
8686

87-
type CombineMap = HashMap<TwoRegions, RegionVid>;
87+
pub type CombineMap = HashMap<TwoRegions, RegionVid>;
8888

8989
pub struct RegionVarBindings {
9090
tcx: ty::ctxt,
@@ -764,7 +764,7 @@ impl RegionVarBindings {
764764
#[deriving(Eq, Show)]
765765
enum Classification { Expanding, Contracting }
766766

767-
enum VarValue { NoValue, Value(Region), ErrorValue }
767+
pub enum VarValue { NoValue, Value(Region), ErrorValue }
768768

769769
struct VarData {
770770
classification: Classification,

branches/dist-snap/src/libsyntax/ext/base.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,11 @@ impl<'a> ExtCtxt<'a> {
405405
}
406406
}
407407

408-
/// Extract a string literal from the macro expanded version of `expr`,
409-
/// emitting `err_msg` if `expr` is not a string literal. This does not stop
410-
/// compilation on error, merely emits a non-fatal error and returns None.
411-
pub fn expr_to_str(cx: &mut ExtCtxt, expr: @ast::Expr, err_msg: &str)
408+
/// Extract a string literal from `expr`, emitting `err_msg` if `expr`
409+
/// is not a string literal. This does not stop compilation on error,
410+
/// merely emits a non-fatal error and returns None.
411+
pub fn expr_to_str(cx: &ExtCtxt, expr: @ast::Expr, err_msg: &str)
412412
-> Option<(InternedString, ast::StrStyle)> {
413-
// we want to be able to handle e.g. concat("foo", "bar")
414-
let expr = cx.expand_expr(expr);
415413
match expr.node {
416414
ast::ExprLit(l) => match l.node {
417415
ast::LitStr(ref s, style) => return Some(((*s).clone(), style)),
@@ -459,7 +457,7 @@ pub fn get_single_str_from_tts(cx: &ExtCtxt,
459457

460458
/// Extract comma-separated expressions from `tts`. If there is a
461459
/// parsing error, emit a non-fatal error and return None.
462-
pub fn get_exprs_from_tts(cx: &mut ExtCtxt,
460+
pub fn get_exprs_from_tts(cx: &ExtCtxt,
463461
sp: Span,
464462
tts: &[ast::TokenTree]) -> Option<Vec<@ast::Expr> > {
465463
let mut p = parse::new_parser_from_tts(cx.parse_sess(),
@@ -473,7 +471,7 @@ pub fn get_exprs_from_tts(cx: &mut ExtCtxt,
473471
cx.span_err(sp, "expected token: `,`");
474472
return None;
475473
}
476-
es.push(cx.expand_expr(p.parse_expr()));
474+
es.push(p.parse_expr());
477475
}
478476
Some(es)
479477
}
@@ -484,6 +482,9 @@ pub fn get_exprs_from_tts(cx: &mut ExtCtxt,
484482

485483
// This environment maps Names to SyntaxExtensions.
486484

485+
// Actually, the following implementation is parameterized
486+
// by both key and value types.
487+
487488
//impl question: how to implement it? Initially, the
488489
// env will contain only macros, so it might be painful
489490
// to add an empty frame for every context. Let's just
@@ -499,6 +500,14 @@ struct MapChainFrame {
499500
map: HashMap<Name, SyntaxExtension>,
500501
}
501502

503+
#[unsafe_destructor]
504+
impl Drop for MapChainFrame {
505+
fn drop(&mut self) {
506+
// make sure that syntax extension dtors run before we drop the libs
507+
self.map.clear();
508+
}
509+
}
510+
502511
// Only generic to make it easy to test
503512
pub struct SyntaxEnv {
504513
priv chain: Vec<MapChainFrame> ,

branches/dist-snap/src/libsyntax/ext/concat.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub fn expand_syntax_ext(cx: &mut base::ExtCtxt,
2525
};
2626
let mut accumulator = ~"";
2727
for e in es.move_iter() {
28+
let e = cx.expand_expr(e);
2829
match e.node {
2930
ast::ExprLit(lit) => {
3031
match lit.node {

branches/dist-snap/src/libsyntax/ext/expand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
660660
// from a given thingy and puts them in a mutable
661661
// array (passed in to the traversal)
662662
#[deriving(Clone)]
663-
struct NewNameFinderContext {
663+
pub struct NewNameFinderContext {
664664
ident_accumulator: Vec<ast::Ident> ,
665665
}
666666

@@ -748,7 +748,7 @@ pub fn expand_block_elts(b: &Block, fld: &mut MacroExpander) -> P<Block> {
748748
})
749749
}
750750

751-
struct IdentRenamer<'a> {
751+
pub struct IdentRenamer<'a> {
752752
renames: &'a mut RenameList,
753753
}
754754

0 commit comments

Comments
 (0)