Skip to content

Commit 1dd1c37

Browse files
committed
---
yaml --- r: 130973 b: refs/heads/auto c: a09dbf2 h: refs/heads/master i: 130971: 35dd675 v: v3
1 parent 1e73326 commit 1dd1c37

Some content is hidden

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

52 files changed

+1516
-1517
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: e9278c92199ac46a486f476bc530bd4baec8fff9
16+
refs/heads/auto: a09dbf28e64e7ac9b9786320d90a87854615d77a
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/etc/get-snapshot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def unpack_snapshot(triple, dl_path):
5252
if len(sys.argv) == 3:
5353
dl_path = sys.argv[2]
5454
else:
55-
snap = determine_curr_snapshot(triple)
55+
# There are no 64-bit Windows snapshots yet, so we'll use 32-bit ones instead, for now
56+
snap_triple = triple if triple != "x86_64-w64-mingw32" else "i686-w64-mingw32"
57+
snap = determine_curr_snapshot(snap_triple)
5658
dl = os.path.join(download_dir_base, snap)
5759
url = download_url_base + "/" + snap
5860
print("determined most recent snapshot: " + snap)

branches/auto/src/libcore/fmt/mod.rs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ impl<'a> Arguments<'a> {
113113
/// Arguments structure. The compiler inserts an `unsafe` block to call this,
114114
/// which is valid because the compiler performs all necessary validation to
115115
/// ensure that the resulting call to format/write would be safe.
116+
#[cfg(not(stage0))]
116117
#[doc(hidden)] #[inline]
117118
pub unsafe fn new<'a>(pieces: &'static [&'static str],
118119
args: &'a [Argument<'a>]) -> Arguments<'a> {
@@ -126,6 +127,7 @@ impl<'a> Arguments<'a> {
126127
/// This function is used to specify nonstandard formatting parameters.
127128
/// The `pieces` array must be at least as long as `fmt` to construct
128129
/// a valid Arguments structure.
130+
#[cfg(not(stage0))]
129131
#[doc(hidden)] #[inline]
130132
pub unsafe fn with_placeholders<'a>(pieces: &'static [&'static str],
131133
fmt: &'static [rt::Argument<'static>],
@@ -136,6 +138,13 @@ impl<'a> Arguments<'a> {
136138
args: args
137139
}
138140
}
141+
142+
#[cfg(stage0)]
143+
#[doc(hidden)] #[inline]
144+
pub unsafe fn new<'a>(fmt: &'static [rt::Piece<'static>],
145+
args: &'a [Argument<'a>]) -> Arguments<'a> {
146+
Arguments{ fmt: mem::transmute(fmt), args: args }
147+
}
139148
}
140149

141150
/// This structure represents a safely precompiled version of a format string
@@ -147,6 +156,7 @@ impl<'a> Arguments<'a> {
147156
/// and pass it to a function or closure, passed as the first argument. The
148157
/// macro validates the format string at compile-time so usage of the `write`
149158
/// and `format` functions can be safely performed.
159+
#[cfg(not(stage0))]
150160
pub struct Arguments<'a> {
151161
// Format string pieces to print.
152162
pieces: &'a [&'a str],
@@ -159,6 +169,12 @@ pub struct Arguments<'a> {
159169
args: &'a [Argument<'a>],
160170
}
161171

