diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-22 18:09:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-22 18:09:52 +0100 |
| commit | 379ef9bd36cdbe144f0df7868bf80bd0cd07268c (patch) | |
| tree | a916c61f666f2a4767b9e23d1d4e7a314e970b60 /compiler/rustc_trait_selection/src/traits | |
| parent | 702225e2907a2356941783ab7e851da0f046d556 (diff) | |
| parent | 1efb7479ef95657a02d120356d35decaa163f9cc (diff) | |
| download | rust-379ef9bd36cdbe144f0df7868bf80bd0cd07268c.tar.gz rust-379ef9bd36cdbe144f0df7868bf80bd0cd07268c.zip | |
Rollup merge of #121386 - oli-obk:no_higher_ranked_opaques, r=lcnr
test that we do not support higher-ranked regions in opaque type inference We already do all the right checks in `check_opaque_type_parameter_valid`, and we have done so since at least 2 years. I collected the tests from https://github.com/rust-lang/rust/pull/116935 and https://github.com/rust-lang/rust/pull/100503 and added some more cc https://github.com/rust-lang/rust/issues/96146 r? `@lcnr`
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs index 12ee778ee05..faf218131b8 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs @@ -98,6 +98,7 @@ pub trait QueryTypeOp<'tcx>: fmt::Debug + Copy + TypeFoldable<TyCtxt<'tcx>> + 't query_key: ParamEnvAnd<'tcx, Self>, infcx: &InferCtxt<'tcx>, output_query_region_constraints: &mut QueryRegionConstraints<'tcx>, + span: Span, ) -> Result< ( Self::QueryResponse, @@ -118,7 +119,7 @@ pub trait QueryTypeOp<'tcx>: fmt::Debug + Copy + TypeFoldable<TyCtxt<'tcx>> + 't let InferOk { value, obligations } = infcx .instantiate_nll_query_response_and_region_obligations( - &ObligationCause::dummy(), + &ObligationCause::dummy_with_span(span), old_param_env, &canonical_var_values, canonical_result, @@ -160,7 +161,7 @@ where let mut region_constraints = QueryRegionConstraints::default(); let (output, error_info, mut obligations, _) = - Q::fully_perform_into(self, infcx, &mut region_constraints).map_err(|_| { + Q::fully_perform_into(self, infcx, &mut region_constraints, span).map_err(|_| { infcx.dcx().span_delayed_bug(span, format!("error performing {self:?}")) })?; @@ -178,6 +179,7 @@ where obligation.param_env.and(ProvePredicate::new(obligation.predicate)), infcx, &mut region_constraints, + span, ) { Ok(((), _, new, certainty)) => { obligations.extend(new); |
