Skip to content

Commit 8404358

Browse files
committed
dropck_outlives comments
1 parent c0156d1 commit 8404358

File tree

2 files changed

+10
-12
lines changed
  • compiler
    • rustc_borrowck/src/type_check/liveness
    • rustc_trait_selection/src/traits/query/type_op

2 files changed

+10
-12
lines changed

compiler/rustc_borrowck/src/type_check/liveness/trace.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,16 @@ impl<'me, 'typeck, 'flow, 'tcx> LivenessResults<'me, 'typeck, 'flow, 'tcx> {
161161
}
162162
}
163163

164-
// Runs dropck for locals whose liveness isn't relevant. This is
165-
// necessary to eagerly detect unbound recursion during drop glue computation.
164+
/// Runs dropck for locals whose liveness isn't relevant. This is
165+
/// necessary to eagerly detect unbound recursion during drop glue computation.
166+
///
167+
/// These locals should not result in any liveness constraints given that they
168+
/// should otherwise not be considered boring and get dropped. This is currently
169+
/// not the case due to mismatches between `Ty::needs_drop` and `compute_drop_data`.
170+
/// See #110288 and RFC 3417 for more details.
171+
///
172+
/// FIXME: Assert that the returned liveness constraints are empty once these
173+
/// inconsistencies are fixed.
166174
fn dropck_boring_locals(&mut self, boring_locals: Vec<Local>) {
167175
for local in boring_locals {
168176
let local_ty = self.cx.body.local_decls[local].ty;

compiler/rustc_trait_selection/src/traits/query/type_op/outlives.rs

-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ impl<'tcx> super::QueryTypeOp<'tcx> for DropckOutlives<'tcx> {
3131
tcx: TyCtxt<'tcx>,
3232
canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, Self>>,
3333
) -> Result<CanonicalQueryResponse<'tcx, Self::QueryResponse>, NoSolution> {
34-
// Subtle: note that we are not invoking
35-
// `infcx.at(...).dropck_outlives(...)` here, but rather the
36-
// underlying `dropck_outlives` query. This same underlying
37-
// query is also used by the
38-
// `infcx.at(...).dropck_outlives(...)` fn. Avoiding the
39-
// wrapper means we don't need an infcx in this code, which is
40-
// good because the interface doesn't give us one (so that we
41-
// know we are not registering any subregion relations or
42-
// other things).
43-
4434
// FIXME convert to the type expected by the `dropck_outlives`
4535
// query. This should eventually be fixed by changing the
4636
// *underlying query*.

0 commit comments

Comments
 (0)