Files
rust/tests/ui/traits/const-traits/feature-gate.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
829 B
Rust
Raw Normal View History

2020-01-02 16:31:30 -08:00
//@ revisions: stock gated
2025-03-30 00:39:55 +03:00
//@[gated] check-pass
2020-01-02 16:31:30 -08:00
// gate-test-const_trait_impl
#![cfg_attr(gated, feature(const_trait_impl))]
struct S;
2022-08-28 06:27:31 +00:00
#[const_trait] //[stock]~ ERROR `const_trait` is a temporary placeholder
2020-01-02 16:31:30 -08:00
trait T {}
impl const T for S {}
//[stock]~^ ERROR const trait impls are experimental
const fn f<A: [const] T>() {} //[stock]~ ERROR const trait impls are experimental
fn g<A: const T>() {} //[stock]~ ERROR const trait impls are experimental
2025-08-05 14:52:02 +02:00
const trait Trait {} //[stock]~ ERROR const trait impls are experimental
#[cfg(false)] const trait Trait {} //[stock]~ ERROR const trait impls are experimental
macro_rules! discard { ($ty:ty) => {} }
discard! { impl [const] T } //[stock]~ ERROR const trait impls are experimental
discard! { impl const T } //[stock]~ ERROR const trait impls are experimental
2025-03-30 00:39:55 +03:00
fn main() {}