diff --git a/src/test/compile-fail/extend-non-object.rs b/src/test/compile-fail/extend-non-object.rs new file mode 100644 index 000000000000..3d232db2dc67 --- /dev/null +++ b/src/test/compile-fail/extend-non-object.rs @@ -0,0 +1,13 @@ +//error-pattern:x does not have object type +use std; + +fn main() { + auto x = 3; + + auto anon_obj = obj { + fn foo() -> int { + ret 3; + } + with x + }; +}