@@ -900,8 +900,8 @@ impl<'a> BindingsBuilder<'a> {
900
900
let mut constraints = None ;
901
901
let kind = match x {
902
902
TypeParam :: TypeVar ( tv) => {
903
- if let Some ( box bound_expr) = & mut tv. bound {
904
- if let Expr :: Tuple ( tuple) = bound_expr {
903
+ if let Some ( bound_expr) = & mut tv. bound {
904
+ if let Expr :: Tuple ( tuple) = & mut * * bound_expr {
905
905
let mut constraint_exprs = Vec :: new ( ) ;
906
906
for constraint in & mut tuple. elts {
907
907
self . ensure_type ( constraint, & mut None ) ;
@@ -910,26 +910,26 @@ impl<'a> BindingsBuilder<'a> {
910
910
constraints = Some ( ( constraint_exprs, bound_expr. range ( ) ) )
911
911
} else {
912
912
self . ensure_type ( bound_expr, & mut None ) ;
913
- bound = Some ( bound_expr) ;
913
+ bound = Some ( ( * * bound_expr) . clone ( ) ) ;
914
914
}
915
915
}
916
- if let Some ( box default_expr) = & mut tv. default {
916
+ if let Some ( default_expr) = & mut tv. default {
917
917
self . ensure_type ( default_expr, & mut None ) ;
918
- default = Some ( default_expr) ;
918
+ default = Some ( ( * * default_expr) . clone ( ) ) ;
919
919
}
920
920
QuantifiedKind :: TypeVar
921
921
}
922
922
TypeParam :: ParamSpec ( x) => {
923
- if let Some ( box default_expr) = & mut x. default {
923
+ if let Some ( default_expr) = & mut x. default {
924
924
self . ensure_type ( default_expr, & mut None ) ;
925
- default = Some ( default_expr) ;
925
+ default = Some ( ( * * default_expr) . clone ( ) ) ;
926
926
}
927
927
QuantifiedKind :: ParamSpec
928
928
}
929
929
TypeParam :: TypeVarTuple ( x) => {
930
- if let Some ( box default_expr) = & mut x. default {
930
+ if let Some ( default_expr) = & mut x. default {
931
931
self . ensure_type ( default_expr, & mut None ) ;
932
- default = Some ( default_expr) ;
932
+ default = Some ( ( * * default_expr) . clone ( ) ) ;
933
933
}
934
934
QuantifiedKind :: TypeVarTuple
935
935
}
@@ -942,8 +942,8 @@ impl<'a> BindingsBuilder<'a> {
942
942
name : name. id . clone ( ) ,
943
943
unique : self . uniques . fresh ( ) ,
944
944
kind,
945
- default : default . cloned ( ) ,
946
- bound : bound . cloned ( ) ,
945
+ default,
946
+ bound,
947
947
constraints,
948
948
} ) ) ,
949
949
FlowStyle :: None ,
0 commit comments