File tree 1 file changed +9
-7
lines changed
compiler/rustc_target/src/abi
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -713,16 +713,18 @@ impl WrappingRange {
713
713
self . start > self . end || self . start == 0
714
714
}
715
715
716
- /// Returns new `WrappingRange ` with replaced `start`
716
+ /// Returns `self ` with replaced `start`
717
717
#[ inline( always) ]
718
- pub fn with_start ( & self , start : u128 ) -> Self {
719
- Self { start, end : self . end }
718
+ pub fn with_start ( mut self , start : u128 ) -> Self {
719
+ self . start = start;
720
+ self
720
721
}
721
722
722
- /// Returns new `WrappingRange ` with replaced `end`
723
+ /// Returns `self ` with replaced `end`
723
724
#[ inline( always) ]
724
- pub fn with_end ( & self , end : u128 ) -> Self {
725
- Self { start : self . start , end }
725
+ pub fn with_end ( mut self , end : u128 ) -> Self {
726
+ self . end = end;
727
+ self
726
728
}
727
729
}
728
730
@@ -1024,7 +1026,7 @@ impl Niche {
1024
1026
pub fn reserve < C : HasDataLayout > ( & self , cx : & C , count : u128 ) -> Option < ( u128 , Scalar ) > {
1025
1027
assert ! ( count > 0 ) ;
1026
1028
1027
- let Scalar { value, valid_range : ref v } = self . scalar ;
1029
+ let Scalar { value, valid_range : v } = self . scalar . clone ( ) ;
1028
1030
let bits = value. size ( cx) . bits ( ) ;
1029
1031
assert ! ( bits <= 128 ) ;
1030
1032
let max_value = !0u128 >> ( 128 - bits) ;
You can’t perform that action at this time.
0 commit comments