@@ -274,7 +274,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
274
274
item_segment. args ( ) ,
275
275
item_segment. infer_args ,
276
276
None ,
277
- None ,
277
+ ty :: BoundConstness :: NotConst ,
278
278
) ;
279
279
if let Some ( b) = item_segment. args ( ) . bindings . first ( ) {
280
280
Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , b. span ) ;
@@ -324,7 +324,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
324
324
generic_args : & ' a hir:: GenericArgs < ' _ > ,
325
325
infer_args : bool ,
326
326
self_ty : Option < Ty < ' tcx > > ,
327
- constness : Option < ty:: BoundConstness > ,
327
+ constness : ty:: BoundConstness ,
328
328
) -> ( SubstsRef < ' tcx > , GenericArgCountResult ) {
329
329
// If the type is parameterized by this region, then replace this
330
330
// region with the current anon region binding (in other words,
@@ -538,7 +538,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
538
538
& mut substs_ctx,
539
539
) ;
540
540
541
- if let Some ( ty:: BoundConstness :: ConstIfConst ) = constness
541
+ if let ty:: BoundConstness :: ConstIfConst = constness
542
542
&& generics. has_self && !tcx. has_attr ( def_id, sym:: const_trait)
543
543
{
544
544
tcx. sess . emit_err ( crate :: errors:: ConstBoundForNonConstTrait { span } ) ;
@@ -611,7 +611,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
611
611
item_segment. args ( ) ,
612
612
item_segment. infer_args ,
613
613
None ,
614
- None ,
614
+ ty :: BoundConstness :: NotConst ,
615
615
) ;
616
616
617
617
if let Some ( b) = item_segment. args ( ) . bindings . first ( ) {
@@ -641,7 +641,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
641
641
self_ty,
642
642
trait_ref. path . segments . last ( ) . unwrap ( ) ,
643
643
true ,
644
- Some ( constness) ,
644
+ constness,
645
645
)
646
646
}
647
647
@@ -668,7 +668,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
668
668
args,
669
669
infer_args,
670
670
Some ( self_ty) ,
671
- Some ( constness) ,
671
+ constness,
672
672
) ;
673
673
674
674
let tcx = self . tcx ( ) ;
@@ -798,7 +798,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
798
798
self_ty : Ty < ' tcx > ,
799
799
trait_segment : & hir:: PathSegment < ' _ > ,
800
800
is_impl : bool ,
801
- constness : Option < ty:: BoundConstness > ,
801
+ constness : ty:: BoundConstness ,
802
802
) -> ty:: TraitRef < ' tcx > {
803
803
let ( substs, _) = self . create_substs_for_ast_trait_ref (
804
804
span,
@@ -822,7 +822,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
822
822
self_ty : Ty < ' tcx > ,
823
823
trait_segment : & ' a hir:: PathSegment < ' a > ,
824
824
is_impl : bool ,
825
- constness : Option < ty:: BoundConstness > ,
825
+ constness : ty:: BoundConstness ,
826
826
) -> ( SubstsRef < ' tcx > , GenericArgCountResult ) {
827
827
self . complain_about_internal_fn_trait ( span, trait_def_id, trait_segment, is_impl) ;
828
828
@@ -2129,7 +2129,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2129
2129
self_ty,
2130
2130
trait_segment,
2131
2131
false ,
2132
- Some ( constness) ,
2132
+ constness,
2133
2133
) ;
2134
2134
2135
2135
let item_substs = self . create_substs_for_associated_item (
@@ -2700,7 +2700,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2700
2700
& GenericArgs :: none ( ) ,
2701
2701
true ,
2702
2702
None ,
2703
- None ,
2703
+ ty :: BoundConstness :: NotConst ,
2704
2704
) ;
2705
2705
EarlyBinder ( self . normalize_ty ( span, tcx. at ( span) . type_of ( def_id) ) )
2706
2706
. subst ( tcx, substs)
0 commit comments