@@ -605,18 +605,26 @@ impl<'a> TraitDef<'a> {
605
605
let bounds: Vec < _ > = self
606
606
. additional_bounds
607
607
. 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
+ } )
609
614
. chain (
610
615
// Add a bound for the current trait.
611
616
self . skip_path_as_bound
612
617
. not ( )
613
- . then ( || cx. trait_bound ( trait_path. clone ( ) ) ) ,
618
+ . then ( || cx. trait_bound ( trait_path. clone ( ) , self . is_const ) ) ,
614
619
)
615
620
. chain ( {
616
621
// Add a `Copy` bound if required.
617
622
if is_packed && self . needs_copy_as_bound_if_packed {
618
623
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
+ ) )
620
628
} else {
621
629
None
622
630
}
@@ -694,18 +702,24 @@ impl<'a> TraitDef<'a> {
694
702
let mut bounds: Vec < _ > = self
695
703
. additional_bounds
696
704
. 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
+ } )
698
711
. collect ( ) ;
699
712
700
713
// 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 ) ) ;
702
715
703
716
// Add a `Copy` bound if required.
704
717
if is_packed && self . needs_copy_as_bound_if_packed {
705
718
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
+ ) ) ;
709
723
}
710
724
711
725
let predicate = ast:: WhereBoundPredicate {
0 commit comments