Skip to content

Commit 18a00bd

Browse files
committed
Auto merge of #51467 - toidiu:ak-51409, r=nikomatsakis
create separate dep-nodes for predicates_of and explicit_predicates_of Fix for #51409 - added incremental compilation test for infer_outlives_requirements - created separate dep-node for explicit_predicates_of
2 parents a32e979 + ea2012b commit 18a00bd

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

src/librustc/dep_graph/dep_node.rs

+1
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ define_dep_nodes!( <'tcx>
500500
[] TypeOfItem(DefId),
501501
[] GenericsOfItem(DefId),
502502
[] PredicatesOfItem(DefId),
503+
[] ExplicitPredicatesOfItem(DefId),
503504
[] InferredOutlivesOf(DefId),
504505
[] InferredOutlivesCrate(CrateNum),
505506
[] SuperPredicatesOfItem(DefId),

src/librustc/ty/maps/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ define_maps! { <'tcx>
102102
/// associated generics and predicates.
103103
[] fn generics_of: GenericsOfItem(DefId) -> &'tcx ty::Generics,
104104
[] fn predicates_of: PredicatesOfItem(DefId) -> ty::GenericPredicates<'tcx>,
105-
[] fn explicit_predicates_of: PredicatesOfItem(DefId) -> ty::GenericPredicates<'tcx>,
105+
[] fn explicit_predicates_of: ExplicitPredicatesOfItem(DefId) -> ty::GenericPredicates<'tcx>,
106106

107107
/// Maps from the def-id of a trait to the list of
108108
/// super-predicates. This is a subset of the full list of

src/librustc/ty/maps/plumbing.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,7 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>,
10511051
DepKind::TypeOfItem => { force!(type_of, def_id!()); }
10521052
DepKind::GenericsOfItem => { force!(generics_of, def_id!()); }
10531053
DepKind::PredicatesOfItem => { force!(predicates_of, def_id!()); }
1054+
DepKind::ExplicitPredicatesOfItem => { force!(explicit_predicates_of, def_id!()); }
10541055
DepKind::InferredOutlivesOf => { force!(inferred_outlives_of, def_id!()); }
10551056
DepKind::InferredOutlivesCrate => { force!(inferred_outlives_crate, LOCAL_CRATE); }
10561057
DepKind::SuperPredicatesOfItem => { force!(super_predicates_of, def_id!()); }

src/test/incremental/issue-51409.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// revisions: rpass1
12+
13+
// Regression test that `infer_outlives_predicates` can be
14+
// used with incremental without an ICE.
15+
16+
#![feature(infer_outlives_requirements)]
17+
18+
struct Foo<'a, T> {
19+
x: &'a T
20+
}
21+
22+
fn main() { }

0 commit comments

Comments
 (0)