Register snapshots

This commit is contained in:
Brian Anderson 2014-09-10 15:31:30 -07:00
parent 9f6d27c39f
commit 38e7e4bd9c
3 changed files with 10 additions and 64 deletions

View File

@ -52,9 +52,7 @@ triple = sys.argv[1]
if len(sys.argv) == 3:
dl_path = sys.argv[2]
else:
# There are no 64-bit Windows snapshots yet, so we'll use 32-bit ones instead, for now
snap_triple = triple if triple != "x86_64-w64-mingw32" else "i686-w64-mingw32"
snap = determine_curr_snapshot(snap_triple)
snap = determine_curr_snapshot(triple)
dl = os.path.join(download_dir_base, snap)
url = download_url_base + "/" + snap
print("determined most recent snapshot: " + snap)

View File

@ -113,7 +113,6 @@ impl<'a> Arguments<'a> {
/// Arguments structure. The compiler inserts an `unsafe` block to call this,
/// which is valid because the compiler performs all necessary validation to
/// ensure that the resulting call to format/write would be safe.
#[cfg(not(stage0))]
#[doc(hidden)] #[inline]
pub unsafe fn new<'a>(pieces: &'static [&'static str],
args: &'a [Argument<'a>]) -> Arguments<'a> {
@ -127,7 +126,6 @@ impl<'a> Arguments<'a> {
/// This function is used to specify nonstandard formatting parameters.
/// The `pieces` array must be at least as long as `fmt` to construct
/// a valid Arguments structure.
#[cfg(not(stage0))]
#[doc(hidden)] #[inline]
pub unsafe fn with_placeholders<'a>(pieces: &'static [&'static str],
fmt: &'static [rt::Argument<'static>],
@ -138,13 +136,6 @@ impl<'a> Arguments<'a> {
args: args
}
}
#[cfg(stage0)]
#[doc(hidden)] #[inline]
pub unsafe fn new<'a>(fmt: &'static [rt::Piece<'static>],
args: &'a [Argument<'a>]) -> Arguments<'a> {
Arguments{ fmt: mem::transmute(fmt), args: args }
}
}
/// This structure represents a safely precompiled version of a format string
@ -156,7 +147,6 @@ impl<'a> Arguments<'a> {
/// and pass it to a function or closure, passed as the first argument. The
/// macro validates the format string at compile-time so usage of the `write`
/// and `format` functions can be safely performed.
#[cfg(not(stage0))]
pub struct Arguments<'a> {
// Format string pieces to print.
pieces: &'a [&'a str],
@ -169,12 +159,6 @@ pub struct Arguments<'a> {
args: &'a [Argument<'a>],
}
#[cfg(stage0)] #[doc(hidden)]
pub struct Arguments<'a> {
fmt: &'a [rt::Piece<'a>],
args: &'a [Argument<'a>],
}
impl<'a> Show for Arguments<'a> {
fn fmt(&self, fmt: &mut Formatter) -> Result {
write(fmt.buf, self)
@ -296,7 +280,6 @@ uniform_fn_call_workaround! {
secret_upper_exp, UpperExp;
}
#[cfg(not(stage0))]
static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
position: rt::ArgumentNext,
format: rt::FormatSpec {
@ -316,7 +299,6 @@ static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
///
/// * output - the buffer to write output to
/// * args - the precompiled arguments generated by `format_args!`
#[cfg(not(stage0))]
pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
let mut formatter = Formatter {
flags: 0,
@ -360,30 +342,11 @@ pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
Ok(())
}
#[cfg(stage0)] #[doc(hidden)]
pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
let mut formatter = Formatter {
flags: 0,
width: None,
precision: None,
buf: output,
align: rt::AlignUnknown,
fill: ' ',
args: args.args,
curarg: args.args.iter(),
};
for piece in args.fmt.iter() {
try!(formatter.run(piece));
}
Ok(())
}
impl<'a> Formatter<'a> {
// First up is the collection of functions used to execute a format string
// at runtime. This consumes all of the compile-time statics generated by
// the format! syntax extension.
#[cfg(not(stage0))]
fn run(&mut self, arg: &rt::Argument) -> Result {
// Fill in the format parameters into the formatter
self.fill = arg.format.fill;
@ -402,30 +365,6 @@ impl<'a> Formatter<'a> {
(value.formatter)(value.value, self)
}
#[cfg(stage0)] #[doc(hidden)]
fn run(&mut self, piece: &rt::Piece) -> Result {
match *piece {
rt::String(s) => self.buf.write(s.as_bytes()),
rt::Argument(ref arg) => {
// Fill in the format parameters into the formatter
self.fill = arg.format.fill;
self.align = arg.format.align;
self.flags = arg.format.flags;
self.width = self.getcount(&arg.format.width);
self.precision = self.getcount(&arg.format.precision);
// Extract the correct argument
let value = match arg.position {
rt::ArgumentNext => { *self.curarg.next().unwrap() }
rt::ArgumentIs(i) => self.args[i],
};
// Then actually do some printing
(value.formatter)(value.value, self)
}
}
}
fn getcount(&mut self, cnt: &rt::Count) -> Option<uint> {
match *cnt {
rt::CountIs(n) => { Some(n) }

View File

@ -1,3 +1,12 @@
S 2014-09-10 6faa4f3
winnt-x86_64 939eb546469cb936441cff3b6f2478f562f77c46
winnt-i386 cfe4f8b519bb9d62588f9310a8f94bc919d5423b
linux-x86_64 72c92895fa9a1dba7880073f2b2b5d0e3e1a2ab6
linux-i386 6f5464c9ab191d93bfea0894ca7c6f90c3506f2b
freebsd-x86_64 648f35800ba98f1121d418b6d0c13c63b7a8951b
macos-i386 545fc45a0071142714639c6be377e6d308c3a4e1
macos-x86_64 8b44fbbbd1ba519d2e83d0d5ce1f6053d3cab8c6
S 2014-09-05 67b97ab
freebsd-x86_64 5ed208394cb2a378ddfaa005b6298d2f142ad47f
linux-i386 d90866947bfa09738cf8540d17a8eedc70988fcc