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
|
||
|---|---|---|
| .. | ||
| check | ||
| coherence | ||
| variance | ||
| astconv.rs | ||
| Cargo.toml | ||
| collect.rs | ||
| constrained_type_params.rs | ||
| diagnostics.rs | ||
| lib.rs | ||
| rscope.rs | ||