2024-02-16 20:02:50 +00: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
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
const fn f<A: [const] T>() {} //[stock]~ ERROR const trait impls are experimental
|
2023-12-18 17:55:55 +01:00
|
|
|
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
|
|
|
|
|
|
2023-12-18 17:55:55 +01:00
|
|
|
macro_rules! discard { ($ty:ty) => {} }
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
discard! { impl [const] T } //[stock]~ ERROR const trait impls are experimental
|
2023-12-18 17:55:55 +01:00
|
|
|
discard! { impl const T } //[stock]~ ERROR const trait impls are experimental
|
|
|
|
|
|
2025-03-30 00:39:55 +03:00
|
|
|
fn main() {}
|