Skip to content

Commit

Permalink
remove the overloaded anon nodes, and convert to ()-style depnodes
Browse files Browse the repository at this point in the history
This means we require less crappy glue code. We couldn't use
`()`-style before because we needed a more general notion of type.
  • Loading branch information
nikomatsakis committed Feb 23, 2018
1 parent a4e763c commit 41d762f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
5 changes: 3 additions & 2 deletions src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,9 @@ define_dep_nodes!( <'tcx>
[] CodegenUnit(InternedString),
[] CompileCodegenUnit(InternedString),
[input] OutputFilenames,
[anon] NormalizeTy,
[] NormalizeProjectionTy { ty: &'tcx Canonical<ParamEnvAnd<'tcx, ty::ProjectionTy<'tcx>>> },
[] NormalizeProjectionTy(&'tcx Canonical<ParamEnvAnd<'tcx, ty::ProjectionTy<'tcx>>>),
[] NormalizeTyAfterErasingRegions(ParamEnvAnd<'tcx, Ty<'tcx>>),
[] DropckOutlives(&'tcx Canonical<ParamEnvAnd<'tcx, Ty<'tcx>>>),

// We use this for most things when incr. comp. is turned off.
[] Null,
Expand Down
16 changes: 3 additions & 13 deletions src/librustc/ty/maps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,17 @@ define_maps! { <'tcx>
[] fn erase_regions_ty: erase_regions_ty(Ty<'tcx>) -> Ty<'tcx>,

/// Do not call this query directly: invoke `normalize` instead.
[] fn normalize_projection_ty: normalize_projection_ty_node(
[] fn normalize_projection_ty: NormalizeProjectionTy(
&'tcx Canonical<ParamEnvAnd<'tcx, ty::ProjectionTy<'tcx>>>
) -> Result<Rc<Canonical<QueryResult<'tcx, NormalizationResult<'tcx>>>>, NoSolution>,

/// Do not call this query directly: invoke `normalize_erasing_regions` instead.
[] fn normalize_ty_after_erasing_regions: normalize_ty_node(
[] fn normalize_ty_after_erasing_regions: NormalizeTyAfterErasingRegions(
ParamEnvAnd<'tcx, Ty<'tcx>>
) -> Ty<'tcx>,

/// Do not call this query directly: invoke `infcx.at().dropck_outlives()` instead.
[] fn dropck_outlives: normalize_ty_node(
[] fn dropck_outlives: DropckOutlives(
&'tcx Canonical<ParamEnvAnd<'tcx, Ty<'tcx>>>
) -> Result<Rc<Canonical<QueryResult<'tcx, DropckOutlivesResult<'tcx>>>>, NoSolution>,

Expand Down Expand Up @@ -532,16 +532,6 @@ fn vtable_methods_node<'tcx>(trait_ref: ty::PolyTraitRef<'tcx>) -> DepConstructo
DepConstructor::VtableMethods{ trait_ref }
}

fn normalize_ty_node<'tcx, T>(_: T) -> DepConstructor<'tcx> {
DepConstructor::NormalizeTy
}

fn normalize_projection_ty_node<'tcx>(
ty: &'tcx Canonical<ParamEnvAnd<'tcx, ty::ProjectionTy<'tcx>>>
) -> DepConstructor<'tcx> {
DepConstructor::NormalizeProjectionTy { ty }
}

fn substitute_normalize_and_test_predicates_node<'tcx>(key: (DefId, &'tcx Substs<'tcx>))
-> DepConstructor<'tcx> {
DepConstructor::SubstituteNormalizeAndTestPredicates { key }
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/ty/maps/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,9 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>,
DepKind::FulfillObligation |
DepKind::VtableMethods |
DepKind::EraseRegionsTy |
DepKind::NormalizeTy |
DepKind::NormalizeProjectionTy |
DepKind::NormalizeTyAfterErasingRegions |
DepKind::DropckOutlives |
DepKind::SubstituteNormalizeAndTestPredicates |
DepKind::InstanceDefSizeEstimate |

Expand Down

0 comments on commit 41d762f

Please sign in to comment.