diff --git a/gcc/testsuite/rust/compile/const_trait_fn.rs b/gcc/testsuite/rust/compile/const_trait_fn.rs new file mode 100644 index 00000000000..cff2f5f096e --- /dev/null +++ b/gcc/testsuite/rust/compile/const_trait_fn.rs @@ -0,0 +1,4 @@ +trait Osterkz { + const fn x(); + // { dg-error "functions in traits cannot be declared const .E0379." "" { target *-*-* } .-1 } +}