1
Fork 0

Auto merge of #108357 - matthiaskrgr:rollup-ceo3q2s, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #107736 ( Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref #66893) )
 - #108176 (Don't delay `ReError` bug during lexical region resolve)
 - #108315 (Lint dead code in closures and generators)
 - #108342 (apply query response: actually define opaque types)
 - #108344 (Fix test filename for #105700)
 - #108353 (resolve: Remove `ImportResolver`)

Failed merges:

 - #107911 (Add check for invalid #[macro_export] arguments)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-02-22 21:24:29 +00:00
commit da439d9874
15 changed files with 179 additions and 121 deletions

View file

@ -393,6 +393,7 @@ impl<'tcx> InferCtxt<'tcx> {
/// will instantiate fresh inference variables for each canonical
/// variable instead. Therefore, the result of this method must be
/// properly unified
#[instrument(level = "debug", skip(self, cause, param_env))]
fn query_response_substitution_guess<R>(
&self,
cause: &ObligationCause<'tcx>,
@ -403,11 +404,6 @@ impl<'tcx> InferCtxt<'tcx> {
where
R: Debug + TypeFoldable<TyCtxt<'tcx>>,
{
debug!(
"query_response_substitution_guess(original_values={:#?}, query_response={:#?})",
original_values, query_response,
);
// For each new universe created in the query result that did
// not appear in the original query, create a local
// superuniverse.
@ -502,7 +498,9 @@ impl<'tcx> InferCtxt<'tcx> {
for &(a, b) in &query_response.value.opaque_types {
let a = substitute_value(self.tcx, &result_subst, a);
let b = substitute_value(self.tcx, &result_subst, b);
obligations.extend(self.at(cause, param_env).eq(a, b)?.obligations);
debug!(?a, ?b, "constrain opaque type");
obligations
.extend(self.at(cause, param_env).define_opaque_types(true).eq(a, b)?.obligations);
}
Ok(InferOk { value: result_subst, obligations })

View file

@ -1046,7 +1046,7 @@ impl<'tcx> LexicalRegionResolutions<'tcx> {
ty::ReVar(rid) => match self.values[rid] {
VarValue::Empty(_) => r,
VarValue::Value(r) => r,
VarValue::ErrorValue => tcx.mk_re_error_misc(),
VarValue::ErrorValue => tcx.lifetimes.re_static,
},
_ => r,
};