summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/issues/issue-67945-3.rs
blob: fd8a393effe72051f2142ec0ede94544c1c97ce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Regression test for
// https://github.com/rust-lang/rust/issues/67945#issuecomment-572617285
// Make sure we don't emit an E0277 error.

// revisions: full min
#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]

struct Bug<S> { //[min]~ ERROR: parameter `S` is never used
    A: [(); { //[full]~ ERROR: overly complex generic constant
        let x: Option<S> = None;
        //[min]~^ ERROR: generic parameters may not be used in const operations
        0
    }],
}

fn main() {}