diff options
Diffstat (limited to 'tests/ui/traits/const-traits/impl-conditionally-const-trait.rs')
| -rw-r--r-- | tests/ui/traits/const-traits/impl-conditionally-const-trait.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/traits/const-traits/impl-conditionally-const-trait.rs b/tests/ui/traits/const-traits/impl-conditionally-const-trait.rs new file mode 100644 index 00000000000..f3783c9e69b --- /dev/null +++ b/tests/ui/traits/const-traits/impl-conditionally-const-trait.rs @@ -0,0 +1,12 @@ +//! This test ensures that we can only implement `const Trait` for a type +//! and not have the conditionally const syntax in that position. + +#![feature(const_trait_impl)] + +struct S; +trait T {} + +impl [const] T for S {} +//~^ ERROR expected identifier, found `]` + +fn main() {} |
