File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ macro impl_for_float($t:ty) {
6767 #[ rustc_const_unstable( feature = "clamp_bounds", issue = "147781" ) ]
6868 impl const ClampBounds <$t> for RangeFrom <$t> {
6969 fn clamp( self , value: $t) -> $t {
70- assert ! ( !self . start. is_nan( ) , "min was NaN" ) ;
70+ assert ! ( !self . start. is_nan( ) , "start was NaN" ) ;
7171 value. max( self . start)
7272 }
7373 }
@@ -76,7 +76,7 @@ macro impl_for_float($t:ty) {
7676 #[ rustc_const_unstable( feature = "clamp_bounds" , issue = "147781" ) ]
7777 impl const ClampBounds < $t> for RangeToInclusive < $t> {
7878 fn clamp( self , value: $t) -> $t {
79- assert ! ( !self . end. is_nan( ) , "max was NaN" ) ;
79+ assert ! ( !self . end. is_nan( ) , "end was NaN" ) ;
8080 value. min( self . end)
8181 }
8282 }
@@ -86,6 +86,7 @@ macro impl_for_float($t:ty) {
8686 impl const ClampBounds < $t> for RangeInclusive < $t> {
8787 fn clamp( self , value: $t) -> $t {
8888 let ( start, end) = self . into_inner( ) ;
89+ assert ! ( start <= end, "start > end, or either was NaN" ) ;
8990 value. clamp( start, end)
9091 }
9192 }
You can’t perform that action at this time.
0 commit comments