From 41e90f2156236d8b4a0ab74e3ed9aadaa7d11d58 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Thu, 20 Jun 2013 19:23:31 -0400 Subject: [PATCH] Add test for duplicate definitions of structs and enum struct variants. --- .../dup-struct-enum-struct-variant.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/compile-fail/dup-struct-enum-struct-variant.rs diff --git a/src/test/compile-fail/dup-struct-enum-struct-variant.rs b/src/test/compile-fail/dup-struct-enum-struct-variant.rs new file mode 100644 index 0000000000000..69e6b5c6856a8 --- /dev/null +++ b/src/test/compile-fail/dup-struct-enum-struct-variant.rs @@ -0,0 +1,17 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { C { a: int, b: int } } +struct C { a: int, b: int } //~ ERROR error: duplicate definition of type `C` + +struct A { x: int } +enum Bar { A { x: int } } //~ ERROR error: duplicate definition of type `A` + +fn main() {}