about summary refs log tree commit diff
path: root/tests/ui/unstable-feature-bound/unstable-impl-multiple-symbol.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/unstable-feature-bound/unstable-impl-multiple-symbol.rs')
-rw-r--r--tests/ui/unstable-feature-bound/unstable-impl-multiple-symbol.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/unstable-feature-bound/unstable-impl-multiple-symbol.rs b/tests/ui/unstable-feature-bound/unstable-impl-multiple-symbol.rs
new file mode 100644
index 00000000000..c9a9029b0a0
--- /dev/null
+++ b/tests/ui/unstable-feature-bound/unstable-impl-multiple-symbol.rs
@@ -0,0 +1,27 @@
+//@ check-pass
+
+#![allow(internal_features)]
+#![feature(staged_api)]
+#![allow(dead_code)]
+#![unstable(feature = "feat_foo", issue = "none" )]
+
+/// In staged-api crate, if feat_foo is only needed to use an impl,
+/// having both `feat_foo` and `feat_bar` will still make it pass.
+
+pub trait Foo {
+    fn foo();
+}
+pub struct Bar;
+
+// Annotate the impl as unstable.
+#[unstable_feature_bound(feat_foo)]
+impl Foo for Bar {
+    fn foo() {}
+}
+
+#[unstable_feature_bound(feat_foo, feat_bar)]
+fn bar() {
+    Bar::foo();
+}
+
+fn main() {}