Skip to content

Commit 3f6a9ed

Browse files
committed
---
yaml --- r: 95214 b: refs/heads/dist-snap c: 310c0e3 h: refs/heads/master v: v3
1 parent 8058980 commit 3f6a9ed

File tree

6 files changed

+74
-4
lines changed

6 files changed

+74
-4
lines changed

[refs]

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

branches/dist-snap/src/libextra/time.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,8 @@ pub fn strptime(s: &str, format: &str) -> Result<Tm, ~str> {
600600
None => Err(~"Invalid day of week")
601601
}
602602
}
603+
//'X' {}
604+
//'x' {}
603605
'Y' => {
604606
match match_digits(s, pos, 4u, false) {
605607
Some(item) => {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3054,7 +3054,8 @@ pub fn check_block_with_expected(fcx: @mut FnCtxt,
30543054
},
30553055
Some(e) => {
30563056
if any_bot && !warned {
3057-
fcx.ccx.tcx.sess.span_warn(e.span, "unreachable expression");
3057+
fcx.ccx.tcx.sess.add_lint(unreachable_code, e.id, e.span,
3058+
~"unreachable expression");
30583059
}
30593060
check_expr_with_opt_hint(fcx, e, expected);
30603061
let ety = fcx.expr_ty(e);

branches/dist-snap/src/test/compile-fail/issue-2149.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ impl<A> vec_monad<A> for ~[A] {
1616
fn bind<B>(&self, f: &fn(A) -> ~[B]) {
1717
let mut r = fail2!();
1818
for elt in self.iter() { r = r + f(*elt); }
19-
//~^ WARNING unreachable expression
20-
//~^^ ERROR the type of this value must be known
19+
//~^ ERROR the type of this value must be known
2120
}
2221
}
2322
fn main() {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[deny(unreachable_code)];
12+
use std::ptr;
13+
pub unsafe fn g() {
14+
return;
15+
if *ptr::null() {}; //~ ERROR unreachable
16+
}
17+
18+
pub fn main() {}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::io;
12+
13+
pub struct PkgId {
14+
local_path: ~str,
15+
junk: ~str
16+
}
17+
18+
impl PkgId {
19+
fn new(s: &str) -> PkgId {
20+
PkgId {
21+
local_path: s.to_owned(),
22+
junk: ~"wutevs"
23+
}
24+
}
25+
}
26+
27+
pub fn remove_package_from_database() {
28+
let mut lines_to_use: ~[&PkgId] = ~[]; //~ ERROR cannot infer an appropriate lifetime
29+
let push_id = |installed_id: &PkgId| {
30+
lines_to_use.push(installed_id);
31+
};
32+
list_database(push_id);
33+
34+
for l in lines_to_use.iter() {
35+
io::stdout().write_line(l.local_path);
36+
}
37+
38+
}
39+
40+
pub fn list_database(f: &fn(&PkgId)) {
41+
let stuff = ["foo", "bar"];
42+
43+
for l in stuff.iter() {
44+
f(&PkgId::new(*l));
45+
}
46+
}
47+
48+
pub fn main() {
49+
remove_package_from_database();
50+
}

0 commit comments

Comments
 (0)