Skip to content

Commit b97659e

Browse files
authoredNov 11, 2016
Rollup merge of rust-lang#37688 - eddyb:lazy-8, r=petrochenkov
[8/n] rustc: clean up lookup_item_type and remove TypeScheme. _This is part of a series ([prev](rust-lang#37676) | [next]()) 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> * `tcx.tcache` -> `tcx.item_types` * `TypeScheme` (grouping `Ty` and `ty::Generics`) is removed * `tcx.item_types` entries no longer duplicated in `tcx.tables.node_types` * `tcx.lookup_item_type(def_id).ty` -> `tcx.item_type(def_id)` * `tcx.lookup_item_type(def_id).generics` -> `tcx.item_generics(def_id)` * `tcx.lookup_generics(def_id)` -> `tcx.item_generics(def_id)` * `tcx.lookup_{super_,}predicates(def_id)` -> `tcx.item_{super_,}predicates(def_id)`
2 parents de4803b + 3f9eba1 commit b97659e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+400
-492
lines changed
 

‎src/librustc/dep_graph/dep_tracking_map.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ impl<M: DepTrackingMapConfig> MemoizationMap for RefCell<DepTrackingMap<M>> {
112112
/// switched to `Map(key)`. Therefore, if `op` makes use of any
113113
/// HIR nodes or shared state accessed through its closure
114114
/// environment, it must explicitly register a read of that
115-
/// state. As an example, see `type_scheme_of_item` in `collect`,
115+
/// state. As an example, see `type_of_item` in `collect`,
116116
/// which looks something like this:
117117
///
118118
/// ```
119-
/// fn type_scheme_of_item(..., item: &hir::Item) -> ty::TypeScheme<'tcx> {
119+
/// fn type_of_item(..., item: &hir::Item) -> Ty<'tcx> {
120120
/// let item_def_id = ccx.tcx.map.local_def_id(it.id);
121-
/// ccx.tcx.tcache.memoized(item_def_id, || {
121+
/// ccx.tcx.item_types.memoized(item_def_id, || {
122122
/// ccx.tcx.dep_graph.read(DepNode::Hir(item_def_id)); // (*)
123-
/// compute_type_scheme_of_item(ccx, item)
123+
/// compute_type_of_item(ccx, item)
124124
/// });
125125
/// }
126126
/// ```

‎src/librustc/infer/error_reporting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ impl<'a, 'gcx, 'tcx> Rebuilder<'a, 'gcx, 'tcx> {
14431443
match self.tcx.expect_def(cur_ty.id) {
14441444
Def::Enum(did) | Def::TyAlias(did) |
14451445
Def::Struct(did) | Def::Union(did) => {
1446-
let generics = self.tcx.lookup_generics(did);
1446+
let generics = self.tcx.item_generics(did);
14471447

14481448
let expected =
14491449
generics.regions.len() as u32;

0 commit comments

Comments
 (0)