From 45983fecff0d4bf66e80c1299697b591757a81c0 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 10 Feb 2022 16:38:27 -0300 Subject: [PATCH] Add comments about outlives_env --- compiler/rustc_trait_selection/src/traits/coherence.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index 7dd01f5b0b0..9d690578cfc 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -392,6 +392,13 @@ fn negative_impl_exists<'cx, 'tcx>( } let mut outlives_env = OutlivesEnvironment::new(param_env); + // FIXME -- add "assumed to be well formed" types into the `outlives_env` + + // "Save" the accumulated implied bounds into the outlives environment + // (due to the FIXME above, there aren't any, but this step is still needed). + // The "body id" is given as `CRATE_HIR_ID`, which is the same body-id used + // by the "dummy" causes elsewhere (body-id is only relevant when checking + // function bodies with closures). outlives_env.save_implied_bounds(CRATE_HIR_ID); infcx.process_registered_region_obligations(