3131//! This API is completely unstable and subject to change.
3232
3333#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/" ) ]
34+ #![ no_std]
3435#![ forbid( unsafe_code) ]
3536
3637#![ feature( nll) ]
3738
38- use std:: cmp:: Ordering ;
39- use std:: fmt;
40- use std:: ops:: { Neg , Add , Sub , Mul , Div , Rem } ;
41- use std:: ops:: { AddAssign , SubAssign , MulAssign , DivAssign , RemAssign } ;
42- use std:: str:: FromStr ;
39+ #[ macro_use]
40+ extern crate alloc;
41+
42+ use core:: cmp:: Ordering ;
43+ use core:: fmt;
44+ use core:: ops:: { Neg , Add , Sub , Mul , Div , Rem } ;
45+ use core:: ops:: { AddAssign , SubAssign , MulAssign , DivAssign , RemAssign } ;
46+ use core:: str:: FromStr ;
4347
4448bitflags:: bitflags! {
4549 /// IEEE-754R 7: Default exception handling.
@@ -587,7 +591,7 @@ macro_rules! float_common_impls {
587591 }
588592 }
589593
590- impl <$t> :: std :: str :: FromStr for $ty<$t> where Self : Float {
594+ impl <$t> :: core :: str :: FromStr for $ty<$t> where Self : Float {
591595 type Err = ParseError ;
592596 fn from_str( s: & str ) -> Result <Self , ParseError > {
593597 Self :: from_str_r( s, Round :: NearestTiesToEven ) . map( |x| x. value)
@@ -596,66 +600,66 @@ macro_rules! float_common_impls {
596600
597601 // Rounding ties to the nearest even, by default.
598602
599- impl <$t> :: std :: ops:: Add for $ty<$t> where Self : Float {
603+ impl <$t> :: core :: ops:: Add for $ty<$t> where Self : Float {
600604 type Output = StatusAnd <Self >;
601605 fn add( self , rhs: Self ) -> StatusAnd <Self > {
602606 self . add_r( rhs, Round :: NearestTiesToEven )
603607 }
604608 }
605609
606- impl <$t> :: std :: ops:: Sub for $ty<$t> where Self : Float {
610+ impl <$t> :: core :: ops:: Sub for $ty<$t> where Self : Float {
607611 type Output = StatusAnd <Self >;
608612 fn sub( self , rhs: Self ) -> StatusAnd <Self > {
609613 self . sub_r( rhs, Round :: NearestTiesToEven )
610614 }
611615 }
612616
613- impl <$t> :: std :: ops:: Mul for $ty<$t> where Self : Float {
617+ impl <$t> :: core :: ops:: Mul for $ty<$t> where Self : Float {
614618 type Output = StatusAnd <Self >;
615619 fn mul( self , rhs: Self ) -> StatusAnd <Self > {
616620 self . mul_r( rhs, Round :: NearestTiesToEven )
617621 }
618622 }
619623
620- impl <$t> :: std :: ops:: Div for $ty<$t> where Self : Float {
624+ impl <$t> :: core :: ops:: Div for $ty<$t> where Self : Float {
621625 type Output = StatusAnd <Self >;
622626 fn div( self , rhs: Self ) -> StatusAnd <Self > {
623627 self . div_r( rhs, Round :: NearestTiesToEven )
624628 }
625629 }
626630
627- impl <$t> :: std :: ops:: Rem for $ty<$t> where Self : Float {
631+ impl <$t> :: core :: ops:: Rem for $ty<$t> where Self : Float {
628632 type Output = StatusAnd <Self >;
629633 fn rem( self , rhs: Self ) -> StatusAnd <Self > {
630634 self . c_fmod( rhs)
631635 }
632636 }
633637
634- impl <$t> :: std :: ops:: AddAssign for $ty<$t> where Self : Float {
638+ impl <$t> :: core :: ops:: AddAssign for $ty<$t> where Self : Float {
635639 fn add_assign( & mut self , rhs: Self ) {
636640 * self = ( * self + rhs) . value;
637641 }
638642 }
639643
640- impl <$t> :: std :: ops:: SubAssign for $ty<$t> where Self : Float {
644+ impl <$t> :: core :: ops:: SubAssign for $ty<$t> where Self : Float {
641645 fn sub_assign( & mut self , rhs: Self ) {
642646 * self = ( * self - rhs) . value;
643647 }
644648 }
645649
646- impl <$t> :: std :: ops:: MulAssign for $ty<$t> where Self : Float {
650+ impl <$t> :: core :: ops:: MulAssign for $ty<$t> where Self : Float {
647651 fn mul_assign( & mut self , rhs: Self ) {
648652 * self = ( * self * rhs) . value;
649653 }
650654 }
651655
652- impl <$t> :: std :: ops:: DivAssign for $ty<$t> where Self : Float {
656+ impl <$t> :: core :: ops:: DivAssign for $ty<$t> where Self : Float {
653657 fn div_assign( & mut self , rhs: Self ) {
654658 * self = ( * self / rhs) . value;
655659 }
656660 }
657661
658- impl <$t> :: std :: ops:: RemAssign for $ty<$t> where Self : Float {
662+ impl <$t> :: core :: ops:: RemAssign for $ty<$t> where Self : Float {
659663 fn rem_assign( & mut self , rhs: Self ) {
660664 * self = ( * self % rhs) . value;
661665 }
0 commit comments