Rollup merge of #102016 - lcnr:given-OutlivesEnvironment, r=jackh726

implied_bounds: deal with inference vars

fixes #101951

while computing implied bounds for `<<T as ConstructionFirm>::Builder as BuilderFn<'_>>::Output` normalization replaces a projection with an inference var (adding a `Projection` obligation). Until we prove that obligation, this inference var remains unknown, which caused us to miss an implied bound necessary to prove that the unnormalized projection from the trait method signature is wf.

r? types
This commit is contained in:
Matthias Krüger 2022-09-25 09:32:07 +02:00 committed by GitHub
commit 16de1fddee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 34 deletions

View file

@ -53,6 +53,7 @@ pub struct OutlivesEnvironment<'tcx> {
}
/// Builder of OutlivesEnvironment.
#[derive(Debug)]
struct OutlivesEnvironmentBuilder<'tcx> {
param_env: ty::ParamEnv<'tcx>,
region_relation: TransitiveRelationBuilder<Region<'tcx>>,
@ -109,6 +110,7 @@ impl<'tcx> OutlivesEnvironment<'tcx> {
impl<'a, 'tcx> OutlivesEnvironmentBuilder<'tcx> {
#[inline]
#[instrument(level = "debug")]
fn build(self) -> OutlivesEnvironment<'tcx> {
OutlivesEnvironment {
param_env: self.param_env,