]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #37402 - eddyb:lazy-3, r=nikomatsakis
authorEduard-Mihai Burtescu <edy.burt@gmail.com>
Thu, 10 Nov 2016 01:46:27 +0000 (03:46 +0200)
committerGitHub <noreply@github.com>
Thu, 10 Nov 2016 01:46:27 +0000 (03:46 +0200)
commit8d4a3500ff51dc4352fae847529451d51474ab0f
tree07606b093a437afbcd869107014dd3d079e8c384
parentda2ce2276873242a101f205537e7ce297d68f8dd
parentde0ffadb6722371b9eb636ee9b2d4627db9e02fa
Rollup merge of #37402 - eddyb:lazy-3, r=nikomatsakis

[3/n] rustc: unify and simplify managing associated items.

_This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37401) | [next](https://github.com/rust-lang/rust/pull/37404)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments._

<hr>

`ImplOrTraitItem`/`impl_or_trait_item` have been renamed to `AssociatedItem`/`associated_item`.

The common fields from (what used to be) `ty::ImplOrTraitItem`'s variants have been pulled out, leaving only an `AssociatedKind` C-like enum to distinguish between methods, constants and types.

The type information has been removed from `AssociatedItem`, and as such the latter can now be computed on-demand from the local HIR map, i.e. an extern-crate-enabled `TraitItem | ImplItem`.
It may be moved to HIR in the future, if we intend to start using HIR types cross-crate.

`ty::ExplicitSelfCategory` has been moved to `rustc_typeck` and is produced on-demand from the signature of the method, and a `method_has_self_argument` field on `AssociatedItem`, which is used to indicate that the first argument is a sugary "method receiver" and as such, method call syntax can be used.