about summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/const-supertraits-dyn-compat.rs
blob: 2d12bc81af679e425f82b2c6906d7fe83d3abd35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![feature(const_trait_impl)]

const trait Super {}

// Not ok
const trait Unconditionally: const Super {}
fn test() {
    let _: &dyn Unconditionally;
    //~^ ERROR the trait `Unconditionally` is not dyn compatible
}

// Okay
const trait Conditionally: [const] Super {}
fn test2() {
    let _: &dyn Conditionally;
}

fn main() {}