Skip to content

Commit 8a1dda9

Browse files
committed
Adding tests for closed issues
Closes #5521 Closes #9396 Closes #10714
1 parent 62caad2 commit 8a1dda9

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

src/test/auxiliary/issue-5521.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
use std::hashmap::HashMap;
14+
15+
pub type map = @HashMap<uint, uint>;

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

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
enum v {}
12+
pub fn main() {
13+
let y: v = unsafe { ::std::unstable::intrinsics::uninit() };
14+
}

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

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
// aux-build:issue-5521.rs
12+
// xfail-fast
13+
14+
#[feature(managed_boxes)];
15+
16+
extern mod foo = "issue-5521";
17+
18+
fn foo(a: foo::map) {
19+
if false {
20+
fail!();
21+
} else {
22+
let _b = a.get(&2);
23+
}
24+
}
25+
26+
fn main() {}

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

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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::comm;
12+
use std::io::timer::Timer;
13+
14+
pub fn main() {
15+
let (port, chan) = Chan::new();
16+
spawn(proc (){
17+
let mut timer = Timer::new().unwrap();
18+
timer.sleep(10);
19+
chan.send(());
20+
});
21+
loop {
22+
match port.try_recv() {
23+
comm::Data(()) => break,
24+
comm::Empty => {}
25+
comm::Disconnected => unreachable!()
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)