blob: ff73b128fd522fd57c4634ece39d5ea68bc7f258 [file]
#![feature(gca_adts, gca_min_const_items, adt_const_params, unsized_const_params)]
use std::gca;
trait Trait {
#[rustc_always_gca]
const ASSOC: usize;
}
fn takes_tuple<const A: (u32, u32)>() {}
fn takes_nested_tuple<const A: (u32, (u32, u32))>() {}
fn generic_caller<T: Trait, const N: u32, const N2: u32>() {
takes_tuple::<{ gca!((N, N + 1)) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block
takes_tuple::<{ gca!((N, T::ASSOC + 1)) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block
takes_nested_tuple::<{ gca!((N, (N, N + 1))) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block
takes_nested_tuple::<{ gca!((N, (N, const { N + 1 }))) }>(); //~ ERROR generic parameters may not be used in const operations
}
fn main() {}