rust/tests/ui/traits/const-traits/const-bounds-non-const-trait.rs

14 lines
434 B
Rust
Raw Normal View History

// Regression test for issue #117244.
2024-06-21 12:22:29 +00:00
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
trait NonConst {}
const fn perform<T: ~const NonConst>() {}
//~^ ERROR `~const` can only be applied to `#[const_trait]` traits
//~| ERROR `~const` can only be applied to `#[const_trait]` traits
fn operate<T: const NonConst>() {}
//~^ ERROR `const` can only be applied to `#[const_trait]` traits
fn main() {}