about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-22 04:21:59 -0700
committerGitHub <noreply@github.com>2016-06-22 04:21:59 -0700
commite41cdabc3e5fff02abfef513d3289370fae358b8 (patch)
tree8c8de5f65c6796c558fd1a8d0f96031bc280499b /src/test
parent3ee3267af39aa95fed707c67acb656845eb8f365 (diff)
parentc749a3e4b588ccc46d34e0c7b40a1e9a2f374c5b (diff)
downloadrust-e41cdabc3e5fff02abfef513d3289370fae358b8.tar.gz
rust-e41cdabc3e5fff02abfef513d3289370fae358b8.zip
Auto merge of #34408 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #34190, #34363, #34367, #34383, #34387, #34394, #34404
- Failed merges:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-23281.rs20
-rw-r--r--src/test/run-pass/const-byte-str-cast.rs15
-rw-r--r--src/test/run-pass/sleep.rs25
-rw-r--r--src/test/rustdoc/auxiliary/issue-34274.rs13
-rw-r--r--src/test/rustdoc/auxiliary/src-links-external.rs11
-rw-r--r--src/test/rustdoc/issue-34274.rs20
-rw-r--r--src/test/rustdoc/src-links-external.rs22
7 files changed, 126 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-23281.rs b/src/test/compile-fail/issue-23281.rs
new file mode 100644
index 00000000000..5feeb36b1e4
--- /dev/null
+++ b/src/test/compile-fail/issue-23281.rs
@@ -0,0 +1,20 @@
+// Copyright 2016 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.
+
+// ignore-tidy-linelength
+
+pub struct Struct;
+
+impl Struct {
+    pub fn function(funs: Vec<Fn() -> ()>) {}
+    //~^ ERROR the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied
+}
+
+fn main() {}
diff --git a/src/test/run-pass/const-byte-str-cast.rs b/src/test/run-pass/const-byte-str-cast.rs
new file mode 100644
index 00000000000..2f265b9112b
--- /dev/null
+++ b/src/test/run-pass/const-byte-str-cast.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+#[deny(warnings)]
+
+pub fn main() {
+    let _ = b"x" as &[u8];
+}
diff --git a/src/test/run-pass/sleep.rs b/src/test/run-pass/sleep.rs
new file mode 100644
index 00000000000..8b06b02f3cb
--- /dev/null
+++ b/src/test/run-pass/sleep.rs
@@ -0,0 +1,25 @@
+// Copyright 2016 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.
+
+use std::thread::{self, sleep};
+use std::time::Duration;
+use std::sync::{Arc, Mutex};
+use std::u64;
+
+fn main() {
+    let finished = Arc::new(Mutex::new(false));
+    let t_finished = finished.clone();
+    thread::spawn(move || {
+        sleep(Duration::new(u64::MAX, 0));
+        *t_finished.lock().unwrap() = true;
+    });
+    sleep(Duration::from_millis(100));
+    assert_eq!(*finished.lock().unwrap(), false);
+}
diff --git a/src/test/rustdoc/auxiliary/issue-34274.rs b/src/test/rustdoc/auxiliary/issue-34274.rs
new file mode 100644
index 00000000000..72026b60856
--- /dev/null
+++ b/src/test/rustdoc/auxiliary/issue-34274.rs
@@ -0,0 +1,13 @@
+// Copyright 2016 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.
+
+extern {
+    pub fn extern_c_fn();
+}
diff --git a/src/test/rustdoc/auxiliary/src-links-external.rs b/src/test/rustdoc/auxiliary/src-links-external.rs
new file mode 100644
index 00000000000..94b7278e990
--- /dev/null
+++ b/src/test/rustdoc/auxiliary/src-links-external.rs
@@ -0,0 +1,11 @@
+// Copyright 2016 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.
+
+pub struct Foo;
diff --git a/src/test/rustdoc/issue-34274.rs b/src/test/rustdoc/issue-34274.rs
new file mode 100644
index 00000000000..971c89b1619
--- /dev/null
+++ b/src/test/rustdoc/issue-34274.rs
@@ -0,0 +1,20 @@
+// Copyright 2016 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.
+
+// aux-build:issue-34274.rs
+// build-aux-docs
+// ignore-cross-compile
+
+#![crate_name = "foo"]
+
+extern crate issue_34274;
+
+// @has foo/fn.extern_c_fn.html '//a/@href' '../issue_34274/fn.extern_c_fn.html?gotosrc='
+pub use issue_34274::extern_c_fn;
diff --git a/src/test/rustdoc/src-links-external.rs b/src/test/rustdoc/src-links-external.rs
new file mode 100644
index 00000000000..e9db4f519ed
--- /dev/null
+++ b/src/test/rustdoc/src-links-external.rs
@@ -0,0 +1,22 @@
+// Copyright 2016 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.
+
+// aux-build:src-links-external.rs
+// build-aux-docs
+// ignore-cross-compile
+
+#![crate_name = "foo"]
+
+extern crate src_links_external;
+
+// @has foo/bar/index.html '//a/@href' '../src_links_external/index.html?gotosrc='
+pub use src_links_external as bar;
+
+// @has foo/bar/struct.Foo.html '//a/@href' '../src_links_external/struct.Foo.html?gotosrc='