Skip to content

Commit 41d762f

Browse files
committed
remove the overloaded anon nodes, and convert to ()-style depnodes
This means we require less crappy glue code. We couldn't use `()`-style before because we needed a more general notion of type.
1 parent a4e763c commit 41d762f

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

src/librustc/dep_graph/dep_node.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,9 @@ define_dep_nodes!( <'tcx>
631631
[] CodegenUnit(InternedString),
632632
[] CompileCodegenUnit(InternedString),
633633
[input] OutputFilenames,
634-
[anon] NormalizeTy,
635-
[] NormalizeProjectionTy { ty: &'tcx Canonical<ParamEnvAnd<'tcx, ty::ProjectionTy<'tcx>>> },
634+
[] NormalizeProjectionTy(&'tcx Canonical<ParamEnvAnd<'tcx, ty::ProjectionTy<'tcx>>>),
635+
[] NormalizeTyAfterErasingRegions(ParamEnvAnd<'tcx, Ty<'tcx>>),
636+
[] DropckOutlives(&'tcx Canonical<ParamEnvAnd<'tcx, Ty<'tcx>>>),
636637

637638
// We use this for most things when incr. comp. is turned off.
638639
[] Null,

src/librustc/ty/maps/mod.rs

+3-13
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,17 @@ define_maps! { <'tcx>
370370
[] fn erase_regions_ty: erase_regions_ty(Ty<'tcx>) -> Ty<'tcx>,
371371

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

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

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

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

535-
fn normalize_ty_node<'tcx, T>(_: T) -> DepConstructor<'tcx> {
536-
DepConstructor::NormalizeTy
537-
}
538-
539-
fn normalize_projection_ty_node<'tcx>(
540-
ty: &'tcx Canonical<ParamEnvAnd<'tcx, ty::ProjectionTy<'tcx>>>
541-
) -> DepConstructor<'tcx> {
542-
DepConstructor::NormalizeProjectionTy { ty }
543-
}
544-
545535
fn substitute_normalize_and_test_predicates_node<'tcx>(key: (DefId, &'tcx Substs<'tcx>))
546536
-> DepConstructor<'tcx> {
547537
DepConstructor::SubstituteNormalizeAndTestPredicates { key }

src/librustc/ty/maps/plumbing.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,9 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>,
772772
DepKind::FulfillObligation |
773773
DepKind::VtableMethods |
774774
DepKind::EraseRegionsTy |
775-
DepKind::NormalizeTy |
776775
DepKind::NormalizeProjectionTy |
776+
DepKind::NormalizeTyAfterErasingRegions |
777+
DepKind::DropckOutlives |
777778
DepKind::SubstituteNormalizeAndTestPredicates |
778779
DepKind::InstanceDefSizeEstimate |
779780

0 commit comments

Comments
 (0)