File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
src/librustc/traits/query/type_op Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ pub trait QueryTypeOp<'gcx: 'tcx, 'tcx>: fmt::Debug + Sized {
49
49
50
50
fn param_env ( key : & Self :: QueryKey ) -> ParamEnv < ' tcx > ;
51
51
52
+ /// Performs the actual query with the canonicalized key -- the
53
+ /// real work happens here. This method is not given an `infcx`
54
+ /// because it shouldn't need one -- and if it had access to one,
55
+ /// it might do things like invoke `sub_regions`, which would be
56
+ /// bad, because it would create subregion relationships that are
57
+ /// not captured in the return value.
52
58
fn perform_query (
53
59
tcx : TyCtxt < ' _ , ' gcx , ' tcx > ,
54
60
canonicalized : Canonicalized < ' gcx , Self :: QueryKey > ,
Original file line number Diff line number Diff line change 52
52
tcx : TyCtxt < ' _ , ' gcx , ' tcx > ,
53
53
canonicalized : Canonicalized < ' gcx , Self :: QueryKey > ,
54
54
) -> Fallible < CanonicalizedQueryResult < ' gcx , Self :: QueryResult > > {
55
+ // Subtle: note that we are not invoking
56
+ // `infcx.at(...).dropck_outlives(...)` here, but rather the
57
+ // underlying `dropck_outlives` query. This same underlying
58
+ // query is also used by the
59
+ // `infcx.at(...).dropck_outlives(...)` fn. Avoiding the
60
+ // wrapper means we don't need an infcx in this code, which is
61
+ // good because the interface doesn't give us one (so that we
62
+ // know we are not registering any subregion relations or
63
+ // other things).
55
64
tcx. dropck_outlives ( canonicalized)
56
65
}
57
66
You can’t perform that action at this time.
0 commit comments