rust/src/librustc_typeck
bors 1a019dc86d Auto merge of #31925 - aturon:inherent-overlap, r=nikomatsakis
Forbid items with the same name from appearing 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.

Along the way, this PR also introduces an `ImplHeader` abstraction (the first commit) that makes it easier to work with impls abstractly (without caring whether they are trait or inherent impl blocks); see the first commit.

Closes #22889
r? @nikomatsakis
2016-03-11 20:57:39 -08:00
..
check Rollup merge of #31830 - frewsxcv:assoc-func, r=steveklabnik 2016-03-10 14:01:53 +03:00
coherence Forbid items with the same name being defined in overlapping inherent 2016-03-11 10:59:39 -08:00
variance Track fn type and lifetime parameters in TyFnDef. 2016-03-09 16:45:28 +02:00
astconv.rs Split TyBareFn into TyFnDef and TyFnPtr. 2016-03-09 16:45:28 +02:00
Cargo.toml bootstrap: Add a bunch of Cargo.toml files 2016-02-11 11:12:32 -08:00
collect.rs Forbid items with the same name being defined in overlapping inherent 2016-03-11 10:59:39 -08:00
constrained_type_params.rs Split TyBareFn into TyFnDef and TyFnPtr. 2016-03-09 16:45:28 +02:00
diagnostics.rs Auto merge of #31925 - aturon:inherent-overlap, r=nikomatsakis 2016-03-11 20:57:39 -08:00
lib.rs Track fn type and lifetime parameters in TyFnDef. 2016-03-09 16:45:28 +02:00
rscope.rs move middle::ty and related modules to middle/ty/ 2015-09-14 10:56:13 +03:00