172+
#[cfg(stage0)] #[doc(hidden)]
173+
pub struct Arguments<'a> {
174+
fmt: &'a [rt::Piece<'a>],
175+
args: &'a [Argument<'a>],
176+
}
177+
162178
impl<'a> Show for Arguments<'a> {
163179
fn fmt(&self, fmt: &mut Formatter) -> Result {
164180
write(fmt.buf, self)
@@ -280,6 +296,7 @@ uniform_fn_call_workaround! {
280296
secret_upper_exp, UpperExp;
281297
}
282298

299+
#[cfg(not(stage0))]
283300
static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
284301
position: rt::ArgumentNext,
285302
format: rt::FormatSpec {
@@ -299,6 +316,7 @@ static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
299316
///
300317
/// * output - the buffer to write output to
301318
/// * args - the precompiled arguments generated by `format_args!`
319+
#[cfg(not(stage0))]
302320
pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
303321
let mut formatter = Formatter {
304322
flags: 0,
@@ -342,11 +360,30 @@ pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
342360
Ok(())
343361
}
344362

363+
#[cfg(stage0)] #[doc(hidden)]
364+
pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
365+
let mut formatter = Formatter {
366+
flags: 0,
367+
width: None,
368+
precision: None,
369+
buf: output,
370+
align: rt::AlignUnknown,
371+
fill: ' ',
372+
args: args.args,
373+
curarg: args.args.iter(),
374+
};
375+
for piece in args.fmt.iter() {
376+
try!(formatter.run(piece));
377+
}
378+
Ok(())
379+
}
380+
345381
impl<'a> Formatter<'a> {
346382

347383
// First up is the collection of functions used to execute a format string
348384
// at runtime. This consumes all of the compile-time statics generated by
349385
// the format! syntax extension.
386+
#[cfg(not(stage0))]
350387
fn run(&mut self, arg: &rt::Argument) -> Result {
351388
// Fill in the format parameters into the formatter
352389
self.fill = arg.format.fill;
@@ -365,6 +402,30 @@ impl<'a> Formatter<'a> {
365402
(value.formatter)(value.value, self)
366403
}
367404

405+
#[cfg(stage0)] #[doc(hidden)]
406+
fn run(&mut self, piece: &rt::Piece) -> Result {
407+
match *piece {
408+
rt::String(s) => self.buf.write(s.as_bytes()),
409+
rt::Argument(ref arg) => {
410+
// Fill in the format parameters into the formatter
411+
self.fill = arg.format.fill;
412+
self.align = arg.format.align;
413+
self.flags = arg.format.flags;
414+
self.width = self.getcount(&arg.format.width);
415+
self.precision = self.getcount(&arg.format.precision);
416+
417+
// Extract the correct argument
418+
let value = match arg.position {
419+
rt::ArgumentNext => { *self.curarg.next().unwrap() }
420+
rt::ArgumentIs(i) => self.args[i],
421+
};
422+
423+
// Then actually do some printing
424+
(value.formatter)(value.value, self)
425+
}
426+
}
427+
}
428+
368429
fn getcount(&mut self, cnt: &rt::Count) -> Option<uint> {
369430
match *cnt {
370431
rt::CountIs(n) => { Some(n) }

branches/auto/src/librustc/front/feature_gate.rs

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ impl<'a> Context<'a> {
143143
}
144144
}
145145

146-
impl<'a> Visitor<()> for Context<'a> {
147-
fn visit_ident(&mut self, sp: Span, id: ast::Ident, _: ()) {
146+
impl<'a> Visitor for Context<'a> {
147+
fn visit_ident(&mut self, sp: Span, id: ast::Ident) {
148148
if !token::get_ident(id).get().is_ascii() {
149149
self.gate_feature("non_ascii_idents", sp,
150150
"non-ascii idents are not fully supported.");
151151
}
152152
}
153153

154-
fn visit_view_item(&mut self, i: &ast::ViewItem, _: ()) {
154+
fn visit_view_item(&mut self, i: &ast::ViewItem) {
155155
match i.node {
156156
ast::ViewItemUse(ref path) => {
157157
match path.node {
@@ -173,10 +173,10 @@ impl<'a> Visitor<()> for Context<'a> {
173173
}
174174
}
175175
}
176-
visit::walk_view_item(self, i, ())
176+
visit::walk_view_item(self, i)
177177
}
178178

179-
fn visit_item(&mut self, i: &ast::Item, _:()) {
179+
fn visit_item(&mut self, i: &ast::Item) {
180180
for attr in i.attrs.iter() {
181181
if attr.name().equiv(&("thread_local")) {
182182
self.gate_feature("thread_local", i.span,
@@ -252,10 +252,10 @@ impl<'a> Visitor<()> for Context<'a> {
252252
_ => {}
253253
}
254254

255-
visit::walk_item(self, i, ());
255+
visit::walk_item(self, i);
256256
}
257257

258-
fn visit_mac(&mut self, macro: &ast::Mac, _: ()) {
258+
fn visit_mac(&mut self, macro: &ast::Mac) {
259259
let ast::MacInvocTT(ref path, _, _) = macro.node;
260260
let id = path.segments.last().unwrap().identifier;
261261
let quotes = ["quote_tokens", "quote_expr", "quote_ty",
@@ -299,16 +299,16 @@ impl<'a> Visitor<()> for Context<'a> {
299299
}
300300
}
301301

302-
fn visit_foreign_item(&mut self, i: &ast::ForeignItem, _: ()) {
302+
fn visit_foreign_item(&mut self, i: &ast::ForeignItem) {
303303
if attr::contains_name(i.attrs.as_slice(), "linkage") {
304304
self.gate_feature("linkage", i.span,
305305
"the `linkage` attribute is experimental \
306306
and not portable across platforms")
307307
}
308-
visit::walk_foreign_item(self, i, ())
308+
visit::walk_foreign_item(self, i)
309309
}
310310

311-
fn visit_ty(&mut self, t: &ast::Ty, _: ()) {
311+
fn visit_ty(&mut self, t: &ast::Ty) {
312312
match t.node {
313313
ast::TyClosure(closure) if closure.onceness == ast::Once => {
314314
self.gate_feature("once_fns", t.span,
@@ -325,10 +325,10 @@ impl<'a> Visitor<()> for Context<'a> {
325325
_ => {}
326326
}
327327

328-
visit::walk_ty(self, t, ());
328+
visit::walk_ty(self, t);
329329
}
330330

331-
fn visit_expr(&mut self, e: &ast::Expr, _: ()) {
331+
fn visit_expr(&mut self, e: &ast::Expr) {
332332
match e.node {
333333
ast::ExprUnary(ast::UnBox, _) => {
334334
self.gate_box(e.span);
@@ -346,10 +346,10 @@ impl<'a> Visitor<()> for Context<'a> {
346346
}
347347
_ => {}
348348
}
349-
visit::walk_expr(self, e, ());
349+
visit::walk_expr(self, e);
350350
}
351351

352-
fn visit_generics(&mut self, generics: &ast::Generics, _: ()) {
352+
fn visit_generics(&mut self, generics: &ast::Generics) {
353353
for type_parameter in generics.ty_params.iter() {
354354
match type_parameter.default {
355355
Some(ty) => {
@@ -360,18 +360,18 @@ impl<'a> Visitor<()> for Context<'a> {
360360
None => {}
361361
}
362362
}
363-
visit::walk_generics(self, generics, ());
363+
visit::walk_generics(self, generics);
364364
}
365365

366-
fn visit_attribute(&mut self, attr: &ast::Attribute, _: ()) {
366+
fn visit_attribute(&mut self, attr: &ast::Attribute) {
367367
if attr::contains_name([*attr], "lang") {
368368
self.gate_feature("lang_items",
369369
attr.span,
370370
"language items are subject to change");
371371
}
372372
}
373373

374-
fn visit_pat(&mut self, pattern: &ast::Pat, (): ()) {
374+
fn visit_pat(&mut self, pattern: &ast::Pat) {
375375
match pattern.node {
376376
ast::PatVec(_, Some(_), ref last) if !last.is_empty() => {
377377
self.gate_feature("advanced_slice_patterns",
@@ -382,16 +382,15 @@ impl<'a> Visitor<()> for Context<'a> {
382382
}
383383
_ => {}
384384
}
385-
visit::walk_pat(self, pattern, ())
385+
visit::walk_pat(self, pattern)
386386
}
387387

388388
fn visit_fn(&mut self,
389389
fn_kind: &visit::FnKind,
390390
fn_decl: &ast::FnDecl,
391391
block: &ast::Block,
392392
span: Span,
393-
_: NodeId,
394-
(): ()) {
393+
_: NodeId) {
395394
match *fn_kind {
396395
visit::FkItemFn(_, _, _, ref abi) if *abi == RustIntrinsic => {
397396
self.gate_feature("intrinsics",
@@ -400,7 +399,7 @@ impl<'a> Visitor<()> for Context<'a> {
400399
}
401400
_ => {}
402401
}
403-
visit::walk_fn(self, fn_kind, fn_decl, block, span, ());
402+
visit::walk_fn(self, fn_kind, fn_decl, block, span);
404403
}
405404
}
406405

@@ -453,7 +452,7 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
453452
}
454453
}
455454

456-
visit::walk_crate(&mut cx, krate, ());
455+
visit::walk_crate(&mut cx, krate);
457456

458457
sess.abort_if_errors();
459458

branches/auto/src/librustc/front/show_span.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ struct ShowSpanVisitor<'a> {
2323
sess: &'a Session
2424
}
2525

26-
impl<'a> Visitor<()> for ShowSpanVisitor<'a> {
27-
fn visit_expr(&mut self, e: &ast::Expr, _: ()) {
26+
impl<'a> Visitor for ShowSpanVisitor<'a> {
27+
fn visit_expr(&mut self, e: &ast::Expr) {
2828
self.sess.span_note(e.span, "expression");
29-
visit::walk_expr(self, e, ());
29+
visit::walk_expr(self, e);
3030
}
3131

32-
fn visit_mac(&mut self, macro: &ast::Mac, e: ()) {
33-
visit::walk_mac(self, macro, e);
32+
fn visit_mac(&mut self, macro: &ast::Mac) {
33+
visit::walk_mac(self, macro);
3434
}
3535
}
3636

3737
pub fn run(sess: &Session, krate: &ast::Crate) {
3838
let mut v = ShowSpanVisitor { sess: sess };
39-
visit::walk_crate(&mut v, krate, ());
39+
visit::walk_crate(&mut v, krate);
4040
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,13 @@ impl<'a, 'tcx> CTypesVisitor<'a, 'tcx> {
366366
}
367367
}
368368

369-
impl<'a, 'tcx> Visitor<()> for CTypesVisitor<'a, 'tcx> {
370-
fn visit_ty(&mut self, ty: &ast::Ty, _: ()) {
369+
impl<'a, 'tcx> Visitor for CTypesVisitor<'a, 'tcx> {
370+
fn visit_ty(&mut self, ty: &ast::Ty) {
371371
match ty.node {
372372
ast::TyPath(_, _, id) => self.check_def(ty.span, ty.id, id),
373373
_ => (),
374374
}
375-
visit::walk_ty(self, ty, ());
375+
visit::walk_ty(self, ty);
376376
}
377377
}
378378

@@ -386,7 +386,7 @@ impl LintPass for CTypes {
386386
fn check_item(&mut self, cx: &Context, it: &ast::Item) {
387387
fn check_ty(cx: &Context, ty: &ast::Ty) {
388388
let mut vis = CTypesVisitor { cx: cx };
389-
vis.visit_ty(ty, ());
389+
vis.visit_ty(ty);
390390
}
391391

392392
fn check_foreign_fn(cx: &Context, decl: &ast::FnDecl) {
@@ -500,18 +500,18 @@ struct RawPtrDerivingVisitor<'a, 'tcx: 'a> {
500500
cx: &'a Context<'a, 'tcx>
501501
}
502502

503-
impl<'a, 'tcx> Visitor<()> for RawPtrDerivingVisitor<'a, 'tcx> {
504-
fn visit_ty(&mut self, ty: &ast::Ty, _: ()) {
503+
impl<'a, 'tcx> Visitor for RawPtrDerivingVisitor<'a, 'tcx> {
504+
fn visit_ty(&mut self, ty: &ast::Ty) {
505505
static MSG: &'static str = "use of `#[deriving]` with a raw pointer";
506506
match ty.node {
507507
ast::TyPtr(..) => self.cx.span_lint(RAW_POINTER_DERIVING, ty.span, MSG),
508508
_ => {}
509509
}
510-
visit::walk_ty(self, ty, ());
510+
visit::walk_ty(self, ty);
511511
}
512512
// explicit override to a no-op to reduce code bloat
513-
fn visit_expr(&mut self, _: &ast::Expr, _: ()) {}
514-
fn visit_block(&mut self, _: &ast::Block, _: ()) {}
513+
fn visit_expr(&mut self, _: &ast::Expr) {}
514+
fn visit_block(&mut self, _: &ast::Block) {}
515515
}
516516

517517
pub struct RawPointerDeriving {
@@ -554,7 +554,7 @@ impl LintPass for RawPointerDeriving {
554554
match item.node {
555555
ast::ItemStruct(..) | ast::ItemEnum(..) => {
556556
let mut visitor = RawPtrDerivingVisitor { cx: cx };
557-
visit::walk_item(&mut visitor, &*item, ());
557+
visit::walk_item(&mut visitor, &*item);
558558
}
559559
_ => {}
560560
}

0 commit comments

Comments
 (0)