Skip to content

Commit 7a19a82

Browse files
committed
auto merge of #13811 : alexcrichton/rust/closed-issues, r=sfackler
Closes #5518 Closes #7320 Closes #8391 Closes #8827 Closes #8983 Closes #10683 Closes #10802 Closes #11515
2 parents 4e55bc7 + 35f295d commit 7a19a82

File tree

9 files changed

+214
-0
lines changed

9 files changed

+214
-0
lines changed

src/test/auxiliary/issue-5518.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2012-2014 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+
trait A<'a, T> {
12+
fn f(&mut self) -> &'a mut T;
13+
fn p() -> T;
14+
}

src/test/compile-fail/issue-11515.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2014 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+
struct Test<'s> {
12+
func: ||: 's,
13+
}
14+
15+
fn main() {
16+
let test = ~Test { func: proc() {} };
17+
//~^ ERROR: expected `||` but found `proc()`
18+
}

src/test/run-pass/issue-10683.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2014 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::ascii::StrAsciiExt;
12+
13+
static NAME: &'static str = "hello world";
14+
15+
fn main() {
16+
match NAME.to_ascii_lower().as_slice() {
17+
"foo" => {}
18+
_ => {}
19+
}
20+
}

src/test/run-pass/issue-10802.rs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2014 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+
struct DroppableStruct;
12+
13+
static mut DROPPED: bool = false;
14+
15+
impl Drop for DroppableStruct {
16+
fn drop(&mut self) {
17+
unsafe { DROPPED = true; }
18+
}
19+
}
20+
21+
trait MyTrait { }
22+
impl MyTrait for ~DroppableStruct {}
23+
24+
struct Whatever { w: ~MyTrait }
25+
impl Whatever {
26+
fn new(w: ~MyTrait) -> Whatever {
27+
Whatever { w: w }
28+
}
29+
}
30+
31+
fn main() {
32+
{
33+
let f = ~DroppableStruct;
34+
let _a = Whatever::new(~f as ~MyTrait);
35+
}
36+
assert!(unsafe { DROPPED });
37+
}

src/test/run-pass/issue-5518.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2012-2014 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+
// aux-build:issue-5518.rs
12+
13+
extern crate other = "issue-5518";
14+
15+
fn main() {}

src/test/run-pass/issue-7320.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2014 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+
trait Foo {
12+
fn foo(~self) { bar(self as ~Foo); }
13+
}
14+
15+
fn bar(_b: ~Foo) { }
16+
17+
fn main() {}

src/test/run-pass/issue-8391.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2014 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+
fn main() {
12+
let _x = match Some(1) {
13+
_y @ Some(_) => 1,
14+
None => 2,
15+
};
16+
}

src/test/run-pass/issue-8827.rs

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright 2014 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+
fn periodical(n: int) -> Receiver<bool> {
12+
let (chan, port) = channel();
13+
spawn(proc() {
14+
loop {
15+
for _ in range(1, n) {
16+
match chan.send_opt(false) {
17+
Ok(()) => {}
18+
Err(..) => break,
19+
}
20+
}
21+
match chan.send_opt(true) {
22+
Ok(()) => {}
23+
Err(..) => break
24+
}
25+
}
26+
});
27+
return port;
28+
}
29+
30+
fn integers() -> Receiver<int> {
31+
let (chan, port) = channel();
32+
spawn(proc() {
33+
let mut i = 1;
34+
loop {
35+
match chan.send_opt(i) {
36+
Ok(()) => {}
37+
Err(..) => break,
38+
}
39+
i = i + 1;
40+
}
41+
});
42+
return port;
43+
}
44+
45+
fn main() {
46+
let ints = integers();
47+
let threes = periodical(3);
48+
let fives = periodical(5);
49+
for _ in range(1, 100) {
50+
match (ints.recv(), threes.recv(), fives.recv()) {
51+
(_, true, true) => println!("FizzBuzz"),
52+
(_, true, false) => println!("Fizz"),
53+
(_, false, true) => println!("Buzz"),
54+
(i, false, false) => println!("{}", i)
55+
}
56+
}
57+
}
58+

src/test/run-pass/issue-8983.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2014 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+
#![feature(managed_boxes)]
12+
13+
fn main() {
14+
fn f(_: proc()) {}
15+
fn eat<T>(_: T) {}
16+
17+
let x = @1;
18+
f(proc() { eat(x) });
19+
}

0 commit comments

Comments
 (0)