Function body check emit an error message when a required function body
is missing.
gcc/testsuite/ChangeLog:
* rust/compile/functions_without_body.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
--- /dev/null
+struct MyStruct;
+
+trait X {}
+
+fn test_a();
+// { dg-error "free function without a body" "" { target *-*-* } .-1 }
+
+impl MyStruct {
+ fn test_b<T>()
+ // { dg-error "associated function in .impl. without body" "" { target *-*-* } .-1 }
+ where
+ T: Copy;
+
+ fn test_c<T>();
+ // { dg-error "associated function in .impl. without body" "" { target *-*-* } .-1 }
+}
+
+impl X for MyStruct {
+ fn test_d();
+ // { dg-error "associated function in .impl. without body" "" { target *-*-* } .-1 }
+}