auto merge of #11333 : cmr/rust/triage2, r=alexcrichton
This commit is contained in:
commit
8b71b6415d
12 changed files with 95 additions and 44 deletions
|
@ -32,40 +32,6 @@ def unpack_snapshot(triple, dl_path):
|
|||
tar.close()
|
||||
shutil.rmtree(download_unpack_base)
|
||||
|
||||
def determine_curr_snapshot(triple):
|
||||
i = 0
|
||||
platform = get_platform(triple)
|
||||
|
||||
found_file = False
|
||||
found_snap = False
|
||||
hsh = None
|
||||
date = None
|
||||
rev = None
|
||||
|
||||
f = open(snapshotfile)
|
||||
for line in f.readlines():
|
||||
i += 1
|
||||
parsed = parse_line(i, line)
|
||||
if (not parsed): continue
|
||||
|
||||
if found_snap and parsed["type"] == "file":
|
||||
if parsed["platform"] == platform:
|
||||
hsh = parsed["hash"]
|
||||
found_file = True
|
||||
break;
|
||||
elif parsed["type"] == "snapshot":
|
||||
date = parsed["date"]
|
||||
rev = parsed["rev"]
|
||||
found_snap = True
|
||||
|
||||
if not found_snap:
|
||||
raise Exception("no snapshot entries in file")
|
||||
|
||||
if not found_file:
|
||||
raise Exception("no snapshot file found for platform %s, rev %s" %
|
||||
(platform, rev))
|
||||
|
||||
return full_snapshot_name(date, rev, platform, hsh)
|
||||
|
||||
# Main
|
||||
|
||||
|
|
|
@ -194,3 +194,41 @@ def make_snapshot(stage, triple):
|
|||
shutil.move(file0, file1)
|
||||
|
||||
return file1
|
||||
|
||||
def determine_curr_snapshot_info(triple):
|
||||
i = 0
|
||||
platform = get_platform(triple)
|
||||
|
||||
found_file = False
|
||||
found_snap = False
|
||||
hsh = None
|
||||
date = None
|
||||
rev = None
|
||||
|
||||
f = open(snapshotfile)
|
||||
for line in f.readlines():
|
||||
i += 1
|
||||
parsed = parse_line(i, line)
|
||||
if (not parsed): continue
|
||||
|
||||
if found_snap and parsed["type"] == "file":
|
||||
if parsed["platform"] == platform:
|
||||
hsh = parsed["hash"]
|
||||
found_file = True
|
||||
break;
|
||||
elif parsed["type"] == "snapshot":
|
||||
date = parsed["date"]
|
||||
rev = parsed["rev"]
|
||||
found_snap = True
|
||||
|
||||
if not found_snap:
|
||||
raise Exception("no snapshot entries in file")
|
||||
|
||||
if not found_file:
|
||||
raise Exception("no snapshot file found for platform %s, rev %s" %
|
||||
(platform, rev))
|
||||
|
||||
return (date, rev, platform, hsh)
|
||||
|
||||
def determine_curr_snapshot(triple):
|
||||
return full_snapshot_name(*determine_curr_snapshot_info(triple))
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import sys, fileinput, subprocess, re
|
||||
from licenseck import *
|
||||
import snapshot
|
||||
|
||||
err=0
|
||||
cols=100
|
||||
|
@ -51,7 +52,19 @@ try:
|
|||
report_err("TODO is deprecated; use FIXME")
|
||||
match = re.match(r'^.*//\s*(NOTE.*)$', line)
|
||||
if match:
|
||||
report_warn(match.group(1))
|
||||
m = match.group(1)
|
||||
if "snap" in m.lower():
|
||||
report_warn(match.group(1))
|
||||
match = re.match(r'^.*//\s*SNAP\s+(\w+)', line)
|
||||
if match:
|
||||
hsh = match.group(1)
|
||||
a, b, c, phash = snapshot.determine_curr_snapshot_info()
|
||||
if not phash.startswith(hsh):
|
||||
report_err("Snapshot out of date: " + line)
|
||||
else:
|
||||
if "SNAP" in line:
|
||||
report_warn("Unmatched SNAP line: " + line)
|
||||
|
||||
if (line.find('\t') != -1 and
|
||||
fileinput.filename().find("Makefile") == -1):
|
||||
report_err("tab character")
|
||||
|
|
|
@ -1522,6 +1522,9 @@ mod tests {
|
|||
optmulti("l")
|
||||
];
|
||||
|
||||
// short and verbose should always be in the same order. if they
|
||||
// aren't the test will fail (and in mysterious ways)
|
||||
|
||||
let verbose = ~[
|
||||
groups::reqopt("b", "banana", "Desc", "VAL"),
|
||||
groups::optopt("a", "apple", "Desc", "VAL"),
|
||||
|
@ -1533,7 +1536,6 @@ mod tests {
|
|||
let sample_args = ~[~"--kiwi", ~"15", ~"--apple", ~"1", ~"k",
|
||||
~"-p", ~"16", ~"l", ~"35"];
|
||||
|
||||
// FIXME #4681: sort options here?
|
||||
assert!(getopts(sample_args, short)
|
||||
== groups::getopts(sample_args, verbose));
|
||||
}
|
||||
|
|
|
@ -673,7 +673,6 @@ fn specialize(cx: &MatchCheckCtxt,
|
|||
|
||||
DefFn(..) |
|
||||
DefStruct(..) => {
|
||||
// FIXME #4731: Is this right? --pcw
|
||||
let new_args;
|
||||
match args {
|
||||
Some(args) => new_args = args,
|
||||
|
|
|
@ -577,6 +577,7 @@ mod tests {
|
|||
#[test] #[should_fail]
|
||||
fn test_ascii_fail_char_slice() { 'λ'.to_ascii(); }
|
||||
|
||||
#[test]
|
||||
fn test_opt() {
|
||||
assert_eq!(65u8.to_ascii_opt(), Some(Ascii { chr: 65u8 }));
|
||||
assert_eq!(255u8.to_ascii_opt(), None);
|
||||
|
|
|
@ -99,9 +99,8 @@ impl Writer for UdpStream {
|
|||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use io::net::ip::{Ipv4Addr, SocketAddr};
|
||||
use io::net::ip::{SocketAddr};
|
||||
use io::*;
|
||||
use io::test::*;
|
||||
use prelude::*;
|
||||
|
||||
iotest!(fn bind_error() {
|
||||
|
|
|
@ -163,6 +163,7 @@ pub mod sync;
|
|||
|
||||
/* Runtime and platform support */
|
||||
|
||||
#[unstable]
|
||||
pub mod libc;
|
||||
pub mod c_str;
|
||||
pub mod os;
|
||||
|
@ -172,9 +173,8 @@ pub mod rand;
|
|||
pub mod run;
|
||||
pub mod cast;
|
||||
pub mod fmt;
|
||||
pub mod repr;
|
||||
pub mod cleanup;
|
||||
pub mod reflect;
|
||||
#[deprecated]
|
||||
pub mod condition;
|
||||
pub mod logging;
|
||||
pub mod util;
|
||||
|
@ -183,7 +183,13 @@ pub mod mem;
|
|||
|
||||
/* Unsupported interfaces */
|
||||
|
||||
#[unstable]
|
||||
pub mod repr;
|
||||
#[unstable]
|
||||
pub mod reflect;
|
||||
|
||||
// Private APIs
|
||||
#[unstable]
|
||||
pub mod unstable;
|
||||
|
||||
|
||||
|
@ -195,6 +201,7 @@ mod cmath;
|
|||
|
||||
// FIXME #7809: This shouldn't be pub, and it should be reexported under 'unstable'
|
||||
// but name resolution doesn't work without it being pub.
|
||||
#[unstable]
|
||||
pub mod rt;
|
||||
|
||||
// A curious inner-module that's not exported that contains the binding
|
||||
|
|
|
@ -54,7 +54,6 @@ mod test {
|
|||
use unstable::run_in_bare_thread;
|
||||
use super::*;
|
||||
use rt::task::Task;
|
||||
use rt::local_ptr;
|
||||
|
||||
#[test]
|
||||
fn thread_local_task_smoke_test() {
|
||||
|
|
23
src/test/compile-fail/struct-pattern-match-useless.rs
Normal file
23
src/test/compile-fail/struct-pattern-match-useless.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
struct Foo {
|
||||
x: int,
|
||||
y: int,
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let a = Foo { x: 1, y: 2 };
|
||||
match a {
|
||||
Foo { x: x, y: y } => (),
|
||||
Foo { .. } => () //~ ERROR unreachable pattern
|
||||
}
|
||||
|
||||
}
|
|
@ -65,7 +65,7 @@ impl TyVisitor for MyVisitor {
|
|||
fn visit_estr_uniq(&mut self) -> bool { true }
|
||||
fn visit_estr_slice(&mut self) -> bool { true }
|
||||
fn visit_estr_fixed(&mut self,
|
||||
_sz: uint, _sz: uint,
|
||||
_sz: uint, _sz2: uint,
|
||||
_align: uint) -> bool { true }
|
||||
|
||||
fn visit_box(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool { true }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
@ -18,4 +18,8 @@ pub fn main() {
|
|||
match a {
|
||||
Foo { x: x, y: y } => println!("yes, {}, {}", x, y)
|
||||
}
|
||||
|
||||
match a {
|
||||
Foo { .. } => ()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue