Completely remove captures flag
This commit is contained in:
parent
20c88a2a30
commit
9f77688d17
8 changed files with 99 additions and 193 deletions
|
@ -69,7 +69,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
ParamMode::Optional,
|
||||
ParenthesizedGenericArgs::Err,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
|
||||
true,
|
||||
));
|
||||
let args = self.lower_exprs(args);
|
||||
hir::ExprKind::MethodCall(hir_seg, args, self.lower_span(span))
|
||||
|
@ -90,20 +89,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
}
|
||||
ExprKind::Cast(ref expr, ref ty) => {
|
||||
let expr = self.lower_expr(expr);
|
||||
let ty = self.lower_ty(
|
||||
ty,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::Type),
|
||||
true,
|
||||
);
|
||||
let ty =
|
||||
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Type));
|
||||
hir::ExprKind::Cast(expr, ty)
|
||||
}
|
||||
ExprKind::Type(ref expr, ref ty) => {
|
||||
let expr = self.lower_expr(expr);
|
||||
let ty = self.lower_ty(
|
||||
ty,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::Type),
|
||||
true,
|
||||
);
|
||||
let ty =
|
||||
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Type));
|
||||
hir::ExprKind::Type(expr, ty)
|
||||
}
|
||||
ExprKind::AddrOf(k, m, ref ohs) => {
|
||||
|
@ -233,7 +226,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
path,
|
||||
ParamMode::Optional,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
|
||||
true,
|
||||
);
|
||||
hir::ExprKind::Path(qpath)
|
||||
}
|
||||
|
@ -272,7 +264,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
&se.path,
|
||||
ParamMode::Optional,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
|
||||
true,
|
||||
)),
|
||||
self.arena
|
||||
.alloc_from_iter(se.fields.iter().map(|x| self.lower_expr_field(x))),
|
||||
|
@ -570,11 +561,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
body: impl FnOnce(&mut Self) -> hir::Expr<'hir>,
|
||||
) -> hir::ExprKind<'hir> {
|
||||
let output = match ret_ty {
|
||||
Some(ty) => hir::FnRetTy::Return(self.lower_ty(
|
||||
&ty,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::AsyncBlock),
|
||||
true,
|
||||
)),
|
||||
Some(ty) => hir::FnRetTy::Return(
|
||||
self.lower_ty(&ty, ImplTraitContext::Disallowed(ImplTraitPosition::AsyncBlock)),
|
||||
),
|
||||
None => hir::FnRetTy::DefaultReturn(self.lower_span(span)),
|
||||
};
|
||||
|
||||
|
@ -1178,7 +1167,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
path,
|
||||
ParamMode::Optional,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
|
||||
true,
|
||||
);
|
||||
// Destructure like a tuple struct.
|
||||
let tuple_struct_pat =
|
||||
|
@ -1195,7 +1183,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
path,
|
||||
ParamMode::Optional,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
|
||||
true,
|
||||
);
|
||||
// Destructure like a unit struct.
|
||||
let unit_struct_pat = hir::PatKind::Path(qpath);
|
||||
|
@ -1220,7 +1207,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
&se.path,
|
||||
ParamMode::Optional,
|
||||
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
|
||||
true,
|
||||
);
|
||||
let fields_omitted = match &se.rest {
|
||||
StructRest::Base(e) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue