about summary refs log tree commit diff
path: root/src/test/compile-fail/impl-duplicate-methods.rs
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2016-02-26 13:21:44 -0800
committerAaron Turon <aturon@mozilla.com>2016-03-11 10:59:39 -0800
commit21df87f515b10ab4d6dac2275d09e679471c7d7c (patch)
treeb41c60f6e2748a72196980a9df8ea9a4f30757ea /src/test/compile-fail/impl-duplicate-methods.rs
parent9cc3bfccebf60a214902f53074eea1b9a83d44f6 (diff)
downloadrust-21df87f515b10ab4d6dac2275d09e679471c7d7c.tar.gz
rust-21df87f515b10ab4d6dac2275d09e679471c7d7c.zip
Forbid items with the same name being defined in overlapping inherent
impl blocks.

For example, the following is now correctly illegal:

```rust
struct Foo;

impl Foo {
    fn id() {}
}

impl Foo {
    fn id() {}
}
```

"Overlapping" here is determined the same way it is for traits (and in
fact shares the same code path): roughly, there must be some way of
substituting any generic types to unify the impls, such that none of the
`where` clauses are provably unsatisfiable under such a unification.

Closes #22889
Diffstat (limited to 'src/test/compile-fail/impl-duplicate-methods.rs')
0 files changed, 0 insertions, 0 deletions