about summary refs log tree commit diff
path: root/tests/ui/unstable-feature-bound/unstable_feature_bound_multi_attr.rs
blob: 3d6b52ba51771784a146af06fd77b5508980a8e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#![allow(internal_features)]
#![feature(staged_api)]
#![allow(dead_code)]
#![unstable(feature = "feat_bar", issue = "none" )]

/// Test the behaviour of multiple unstable_feature_bound attribute.

trait Foo {
    fn foo();
}
struct Bar;

#[unstable_feature_bound(feat_bar, feat_koo)]
#[unstable_feature_bound(feat_foo, feat_moo)]
impl Foo for Bar {
    fn foo(){}
}

#[unstable_feature_bound(feat_bar, feat_koo)]
#[unstable_feature_bound(feat_foo, feat_moo)]
fn moo() {
    Bar::foo();
}

#[unstable_feature_bound(feat_bar, feat_koo, feat_foo, feat_moo)]
fn koo() {
    Bar::foo();
}

#[unstable_feature_bound(feat_koo, feat_foo, feat_moo)]
fn boo() {
    Bar::foo();
    //~^ ERROR: unstable feature `feat_bar` is used without being enabled.
}

fn main() {}