Skip to content

Commit ffda974

Browse files
committed
---
yaml --- r: 155035 b: refs/heads/try2 c: 8780d9c h: refs/heads/master i: 155033: 5897937 155031: 07c77db v: v3
1 parent 4de2ab6 commit ffda974

Some content is hidden

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

54 files changed

+1567
-1682
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: 8e61612889233e7df26067e9d1c0ec7ffbac630c
8+
refs/heads/try2: 8780d9c6b5abce83089ca1dafb7efd178569a052
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ def unpack_snapshot(triple, dl_path):
5252
if len(sys.argv) == 3:
5353
dl_path = sys.argv[2]
5454
else:
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)
55+
snap = determine_curr_snapshot(triple)
5856
dl = os.path.join(download_dir_base, snap)
5957
url = download_url_base + "/" + snap
6058
print("determined most recent snapshot: " + snap)

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

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ 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))]
117116
#[doc(hidden)] #[inline]
118117
pub unsafe fn new<'a>(pieces: &'static [&'static str],
119118
args: &'a [Argument<'a>]) -> Arguments<'a> {
@@ -127,7 +126,6 @@ impl<'a> Arguments<'a> {
127126
/// This function is used to specify nonstandard formatting parameters.
128127
/// The `pieces` array must be at least as long as `fmt` to construct
129128
/// a valid Arguments structure.
130-
#[cfg(not(stage0))]
131129
#[doc(hidden)] #[inline]
132130
pub unsafe fn with_placeholders<'a>(pieces: &'static [&'static str],
133131
fmt: &'static [rt::Argument<'static>],
@@ -138,13 +136,6 @@ impl<'a> Arguments<'a> {
138136
args: args
139137
}
140138
}
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-
}
148139
}
149140

150141
/// This structure represents a safely precompiled version of a format string
@@ -156,7 +147,6 @@ impl<'a> Arguments<'a> {
156147
/// and pass it to a function or closure, passed as the first argument. The
157148
/// macro validates the format string at compile-time so usage of the `write`
158149
/// and `format` functions can be safely performed.
159-
#[cfg(not(stage0))]
160150
pub struct Arguments<'a> {
161151
// Format string pieces to print.
162152
pieces: &'a [&'a str],
@@ -169,12 +159,6 @@ pub struct Arguments<'a> {
169159
args: &'a [Argument<'a>],
170160
}
171161

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

299-
#[cfg(not(stage0))]
300283
static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
301284
position: rt::ArgumentNext,
302285
format: rt::FormatSpec {
@@ -316,7 +299,6 @@ static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
316299
///
317300
/// * output - the buffer to write output to
318301
/// * args - the precompiled arguments generated by `format_args!`
319-
#[cfg(not(stage0))]
320302
pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
321303
let mut formatter = Formatter {
322304
flags: 0,
@@ -360,30 +342,11 @@ pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
360342
Ok(())
361343
}
362344

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-
381345
impl<'a> Formatter<'a> {
382346

383347
// First up is the collection of functions used to execute a format string
384348
// at runtime. This consumes all of the compile-time statics generated by
385349
// the format! syntax extension.
386-
#[cfg(not(stage0))]
387350
fn run(&mut self, arg: &rt::Argument) -> Result {
388351
// Fill in the format parameters into the formatter
389352
self.fill = arg.format.fill;
@@ -402,30 +365,6 @@ impl<'a> Formatter<'a> {
402365
(value.formatter)(value.value, self)
403366
}
404367

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-
429368
fn getcount(&mut self, cnt: &rt::Count) -> Option<uint> {
430369
match *cnt {
431370
rt::CountIs(n) => { Some(n) }
@@ -476,7 +415,7 @@ impl<'a> Formatter<'a> {
476415

477416
let mut prefixed = false;
478417
if self.flags & (1 << (FlagAlternate as uint)) != 0 {
479-
prefixed = true; width += prefix.len();
418+
prefixed = true; width += prefix.char_len();
480419
}
481420

482421
// Writes the sign if it exists, and then the prefix if it was requested
@@ -562,7 +501,7 @@ impl<'a> Formatter<'a> {
562501
// If we're under both the maximum and the minimum width, then fill
563502
// up the minimum width with the specified string + some alignment.
564503
Some(width) => {
565-
self.with_padding(width - s.len(), rt::AlignLeft, |me| {
504+
self.with_padding(width - s.char_len(), rt::AlignLeft, |me| {
566505
me.buf.write(s.as_bytes())
567506
})
568507
}

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

Lines changed: 26 additions & 27 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, 'v> Visitor<'v> 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,25 +382,24 @@ 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,
389-
fn_kind: &visit::FnKind,
390-
fn_decl: &ast::FnDecl,
391-
block: &ast::Block,
389+
fn_kind: visit::FnKind<'v>,
390+
fn_decl: &'v ast::FnDecl,
391+
block: &'v ast::Block,
392392
span: Span,
393-
_: NodeId,
394-
(): ()) {
395-
match *fn_kind {
396-
visit::FkItemFn(_, _, _, ref abi) if *abi == RustIntrinsic => {
393+
_: NodeId) {
394+
match fn_kind {
395+
visit::FkItemFn(_, _, _, abi) if abi == RustIntrinsic => {
397396
self.gate_feature("intrinsics",
398397
span,
399398
"intrinsics are subject to change")
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/try2/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, 'v> Visitor<'v> 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
}

0 commit comments

Comments
 (0)