diff options
| author | Luqman Aden <me@luqman.ca> | 2013-06-11 15:08:40 -0400 | 
|---|---|---|
| committer | Luqman Aden <laden@csclub.uwaterloo.ca> | 2013-06-12 02:46:38 -0400 | 
| commit | 47772bcb737b229586cc9a9d96a9abda005b907c (patch) | |
| tree | 05139b69980e8242bfcf79ec37f665b227f83c98 /src/test/compile-fail/impl-duplicate-methods.rs | |
| parent | c6f3103006f3e91daf4ffbd026ff64d77f858675 (diff) | |
| download | rust-47772bcb737b229586cc9a9d96a9abda005b907c.tar.gz rust-47772bcb737b229586cc9a9d96a9abda005b907c.zip | |
Add tests for duplicate methods on traits/impls.
Diffstat (limited to 'src/test/compile-fail/impl-duplicate-methods.rs')
| -rw-r--r-- | src/test/compile-fail/impl-duplicate-methods.rs | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/src/test/compile-fail/impl-duplicate-methods.rs b/src/test/compile-fail/impl-duplicate-methods.rs new file mode 100644 index 00000000000..ec766e5ce9b --- /dev/null +++ b/src/test/compile-fail/impl-duplicate-methods.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 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo; +impl Foo { + fn orange(&self){} + fn orange(&self){} //~ ERROR error: duplicate definition of method `orange` +} + +fn main() {} | 
