X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_hir_analysis%2Fsrc%2Fmem_categorization.rs;h=362f1c3430041a45e668c263b825e7f790a2fbc9;hb=e91fd0b514eaf950f8b84f0703142e8926d27286;hp=39610e3ae38057228ec2d97c6690806261aeabfe;hpb=07bb2e65276d21ef97a6bdbcfdd74cfce47baa37;p=rust.git diff --git a/compiler/rustc_hir_analysis/src/mem_categorization.rs b/compiler/rustc_hir_analysis/src/mem_categorization.rs index 39610e3ae38..362f1c34300 100644 --- a/compiler/rustc_hir_analysis/src/mem_categorization.rs +++ b/compiler/rustc_hir_analysis/src/mem_categorization.rs @@ -92,7 +92,7 @@ fn span(&self) -> Span { #[derive(Clone)] pub(crate) struct MemCategorizationContext<'a, 'tcx> { pub(crate) typeck_results: &'a ty::TypeckResults<'tcx>, - infcx: &'a InferCtxt<'a, 'tcx>, + infcx: &'a InferCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>, body_owner: LocalDefId, upvars: Option<&'tcx FxIndexMap>, @@ -103,7 +103,7 @@ pub(crate) struct MemCategorizationContext<'a, 'tcx> { impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> { /// Creates a `MemCategorizationContext`. pub(crate) fn new( - infcx: &'a InferCtxt<'a, 'tcx>, + infcx: &'a InferCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>, body_owner: LocalDefId, typeck_results: &'a ty::TypeckResults<'tcx>, @@ -184,7 +184,7 @@ pub(crate) fn expr_ty_adjusted(&self, expr: &hir::Expr<'_>) -> McResult /// modes #42640) may look like `Some(x)` but in fact have /// implicit deref patterns attached (e.g., it is really /// `&Some(x)`). In that case, we return the "outermost" type - /// (e.g., `&Option). + /// (e.g., `&Option`). pub(crate) fn pat_ty_adjusted(&self, pat: &hir::Pat<'_>) -> McResult> { // Check for implicit `&` types wrapping the pattern; note // that these are never attached to binding patterns, so @@ -292,7 +292,8 @@ fn cat_expr_adjusted_with( adjustment::Adjust::NeverToAny | adjustment::Adjust::Pointer(_) - | adjustment::Adjust::Borrow(_) => { + | adjustment::Adjust::Borrow(_) + | adjustment::Adjust::DynStar => { // Result is an rvalue. Ok(self.cat_rvalue(expr.hir_id, expr.span, target)) } @@ -560,7 +561,8 @@ fn variant_index_for_adt( Res::Def(DefKind::Ctor(CtorOf::Struct, ..), _) | Res::Def(DefKind::Struct | DefKind::Union | DefKind::TyAlias | DefKind::AssocTy, _) | Res::SelfCtor(..) - | Res::SelfTy { .. } => { + | Res::SelfTyParam { .. } + | Res::SelfTyAlias { .. } => { // Structs and Unions have only have one variant. Ok(VariantIdx::new(0)) }