@@ -605,18 +605,26 @@ impl<'a> TraitDef<'a> {
605605 let bounds: Vec < _ > = self
606606 . additional_bounds
607607 . iter ( )
608- . map ( |p| cx. trait_bound ( p. to_path ( cx, self . span , type_ident, generics) ) )
608+ . map ( |p| {
609+ cx. trait_bound (
610+ p. to_path ( cx, self . span , type_ident, generics) ,
611+ self . is_const ,
612+ )
613+ } )
609614 . chain (
610615 // Add a bound for the current trait.
611616 self . skip_path_as_bound
612617 . not ( )
613- . then ( || cx. trait_bound ( trait_path. clone ( ) ) ) ,
618+ . then ( || cx. trait_bound ( trait_path. clone ( ) , self . is_const ) ) ,
614619 )
615620 . chain ( {
616621 // Add a `Copy` bound if required.
617622 if is_packed && self . needs_copy_as_bound_if_packed {
618623 let p = deriving:: path_std!( marker:: Copy ) ;
619- Some ( cx. trait_bound ( p. to_path ( cx, self . span , type_ident, generics) ) )
624+ Some ( cx. trait_bound (
625+ p. to_path ( cx, self . span , type_ident, generics) ,
626+ self . is_const ,
627+ ) )
620628 } else {
621629 None
622630 }
@@ -694,18 +702,24 @@ impl<'a> TraitDef<'a> {
694702 let mut bounds: Vec < _ > = self
695703 . additional_bounds
696704 . iter ( )
697- . map ( |p| cx. trait_bound ( p. to_path ( cx, self . span , type_ident, generics) ) )
705+ . map ( |p| {
706+ cx. trait_bound (
707+ p. to_path ( cx, self . span , type_ident, generics) ,
708+ self . is_const ,
709+ )
710+ } )
698711 . collect ( ) ;
699712
700713 // Require the current trait.
701- bounds. push ( cx. trait_bound ( trait_path. clone ( ) ) ) ;
714+ bounds. push ( cx. trait_bound ( trait_path. clone ( ) , self . is_const ) ) ;
702715
703716 // Add a `Copy` bound if required.
704717 if is_packed && self . needs_copy_as_bound_if_packed {
705718 let p = deriving:: path_std!( marker:: Copy ) ;
706- bounds. push (
707- cx. trait_bound ( p. to_path ( cx, self . span , type_ident, generics) ) ,
708- ) ;
719+ bounds. push ( cx. trait_bound (
720+ p. to_path ( cx, self . span , type_ident, generics) ,
721+ self . is_const ,
722+ ) ) ;
709723 }
710724
711725 let predicate = ast:: WhereBoundPredicate {
0 commit comments