]> git.lizzy.rs Git - rust.git/commitdiff
Add a test for #5844 (a closed issue now)
authorAlex Crichton <alex@alexcrichton.com>
Tue, 23 Jul 2013 04:48:41 +0000 (21:48 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 23 Jul 2013 06:09:21 +0000 (23:09 -0700)
src/test/auxiliary/issue_5844_aux.rs [new file with mode: 0644]
src/test/compile-fail/issue-5844.rs [new file with mode: 0644]

diff --git a/src/test/auxiliary/issue_5844_aux.rs b/src/test/auxiliary/issue_5844_aux.rs
new file mode 100644 (file)
index 0000000..78e87f3
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+use std::libc;
+
+extern "C" {
+    pub fn rand() -> libc::c_int;
+}
+
diff --git a/src/test/compile-fail/issue-5844.rs b/src/test/compile-fail/issue-5844.rs
new file mode 100644 (file)
index 0000000..9d4c3cf
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+//aux-build:issue_5844_aux.rs
+
+extern mod issue_5844_aux;
+
+fn main () {
+    issue_5844_aux::rand(); //~ ERROR: requires unsafe
+}
+