summaryrefslogtreecommitdiffstats
path: root/src/test/ui/missing/missing-stability.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/missing/missing-stability.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/missing/missing-stability.rs b/src/test/ui/missing/missing-stability.rs
new file mode 100644
index 000000000..0da5808b4
--- /dev/null
+++ b/src/test/ui/missing/missing-stability.rs
@@ -0,0 +1,24 @@
+// Checks that exported items without stability attributes cause an error
+
+#![crate_type="lib"]
+#![feature(staged_api)]
+
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
+
+pub fn unmarked() {
+ //~^ ERROR function has missing stability attribute
+ ()
+}
+
+#[unstable(feature = "unstable_test_feature", issue = "none")]
+pub mod foo {
+ // #[unstable] is inherited
+ pub fn unmarked() {}
+}
+
+#[stable(feature = "stable_test_feature", since="1.0.0")]
+pub mod bar {
+ // #[stable] is not inherited
+ pub fn unmarked() {}
+ //~^ ERROR function has missing stability attribute
+}