Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [I] ! I ~/w/r/bjorn3-mopa master * env RUST_BACKTRACE=1 cargo test 585ms Fr 29 Jul 2016 21:07:25 CEST
- Compiling mopa v0.2.2 (file:///home/limeth/workspace/rust/bjorn3-mopa)
- mopafy! { Person }
- mopafy_only_core! { Person }
- parse_generics_shim! { { .. } , then mopafy_only_core_internal ! ( Person ) , }
- parse_generics_shim! { @ parse_start { { .. } , ( mopafy_only_core_internal ! ( Person ) ) } , }
- parse_generics_shim! { @ emit_output { { .. } , ( mopafy_only_core_internal ! ( Person ) ) } , {
- constr : [ ] , ltimes : [ ] , tnames : [ ] , } , }
- parse_generics_shim_util! { @ callback ( mopafy_only_core_internal ! ( Person ) ) , {
- constr : [ ] , params : [ ] , ltimes : [ ] , tnames : [ ] , .. } , }
- mopafy_only_core_internal! { Person { constr : [ ] , params : [ ] , ltimes : [ ] , tnames : [ ] , .. }
- , }
- as_item! { # [ allow ( dead_code ) ] impl < > Person < > {
- /// Returns true if the boxed type is the same as `T`
- # [ inline ] pub fn is < T : Person < >> ( & self ) -> bool {
- :: __ :: TypeId :: of :: < T > ( ) == :: Any :: __get_type_id ( self ) }
- /// Returns some reference to the boxed value if it is of type `T`, or
- /// `None` if it isn't.
- # [ inline ] pub fn downcast_ref < T : Person < >> ( & self ) -> :: __ ::
- Option < & T > {
- if self . is :: < T > ( ) {
- unsafe { :: __ :: Option :: Some ( self . downcast_ref_unchecked ( ) ) } }
- else { :: __ :: Option :: None } }
- /// Returns a reference to the boxed value, blindly assuming it to be of type `T`.
- /// If you are not *absolutely certain* of `T`, you *must not* call this.
- # [ inline ] pub unsafe fn downcast_ref_unchecked < T : Person < >> ( & self
- ) -> & T { & * ( self as * const Self as * const T ) }
- /// Returns some mutable reference to the boxed value if it is of type `T`, or
- /// `None` if it isn't.
- # [ inline ] pub fn downcast_mut < T : Person < >> ( & mut self ) -> :: __ ::
- Option < & mut T > {
- if self . is :: < T > ( ) {
- unsafe { :: __ :: Option :: Some ( self . downcast_mut_unchecked ( ) ) } }
- else { :: __ :: Option :: None } }
- /// Returns a mutable reference to the boxed value, blindly assuming it to be of type `T`.
- /// If you are not *absolutely certain* of `T`, you *must not* call this.
- # [ inline ] pub unsafe fn downcast_mut_unchecked < T : Person < >> (
- & mut self ) -> & mut T { & mut * ( self as * mut Self as * mut T ) } } }
- example! { ( ) then parse_generic ! ( Person ) }
- example! { @ inner ( ) ( ) ( parse_generic Person ) }
- parse_generic! { ( Person ) ( ) }
- parse_generics_shim! { { .. } , then mopafy_internal ! ( Person ) , }
- parse_generics_shim! { @ parse_start { { .. } , ( mopafy_internal ! ( Person ) ) } , }
- parse_generics_shim! { @ emit_output { { .. } , ( mopafy_internal ! ( Person ) ) } , {
- constr : [ ] , ltimes : [ ] , tnames : [ ] , } , }
- parse_generics_shim_util! { @ callback ( mopafy_internal ! ( Person ) ) , {
- constr : [ ] , params : [ ] , ltimes : [ ] , tnames : [ ] , .. } , }
- mopafy_internal! { Person { constr : [ ] , params : [ ] , ltimes : [ ] , tnames : [ ] , .. }
- , }
- as_item! { # [ allow ( dead_code ) ] impl < > Person < > {
- /// Returns the boxed value if it is of type `T`, or `Err(Self)` if it isn't.
- # [ inline ] pub fn downcast < T : Person < >> ( self : Box < Self > ) -> ::
- __ :: Result < Box < T > , Box < Self >> {
- if self . is :: < T > ( ) {
- unsafe { :: __ :: Result :: Ok ( self . downcast_unchecked ( ) ) } } else {
- :: __ :: Result :: Err ( self ) } }
- /// Returns the boxed value, blindly assuming it to be of type `T`.
- /// If you are not *absolutely certain* of `T`, you *must not* call this.
- # [ inline ] pub unsafe fn downcast_unchecked < T : Person < >> (
- self : Box < Self > ) -> Box < T > {
- Box :: from_raw ( Box :: into_raw ( self ) as * mut T ) } } }
- mopafy! { Parameterized < A , B > }
- mopafy_only_core! { Parameterized < A , B > }
- parse_generics_shim! { { .. } , then mopafy_only_core_internal ! ( Parameterized ) , < A , B > }
- parse_generics_shim! { @ parse_start { { .. } , ( mopafy_only_core_internal ! ( Parameterized ) ) } ,
- < A , B > }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Parameterized ) ) } , {
- constr : [ ] , ltimes : [ ] , tnames : [ ] , } , A , B > }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Parameterized ) ) } , {
- constr : [ A , ] , ltimes : [ ] , tnames : [ A , ] , } , , B > }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Parameterized ) ) } , {
- constr : [ A , ] , ltimes : [ ] , tnames : [ A , ] , } , B > }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Parameterized ) ) } , {
- constr : [ A , B , ] , ltimes : [ ] , tnames : [ A , B , ] , } , > }
- parse_generics_shim! { @ emit_output { { .. } , ( mopafy_only_core_internal ! ( Parameterized ) ) } ,
- { constr : [ A , B , ] , ltimes : [ ] , tnames : [ A , B , ] , } , }
- parse_generics_shim_util! { @ callback ( mopafy_only_core_internal ! ( Parameterized ) ) , {
- constr : [ A , B , ] , params : [ A , B , ] , ltimes : [ ] , tnames : [
- A , B , ] , .. } , }
- mopafy_only_core_internal! { Parameterized {
- constr : [ A , B , ] , params : [ A , B , ] , ltimes : [ ] , tnames : [
- A , B , ] , .. } , }
- as_item! { # [ allow ( dead_code ) ] impl < A , B , > Parameterized < A , B , > {
- /// Returns true if the boxed type is the same as `T`
- # [ inline ] pub fn is < T : Parameterized < A , B , >> ( & self ) -> bool {
- :: __ :: TypeId :: of :: < T > ( ) == :: Any :: __get_type_id ( self ) }
- /// Returns some reference to the boxed value if it is of type `T`, or
- /// `None` if it isn't.
- # [ inline ] pub fn downcast_ref < T : Parameterized < A , B , >> ( & self )
- -> :: __ :: Option < & T > {
- if self . is :: < T > ( ) {
- unsafe { :: __ :: Option :: Some ( self . downcast_ref_unchecked ( ) ) } }
- else { :: __ :: Option :: None } }
- /// Returns a reference to the boxed value, blindly assuming it to be of type `T`.
- /// If you are not *absolutely certain* of `T`, you *must not* call this.
- # [ inline ] pub unsafe fn downcast_ref_unchecked < T : Parameterized < A , B
- , >> ( & self ) -> & T { & * ( self as * const Self as * const T ) }
- /// Returns some mutable reference to the boxed value if it is of type `T`, or
- /// `None` if it isn't.
- # [ inline ] pub fn downcast_mut < T : Parameterized < A , B , >> (
- & mut self ) -> :: __ :: Option < & mut T > {
- if self . is :: < T > ( ) {
- unsafe { :: __ :: Option :: Some ( self . downcast_mut_unchecked ( ) ) } }
- else { :: __ :: Option :: None } }
- /// Returns a mutable reference to the boxed value, blindly assuming it to be of type `T`.
- /// If you are not *absolutely certain* of `T`, you *must not* call this.
- # [ inline ] pub unsafe fn downcast_mut_unchecked < T : Parameterized < A , B
- , >> ( & mut self ) -> & mut T { & mut * ( self as * mut Self as * mut T ) } } }
- example! { ( < A , B > ) then parse_generic ! ( Parameterized ) }
- example! { @ inner ( < A , B > ) ( ) ( parse_generic Parameterized ) }
- example! { @ inner ( A , B > ) ( < ) ( parse_generic Parameterized ) }
- example! { @ inner ( , B > ) ( < A ) ( parse_generic Parameterized ) }
- example! { @ inner ( B > ) ( < A , ) ( parse_generic Parameterized ) }
- example! { @ inner ( > ) ( < A , B ) ( parse_generic Parameterized ) }
- example! { @ inner ( ) ( < A , B > ) ( parse_generic Parameterized ) }
- parse_generic! { ( Parameterized ) ( < A , B > ) }
- parse_generics_shim! { { .. } , then mopafy_internal ! ( Parameterized ) , < A , B > }
- parse_generics_shim! { @ parse_start { { .. } , ( mopafy_internal ! ( Parameterized ) ) } , < A , B > }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_internal ! ( Parameterized ) ) } , {
- constr : [ ] , ltimes : [ ] , tnames : [ ] , } , A , B > }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_internal ! ( Parameterized ) ) } , {
- constr : [ A , ] , ltimes : [ ] , tnames : [ A , ] , } , , B > }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_internal ! ( Parameterized ) ) } , {
- constr : [ A , ] , ltimes : [ ] , tnames : [ A , ] , } , B > }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_internal ! ( Parameterized ) ) } , {
- constr : [ A , B , ] , ltimes : [ ] , tnames : [ A , B , ] , } , > }
- parse_generics_shim! { @ emit_output { { .. } , ( mopafy_internal ! ( Parameterized ) ) } , {
- constr : [ A , B , ] , ltimes : [ ] , tnames : [ A , B , ] , } , }
- parse_generics_shim_util! { @ callback ( mopafy_internal ! ( Parameterized ) ) , {
- constr : [ A , B , ] , params : [ A , B , ] , ltimes : [ ] , tnames : [
- A , B , ] , .. } , }
- mopafy_internal! { Parameterized {
- constr : [ A , B , ] , params : [ A , B , ] , ltimes : [ ] , tnames : [
- A , B , ] , .. } , }
- as_item! { # [ allow ( dead_code ) ] impl < A , B , > Parameterized < A , B , > {
- /// Returns the boxed value if it is of type `T`, or `Err(Self)` if it isn't.
- # [ inline ] pub fn downcast < T : Parameterized < A , B , >> (
- self : Box < Self > ) -> :: __ :: Result < Box < T > , Box < Self >> {
- if self . is :: < T > ( ) {
- unsafe { :: __ :: Result :: Ok ( self . downcast_unchecked ( ) ) } } else {
- :: __ :: Result :: Err ( self ) } }
- /// Returns the boxed value, blindly assuming it to be of type `T`.
- /// If you are not *absolutely certain* of `T`, you *must not* call this.
- # [ inline ] pub unsafe fn downcast_unchecked < T : Parameterized < A , B ,
- >> ( self : Box < Self > ) -> Box < T > {
- Box :: from_raw ( Box :: into_raw ( self ) as * mut T ) } } }
- src/lib.rs:214:1: 216:2 warning: function is never used: `main`, #[warn(dead_code)] on by defaultmopafy! { Constrained < X , F : Float , D : Deep < F >> }
- src/lib.rs:214 fn main(){
- ^
- mopafy_only_core! { Constrained < X , F : Float , D : Deep < F >> }
- parse_generics_shim! { { .. } , then mopafy_only_core_internal ! ( Constrained ) , < X , F : Float ,
- D : Deep < F >> }
- parse_generics_shim! { @ parse_start { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , <
- X , F : Float , D : Deep < F >> }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ ] , ltimes : [ ] , tnames : [ ] , } , X , F : Float , D : Deep <
- F >> }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , ] , ltimes : [ ] , tnames : [ X , ] , } , , F : Float , D :
- Deep < F >> }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , ] , ltimes : [ ] , tnames : [ X , ] , } , F : Float , D : Deep
- < F >> }
- parse_constr! { ( true , true ) , then parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , ] , ltimes : [ ] , tnames : [ X , ] , } , F : } , Float , D :
- Deep < F >> }
- parse_constr! { @ parse {
- (
- parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , ] , ltimes : [ ] , tnames : [ X , ] , } , F : } ) } , (
- true , true ) , { } , Float , D : Deep < F >> }
- parse_constr! { @ parse {
- (
- parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , ] , ltimes : [ ] , tnames : [ X , ] , } , F : } ) } , (
- false , true ) , { Float } , , D : Deep < F >> }
- parse_generics_shim_util! { @ callback (
- parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , ] , ltimes : [ ] , tnames : [ X , ] , } , F : } ) , { Float }
- , , D : Deep < F >> }
- parse_generics_shim! { @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , ] , ltimes : [ ] , tnames : [ X , ] , } , F : { Float } , , D
- : Deep < F >> }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , F : Float , ] , ltimes : [ ] , tnames : [ X , F , ] , } , , D
- : Deep < F >> }
- parse_generics_shim! { @ parse { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , F : Float , ] , ltimes : [ ] , tnames : [ X , F , ] , } , D :
- Deep < F >> }
- parse_constr! { ( true , true ) , then parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , F : Float , ] , ltimes : [ ] , tnames : [ X , F , ] , } , D :
- } , Deep < F >> }
- parse_constr! { @ parse {
- (
- parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , F : Float , ] , ltimes : [ ] , tnames : [ X , F , ] , } , D :
- } ) } , ( true , true ) , { } , Deep < F >> }
- parse_constr! { @ parse {
- (
- parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , F : Float , ] , ltimes : [ ] , tnames : [ X , F , ] , } , D :
- } ) } , ( false , true ) , { Deep } , < F >> }
- parse_constr! { @ parse_delim {
- {
- (
- parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , F : Float , ] , ltimes : [ ] , tnames : [ X , F , ] , } , D :
- } ) } , ( false , true ) } , [ # ] , { Deep < } , F >> }
- parse_constr! { @ parse_delim {
- {
- (
- parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , F : Float , ] , ltimes : [ ] , tnames : [ X , F , ] , } , D :
- } ) } , ( false , true ) } , [ # ] , { Deep < F } , >> }
- parse_constr! { @ parse_delim {
- {
- (
- parse_generics_shim ! {
- @ app_ty { { .. } , ( mopafy_only_core_internal ! ( Constrained ) ) } , {
- constr : [ X , F : Float , ] , ltimes : [ ] , tnames : [ X , F , ] , } , D :
- } ) } , ( false , true ) } , [ # ] , { Deep < F >> } , }
- <parse_generics_shim macros>:207:65: 207:66 error: unexpected end of macro invocation
- <parse_generics_shim macros>:207 @ parse_delim $ prefix , $ stack , { $ ( $ constr ) * $ other } , $ ( $ body )
- ^
- Build failed, waiting for other jobs to finish...
- error: Could not compile `mopa`.
- T
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement