blob: 3df2f41558fcc66a3971aa65c20a0d35bcca0f7b [file]
#![feature(rustc_attrs, const_trait_impl)]
const trait Trait {
fn method() {}
}
#[rustc_comptime]
fn always_const<T: const Trait>() {
T::method()
}
#[rustc_comptime]
fn conditionally_const<T: [const] Trait>() {
//~^ ERROR: `[const]` is not allowed here
T::method()
//~^ ERROR: `T: const Trait` is not satisfied
}
#[rustc_comptime]
fn non_const<T: Trait>() {
T::method()
//~^ ERROR: `T: const Trait` is not satisfied
}
fn main() {}