about summary refs log tree commit diff
path: root/tests/ui/unstable-feature-bound/unstable-impl-assoc-type.rs
blob: e31dc688dfab9b89d7b813fa4e66cb3404e2f9b5 (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
//@ revisions: pass fail
//@[pass] check-pass

#![allow(internal_features)]
#![feature(staged_api)]
#![unstable(feature = "feat_foo", issue = "none" )]

/// Test that you can't leak unstable impls through item bounds on associated types.

trait Bar {}

trait Trait {
    type Assoc: Bar;
}

struct Foo;

#[unstable_feature_bound(feat_foo)]
impl Bar for Foo {}

#[cfg_attr(pass, unstable_feature_bound(feat_foo))]
impl Trait for Foo {
  type Assoc = Self;
  //[fail]~^ ERROR: unstable feature `feat_foo` is used without being enabled.

}

fn main(){}