From 5c6069141b10f41e2478c335fd4c546e27cc4ce4 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 22 Jul 2013 21:48:41 -0700 Subject: [PATCH] Add a test for #5844 (a closed issue now) --- src/test/auxiliary/issue_5844_aux.rs | 16 ++++++++++++++++ src/test/compile-fail/issue-5844.rs | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/test/auxiliary/issue_5844_aux.rs create mode 100644 src/test/compile-fail/issue-5844.rs diff --git a/src/test/auxiliary/issue_5844_aux.rs b/src/test/auxiliary/issue_5844_aux.rs new file mode 100644 index 00000000000..78e87f32b79 --- /dev/null +++ b/src/test/auxiliary/issue_5844_aux.rs @@ -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 or the MIT license +// , 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 index 00000000000..9d4c3cfa678 --- /dev/null +++ b/src/test/compile-fail/issue-5844.rs @@ -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 or the MIT license +// , 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 +} + -- 2.44.0