]> git.lizzy.rs Git - rust.git/commitdiff
Add test for the feature gating of naked
authorTicki <Ticki@users.noreply.github.com>
Tue, 22 Mar 2016 13:08:56 +0000 (14:08 +0100)
committerTicki <Ticki@users.noreply.github.com>
Tue, 22 Mar 2016 14:00:26 +0000 (15:00 +0100)
src/test/compile-fail/gated-naked_functions.rs [new file with mode: 0644]

diff --git a/src/test/compile-fail/gated-naked_functions.rs b/src/test/compile-fail/gated-naked_functions.rs
new file mode 100644 (file)
index 0000000..ceb475e
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2015 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.
+
+#[naked]
+//~^ the `#[naked]` attribute is an experimental feature
+fn naked() {}
+
+#[naked]
+//~^ the `#[naked]` attribute is an experimental feature
+fn naked_2() -> isize {
+    0
+}