X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_ty_utils%2Fsrc%2Fconsts.rs;h=a9fbad55dac5540b6230dd669fdee5926cd06302;hb=3c155dc7b6ac9368fbe6f3127b42e91b181f2708;hp=a9b4e1420ea0db1b5b9cbe5670e8df8c3f1c84d3;hpb=a377893da2cd7124e5a18c7116cbb70e16dd5541;p=rust.git diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs index a9b4e1420ea..a9fbad55dac 100644 --- a/compiler/rustc_ty_utils/src/consts.rs +++ b/compiler/rustc_ty_utils/src/consts.rs @@ -302,13 +302,53 @@ fn expr_is_poly(&mut self, expr: &thir::Expr<'tcx>) -> bool { } match expr.kind { - thir::ExprKind::NamedConst { substs, .. } => substs.has_non_region_param(), + thir::ExprKind::NamedConst { substs, .. } + | thir::ExprKind::ConstBlock { substs, .. } => substs.has_non_region_param(), thir::ExprKind::ConstParam { .. } => true, thir::ExprKind::Repeat { value, count } => { self.visit_expr(&self.thir()[value]); count.has_non_region_param() } - _ => false, + thir::ExprKind::Scope { .. } + | thir::ExprKind::Box { .. } + | thir::ExprKind::If { .. } + | thir::ExprKind::Call { .. } + | thir::ExprKind::Deref { .. } + | thir::ExprKind::Binary { .. } + | thir::ExprKind::LogicalOp { .. } + | thir::ExprKind::Unary { .. } + | thir::ExprKind::Cast { .. } + | thir::ExprKind::Use { .. } + | thir::ExprKind::NeverToAny { .. } + | thir::ExprKind::Pointer { .. } + | thir::ExprKind::Loop { .. } + | thir::ExprKind::Let { .. } + | thir::ExprKind::Match { .. } + | thir::ExprKind::Block { .. } + | thir::ExprKind::Assign { .. } + | thir::ExprKind::AssignOp { .. } + | thir::ExprKind::Field { .. } + | thir::ExprKind::Index { .. } + | thir::ExprKind::VarRef { .. } + | thir::ExprKind::UpvarRef { .. } + | thir::ExprKind::Borrow { .. } + | thir::ExprKind::AddressOf { .. } + | thir::ExprKind::Break { .. } + | thir::ExprKind::Continue { .. } + | thir::ExprKind::Return { .. } + | thir::ExprKind::Array { .. } + | thir::ExprKind::Tuple { .. } + | thir::ExprKind::Adt(_) + | thir::ExprKind::PlaceTypeAscription { .. } + | thir::ExprKind::ValueTypeAscription { .. } + | thir::ExprKind::Closure(_) + | thir::ExprKind::Literal { .. } + | thir::ExprKind::NonHirLiteral { .. } + | thir::ExprKind::ZstLiteral { .. } + | thir::ExprKind::StaticRef { .. } + | thir::ExprKind::InlineAsm(_) + | thir::ExprKind::ThreadLocalRef(_) + | thir::ExprKind::Yield { .. } => false, } } fn pat_is_poly(&mut self, pat: &thir::Pat<'tcx>) -> bool {