[INFO] fetching crate windows-implement 0.100.0...
[INFO] testing windows-implement-0.100.0 against 1.101.0-beta.1+cargoflags=--release for beta-release-1.101-2
[INFO] extracting crate windows-implement 0.100.0 into /workspace/builds/worker-7-tc2/source
[INFO] started tweaking crates.io crate windows-implement 0.100.0
[INFO] finished tweaking crates.io crate windows-implement 0.100.0
[INFO] tweaked toml for crates.io crate windows-implement 0.100.0 written to /workspace/builds/worker-7-tc2/source/Cargo.toml
[INFO] validating manifest of crates.io crate windows-implement 0.100.0 on toolchain 1.101.0-beta.1
[INFO] running `"cargo" "+1.101.0-beta.1" "metadata" "--manifest-path" "Cargo.toml" "--no-deps"`
[INFO] crate crates.io crate windows-implement 0.100.0 already has a lockfile, it will not be regenerated
[INFO] running `"cargo" "+1.101.0-beta.1" "fetch" "--manifest-path" "Cargo.toml"`
[INFO] running `"docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-m" "1610612736" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:13253766d39459fde29cea4e7c35a3fe37c2c19b4a224f71f2c27711c2837d36" "sleep" "infinity"`
[INFO] [stdout] ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5
[INFO] running `"docker" "start" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5"`
[INFO] running `"docker" "inspect" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5"`
[INFO] running `"docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-w" "/opt/rustwide/workdir" "--user" "0:0" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5" "/opt/rustwide/cargo-home/bin/cargo" "+1.101.0-beta.1" "metadata" "--no-deps" "--format-version=1"`
[INFO] running `"docker" "inspect" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5"`
[INFO] running `"docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-w" "/opt/rustwide/workdir" "--user" "0:0" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5" "/opt/rustwide/cargo-home/bin/cargo" "+1.101.0-beta.1" "build" "--frozen" "--message-format=json" "--release"`
[INFO] [stderr]    Compiling syn v2.0.119
[INFO] [stderr]    Compiling windows-implement v0.100.0 (/opt/rustwide/workdir)
[INFO] [stderr]     Finished `release` profile [optimized] target(s) in 6.06s
[INFO] running `"docker" "inspect" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5"`
[INFO] running `"docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-w" "/opt/rustwide/workdir" "--user" "0:0" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5" "/opt/rustwide/cargo-home/bin/cargo" "+1.101.0-beta.1" "test" "--frozen" "--no-run" "--message-format=json" "--release"`
[INFO] [stderr]    Compiling windows-implement v0.100.0 (/opt/rustwide/workdir)
[INFO] [stderr]     Finished `release` profile [optimized] target(s) in 4.50s
[INFO] running `"docker" "inspect" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5"`
[INFO] running `"docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-w" "/opt/rustwide/workdir" "--user" "0:0" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5" "/opt/rustwide/cargo-home/bin/cargo" "+1.101.0-beta.1" "test" "--frozen" "--release"`
[INFO] [stderr]     Finished `release` profile [optimized] target(s) in 0.02s
[INFO] [stderr]      Running unittests src/lib.rs (/opt/rustwide/target/release/build/windows-implement/88d5015b01b23bb1/out/windows_implement-88d5015b01b23bb1)
[INFO] [stdout] 
[INFO] [stdout] running 9 tests
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::not_agile ... ok
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::simple_type ... FAILED
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::namespaced_interface ... FAILED
[INFO] [stdout] test tests::tuple_type ... FAILED
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::no_interfaces ... FAILED
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::zero_sized_type ... FAILED
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::two_interfaces ... FAILED
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::generic_no_lifetime ... FAILED
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.101.0-beta.1-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.101.0-beta.1-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::generic_with_lifetime ... FAILED
[INFO] [stdout] 
[INFO] [stdout] failures:
[INFO] [stdout] 
[INFO] [stdout] ---- tests::simple_type stdout ----
[INFO] [stdout] rustfmt terminated with failure status code
[INFO] [stdout] // output of #[implement] :
[INFO] [stdout] 
[INFO] [stdout] struct Foo { x : u32 , } impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , interface1_ifoo : & Foo_Impl :: < > :: VTABLE_INTERFACE1_IFOO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_ifoo : & 'static < IFoo < > as :: windows_core :: Interface > :: Vtable , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_IFOO : < IFoo < > as :: windows_core :: Interface > :: Vtable = < IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Foo_Impl :: < > , - 2isize , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_ifoo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for IFoo < > { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IFoo < > > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_ifoo) } } } impl :: windows_core :: AsImpl < Foo :: < > > for IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Foo :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Foo_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Foo :: < > as * mut Foo :: < >) } } }
[INFO] [stdout] 
[INFO] [stdout] thread 'tests::simple_type' (252) panicked at src/tests.rs:32:9:
[INFO] [stdout] output does not contain expected item:
[INFO] [stdout]   expected: impl ::core::ops::Deref for Foo_Impl
[INFO] [stdout] 
[INFO] [stdout] full output:
[INFO] [stdout] struct Foo { x : u32 , } impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , interface1_ifoo : & Foo_Impl :: < > :: VTABLE_INTERFACE1_IFOO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_ifoo : & 'static < IFoo < > as :: windows_core :: Interface > :: Vtable , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_IFOO : < IFoo < > as :: windows_core :: Interface > :: Vtable = < IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Foo_Impl :: < > , - 2isize , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_ifoo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for IFoo < > { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IFoo < > > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_ifoo) } } } impl :: windows_core :: AsImpl < Foo :: < > > for IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Foo :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Foo_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Foo :: < > as * mut Foo :: < >) } } }
[INFO] [stdout] stack backtrace:
[INFO] [stdout]    0:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::trace_unsynchronized::<std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x7366907419f1 - std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x7366907419f1 - <<std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[5c14b8d5a259cc4e]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x73669078963a - <core[5c14b8d5a259cc4e]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x73669078963a - core[5c14b8d5a259cc4e]::fmt::write
[INFO] [stdout]    6:     0x736690753d1c - core[5c14b8d5a259cc4e]::io::write::default_write_fmt::<alloc[f65cf102c2e86268]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x736690753d1c - <alloc[f65cf102c2e86268]::vec::Vec<u8> as core[5c14b8d5a259cc4e]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x73669070a006 - <std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x73669070a006 - std[218a0f7bb9a8af32]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x736690731b79 - std[218a0f7bb9a8af32]::panicking::default_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x56583e254e50 - test[2df5162924bba3e2]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x736690731ea2 - <alloc[f65cf102c2e86268]::boxed::Box<dyn for<'a, 'b> core[5c14b8d5a259cc4e]::ops::function::Fn<(&'a std[218a0f7bb9a8af32]::panic::PanicHookInfo<'b>,), Output = ()> + core[5c14b8d5a259cc4e]::marker::Sync + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::Fn<(&std[218a0f7bb9a8af32]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2480:9
[INFO] [stdout]   13:     0x736690731ea2 - std[218a0f7bb9a8af32]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x73669070a0b2 - std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x7366907000c9 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_end_short_backtrace::<std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x73669070bc3d - __rustc[abc93889656912e2]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x73669078a71c - core[5c14b8d5a259cc4e]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x56583e2291fe - <windows_implement[7f29206608a99f54]::tests::simple_type::{closure#0} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x56583e247cbb - test[2df5162924bba3e2]::__rust_begin_short_backtrace::<core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>, fn() -> core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>>
[INFO] [stdout]   20:     0x56583e255475 - test[2df5162924bba3e2]::run_test::{closure#0}
[INFO] [stdout]   21:     0x56583e24e8c4 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_begin_short_backtrace::<test[2df5162924bba3e2]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x56583e258402 - <std[218a0f7bb9a8af32]::thread::lifecycle::spawn_unchecked<test[2df5162924bba3e2]::run_test::{closure#1}, ()>::{closure#1} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x73669073d37f - <alloc[f65cf102c2e86268]::boxed::Box<dyn core[5c14b8d5a259cc4e]::ops::function::FnOnce<(), Output = ()> + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2466:9
[INFO] [stdout]   24:     0x73669073d37f - <std[218a0f7bb9a8af32]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x736690495dfa - <unknown>
[INFO] [stdout]   26:     0x7366905293d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[INFO] [stdout] 
[INFO] [stdout] ---- tests::namespaced_interface stdout ----
[INFO] [stdout] rustfmt terminated with failure status code
[INFO] [stdout] // output of #[implement] :
[INFO] [stdout] 
[INFO] [stdout] struct Foo ; impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , interface1_windowswin32ifoo : & Foo_Impl :: < > :: VTABLE_INTERFACE1_WINDOWSWIN32IFOO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_windowswin32ifoo : & 'static < Windows :: Win32 :: IFoo < > as :: windows_core :: Interface > :: Vtable , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , Windows :: Win32 :: IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_WINDOWSWIN32IFOO : < Windows :: Win32 :: IFoo < > as :: windows_core :: Interface > :: Vtable = < Windows :: Win32 :: IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Foo_Impl :: < > , - 2isize , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < Windows :: Win32 :: IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_windowswin32ifoo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for Windows :: Win32 :: IFoo < > { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < Windows :: Win32 :: IFoo < > > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , Windows :: Win32 :: IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_windowswin32ifoo) } } } impl :: windows_core :: AsImpl < Foo :: < > > for Windows :: Win32 :: IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Foo :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Foo_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Foo :: < > as * mut Foo :: < >) } } }
[INFO] [stdout] 
[INFO] [stdout] thread 'tests::namespaced_interface' (249) panicked at src/tests.rs:32:9:
[INFO] [stdout] output does not contain expected item:
[INFO] [stdout]   expected: impl ::windows_core::AsImpl<Foo> for Windows::Win32::IFoo
[INFO] [stdout] 
[INFO] [stdout] full output:
[INFO] [stdout] struct Foo ; impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , interface1_windowswin32ifoo : & Foo_Impl :: < > :: VTABLE_INTERFACE1_WINDOWSWIN32IFOO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_windowswin32ifoo : & 'static < Windows :: Win32 :: IFoo < > as :: windows_core :: Interface > :: Vtable , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , Windows :: Win32 :: IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_WINDOWSWIN32IFOO : < Windows :: Win32 :: IFoo < > as :: windows_core :: Interface > :: Vtable = < Windows :: Win32 :: IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Foo_Impl :: < > , - 2isize , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < Windows :: Win32 :: IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_windowswin32ifoo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for Windows :: Win32 :: IFoo < > { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < Windows :: Win32 :: IFoo < > > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , Windows :: Win32 :: IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_windowswin32ifoo) } } } impl :: windows_core :: AsImpl < Foo :: < > > for Windows :: Win32 :: IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Foo :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Foo_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Foo :: < > as * mut Foo :: < >) } } }
[INFO] [stdout] stack backtrace:
[INFO] [stdout]    0:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::trace_unsynchronized::<std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x7366907419f1 - std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x7366907419f1 - <<std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[5c14b8d5a259cc4e]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x73669078963a - <core[5c14b8d5a259cc4e]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x73669078963a - core[5c14b8d5a259cc4e]::fmt::write
[INFO] [stdout]    6:     0x736690753d1c - core[5c14b8d5a259cc4e]::io::write::default_write_fmt::<alloc[f65cf102c2e86268]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x736690753d1c - <alloc[f65cf102c2e86268]::vec::Vec<u8> as core[5c14b8d5a259cc4e]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x73669070a006 - <std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x73669070a006 - std[218a0f7bb9a8af32]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x736690731b79 - std[218a0f7bb9a8af32]::panicking::default_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x56583e254e50 - test[2df5162924bba3e2]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x736690731ea2 - <alloc[f65cf102c2e86268]::boxed::Box<dyn for<'a, 'b> core[5c14b8d5a259cc4e]::ops::function::Fn<(&'a std[218a0f7bb9a8af32]::panic::PanicHookInfo<'b>,), Output = ()> + core[5c14b8d5a259cc4e]::marker::Sync + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::Fn<(&std[218a0f7bb9a8af32]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2480:9
[INFO] [stdout]   13:     0x736690731ea2 - std[218a0f7bb9a8af32]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x73669070a0b2 - std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x7366907000c9 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_end_short_backtrace::<std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x73669070bc3d - __rustc[abc93889656912e2]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x73669078a71c - core[5c14b8d5a259cc4e]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x56583e22a19d - <windows_implement[7f29206608a99f54]::tests::namespaced_interface::{closure#0} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x56583e247cbb - test[2df5162924bba3e2]::__rust_begin_short_backtrace::<core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>, fn() -> core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>>
[INFO] [stdout]   20:     0x56583e255475 - test[2df5162924bba3e2]::run_test::{closure#0}
[INFO] [stdout]   21:     0x56583e24e8c4 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_begin_short_backtrace::<test[2df5162924bba3e2]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x56583e258402 - <std[218a0f7bb9a8af32]::thread::lifecycle::spawn_unchecked<test[2df5162924bba3e2]::run_test::{closure#1}, ()>::{closure#1} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x73669073d37f - <alloc[f65cf102c2e86268]::boxed::Box<dyn core[5c14b8d5a259cc4e]::ops::function::FnOnce<(), Output = ()> + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2466:9
[INFO] [stdout]   24:     0x73669073d37f - <std[218a0f7bb9a8af32]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x736690495dfa - <unknown>
[INFO] [stdout]   26:     0x7366905293d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[INFO] [stdout] 
[INFO] [stdout] ---- tests::tuple_type stdout ----
[INFO] [stdout] rustfmt terminated with failure status code
[INFO] [stdout] // output of #[implement] :
[INFO] [stdout] 
[INFO] [stdout] struct Foo (pub i32) ; impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , interface1_ifoo : & Foo_Impl :: < > :: VTABLE_INTERFACE1_IFOO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_ifoo : & 'static < IFoo < > as :: windows_core :: Interface > :: Vtable , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_IFOO : < IFoo < > as :: windows_core :: Interface > :: Vtable = < IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Foo_Impl :: < > , - 2isize , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_ifoo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for IFoo < > { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IFoo < > > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_ifoo) } } } impl :: windows_core :: AsImpl < Foo :: < > > for IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Foo :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Foo_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Foo :: < > as * mut Foo :: < >) } } }
[INFO] [stdout] 
[INFO] [stdout] thread 'tests::tuple_type' (253) panicked at src/tests.rs:32:9:
[INFO] [stdout] output does not contain expected item:
[INFO] [stdout]   expected: impl ::windows_core::IUnknownImpl for Foo_Impl
[INFO] [stdout] 
[INFO] [stdout] full output:
[INFO] [stdout] struct Foo (pub i32) ; impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , interface1_ifoo : & Foo_Impl :: < > :: VTABLE_INTERFACE1_IFOO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_ifoo : & 'static < IFoo < > as :: windows_core :: Interface > :: Vtable , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_IFOO : < IFoo < > as :: windows_core :: Interface > :: Vtable = < IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Foo_Impl :: < > , - 2isize , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_ifoo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for IFoo < > { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IFoo < > > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_ifoo) } } } impl :: windows_core :: AsImpl < Foo :: < > > for IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Foo :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Foo_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Foo :: < > as * mut Foo :: < >) } } }
[INFO] [stdout] stack backtrace:
[INFO] [stdout]    0:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::trace_unsynchronized::<std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x7366907419f1 - std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x7366907419f1 - <<std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[5c14b8d5a259cc4e]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x73669078963a - <core[5c14b8d5a259cc4e]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x73669078963a - core[5c14b8d5a259cc4e]::fmt::write
[INFO] [stdout]    6:     0x736690753d1c - core[5c14b8d5a259cc4e]::io::write::default_write_fmt::<alloc[f65cf102c2e86268]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x736690753d1c - <alloc[f65cf102c2e86268]::vec::Vec<u8> as core[5c14b8d5a259cc4e]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x73669070a006 - <std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x73669070a006 - std[218a0f7bb9a8af32]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x736690731b79 - std[218a0f7bb9a8af32]::panicking::default_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x56583e254e50 - test[2df5162924bba3e2]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x736690731ea2 - <alloc[f65cf102c2e86268]::boxed::Box<dyn for<'a, 'b> core[5c14b8d5a259cc4e]::ops::function::Fn<(&'a std[218a0f7bb9a8af32]::panic::PanicHookInfo<'b>,), Output = ()> + core[5c14b8d5a259cc4e]::marker::Sync + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::Fn<(&std[218a0f7bb9a8af32]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2480:9
[INFO] [stdout]   13:     0x736690731ea2 - std[218a0f7bb9a8af32]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x73669070a0b2 - std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x7366907000c9 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_end_short_backtrace::<std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x73669070bc3d - __rustc[abc93889656912e2]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x73669078a71c - core[5c14b8d5a259cc4e]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x56583e228e8c - <windows_implement[7f29206608a99f54]::tests::tuple_type::{closure#0} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x56583e247cbb - test[2df5162924bba3e2]::__rust_begin_short_backtrace::<core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>, fn() -> core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>>
[INFO] [stdout]   20:     0x56583e255475 - test[2df5162924bba3e2]::run_test::{closure#0}
[INFO] [stdout]   21:     0x56583e24e8c4 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_begin_short_backtrace::<test[2df5162924bba3e2]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x56583e258402 - <std[218a0f7bb9a8af32]::thread::lifecycle::spawn_unchecked<test[2df5162924bba3e2]::run_test::{closure#1}, ()>::{closure#1} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x73669073d37f - <alloc[f65cf102c2e86268]::boxed::Box<dyn core[5c14b8d5a259cc4e]::ops::function::FnOnce<(), Output = ()> + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2466:9
[INFO] [stdout]   24:     0x73669073d37f - <std[218a0f7bb9a8af32]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x736690495dfa - <unknown>
[INFO] [stdout]   26:     0x7366905293d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[INFO] [stdout] 
[INFO] [stdout] ---- tests::no_interfaces stdout ----
[INFO] [stdout] rustfmt terminated with failure status code
[INFO] [stdout] // output of #[implement] :
[INFO] [stdout] 
[INFO] [stdout] struct Foo { } impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , :: windows_core :: IInspectable , - 1 , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } }
[INFO] [stdout] 
[INFO] [stdout] thread 'tests::no_interfaces' (250) panicked at src/tests.rs:32:9:
[INFO] [stdout] output does not contain expected item:
[INFO] [stdout]   expected: impl ::windows_core::IUnknownImpl for Foo_Impl
[INFO] [stdout] 
[INFO] [stdout] full output:
[INFO] [stdout] struct Foo { } impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , :: windows_core :: IInspectable , - 1 , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } }
[INFO] [stdout] stack backtrace:
[INFO] [stdout]    0:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::trace_unsynchronized::<std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x7366907419f1 - std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x7366907419f1 - <<std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[5c14b8d5a259cc4e]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x73669078963a - <core[5c14b8d5a259cc4e]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x73669078963a - core[5c14b8d5a259cc4e]::fmt::write
[INFO] [stdout]    6:     0x736690753d1c - core[5c14b8d5a259cc4e]::io::write::default_write_fmt::<alloc[f65cf102c2e86268]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x736690753d1c - <alloc[f65cf102c2e86268]::vec::Vec<u8> as core[5c14b8d5a259cc4e]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x73669070a006 - <std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x73669070a006 - std[218a0f7bb9a8af32]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x736690731b79 - std[218a0f7bb9a8af32]::panicking::default_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x56583e254e50 - test[2df5162924bba3e2]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x736690731ea2 - <alloc[f65cf102c2e86268]::boxed::Box<dyn for<'a, 'b> core[5c14b8d5a259cc4e]::ops::function::Fn<(&'a std[218a0f7bb9a8af32]::panic::PanicHookInfo<'b>,), Output = ()> + core[5c14b8d5a259cc4e]::marker::Sync + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::Fn<(&std[218a0f7bb9a8af32]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2480:9
[INFO] [stdout]   13:     0x736690731ea2 - std[218a0f7bb9a8af32]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x73669070a0b2 - std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x7366907000c9 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_end_short_backtrace::<std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x73669070bc3d - __rustc[abc93889656912e2]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x73669078a71c - core[5c14b8d5a259cc4e]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x56583e22946a - <windows_implement[7f29206608a99f54]::tests::no_interfaces::{closure#0} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x56583e247cbb - test[2df5162924bba3e2]::__rust_begin_short_backtrace::<core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>, fn() -> core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>>
[INFO] [stdout]   20:     0x56583e255475 - test[2df5162924bba3e2]::run_test::{closure#0}
[INFO] [stdout]   21:     0x56583e24e8c4 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_begin_short_backtrace::<test[2df5162924bba3e2]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x56583e258402 - <std[218a0f7bb9a8af32]::thread::lifecycle::spawn_unchecked<test[2df5162924bba3e2]::run_test::{closure#1}, ()>::{closure#1} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x73669073d37f - <alloc[f65cf102c2e86268]::boxed::Box<dyn core[5c14b8d5a259cc4e]::ops::function::FnOnce<(), Output = ()> + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2466:9
[INFO] [stdout]   24:     0x73669073d37f - <std[218a0f7bb9a8af32]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x736690495dfa - <unknown>
[INFO] [stdout]   26:     0x7366905293d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[INFO] [stdout] 
[INFO] [stdout] ---- tests::zero_sized_type stdout ----
[INFO] [stdout] rustfmt terminated with failure status code
[INFO] [stdout] // output of #[implement] :
[INFO] [stdout] 
[INFO] [stdout] struct Foo ; impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , interface1_ifoo : & Foo_Impl :: < > :: VTABLE_INTERFACE1_IFOO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_ifoo : & 'static < IFoo < > as :: windows_core :: Interface > :: Vtable , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_IFOO : < IFoo < > as :: windows_core :: Interface > :: Vtable = < IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Foo_Impl :: < > , - 2isize , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_ifoo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for IFoo < > { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IFoo < > > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_ifoo) } } } impl :: windows_core :: AsImpl < Foo :: < > > for IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Foo :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Foo_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Foo :: < > as * mut Foo :: < >) } } }
[INFO] [stdout] 
[INFO] [stdout] thread 'tests::zero_sized_type' (255) panicked at src/tests.rs:32:9:
[INFO] [stdout] output does not contain expected item:
[INFO] [stdout]   expected: impl ::windows_core::IUnknownImpl for Foo_Impl
[INFO] [stdout] 
[INFO] [stdout] full output:
[INFO] [stdout] struct Foo ; impl Foo :: < > { # [inline (always)] const fn into_outer (self) -> Foo_Impl :: < > { Foo_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < > :: VTABLE_IDENTITY , interface1_ifoo : & Foo_Impl :: < > :: VTABLE_INTERFACE1_IFOO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Foo_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_ifoo : & 'static < IFoo < > as :: windows_core :: Interface > :: Vtable , this : Foo :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Foo_Impl :: < > { type Target = Foo :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Foo_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < > , IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_IFOO : < IFoo < > as :: windows_core :: Interface > :: Vtable = < IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Foo_Impl :: < > , - 2isize , > () ; } impl :: windows_core :: IUnknownImpl for Foo_Impl :: < > { type Impl = Foo :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_ifoo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Foo :: < > { type Outer = Foo_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Foo :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Foo :: < > > for IFoo < > { # [inline (always)] fn from (this : Foo :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IFoo < > > for Foo_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_ifoo) } } } impl :: windows_core :: AsImpl < Foo :: < > > for IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Foo :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Foo_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Foo :: < > as * mut Foo :: < >) } } }
[INFO] [stdout] stack backtrace:
[INFO] [stdout]    0:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::trace_unsynchronized::<std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x7366907419f1 - std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x7366907419f1 - <<std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[5c14b8d5a259cc4e]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x73669078963a - <core[5c14b8d5a259cc4e]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x73669078963a - core[5c14b8d5a259cc4e]::fmt::write
[INFO] [stdout]    6:     0x736690753d1c - core[5c14b8d5a259cc4e]::io::write::default_write_fmt::<alloc[f65cf102c2e86268]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x736690753d1c - <alloc[f65cf102c2e86268]::vec::Vec<u8> as core[5c14b8d5a259cc4e]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x73669070a006 - <std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x73669070a006 - std[218a0f7bb9a8af32]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x736690731b79 - std[218a0f7bb9a8af32]::panicking::default_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x56583e254e50 - test[2df5162924bba3e2]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x736690731ea2 - <alloc[f65cf102c2e86268]::boxed::Box<dyn for<'a, 'b> core[5c14b8d5a259cc4e]::ops::function::Fn<(&'a std[218a0f7bb9a8af32]::panic::PanicHookInfo<'b>,), Output = ()> + core[5c14b8d5a259cc4e]::marker::Sync + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::Fn<(&std[218a0f7bb9a8af32]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2480:9
[INFO] [stdout]   13:     0x736690731ea2 - std[218a0f7bb9a8af32]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x73669070a0b2 - std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x7366907000c9 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_end_short_backtrace::<std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x73669070bc3d - __rustc[abc93889656912e2]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x73669078a71c - core[5c14b8d5a259cc4e]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x56583e2299ed - <windows_implement[7f29206608a99f54]::tests::zero_sized_type::{closure#0} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x56583e247cbb - test[2df5162924bba3e2]::__rust_begin_short_backtrace::<core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>, fn() -> core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>>
[INFO] [stdout]   20:     0x56583e255475 - test[2df5162924bba3e2]::run_test::{closure#0}
[INFO] [stdout]   21:     0x56583e24e8c4 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_begin_short_backtrace::<test[2df5162924bba3e2]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x56583e258402 - <std[218a0f7bb9a8af32]::thread::lifecycle::spawn_unchecked<test[2df5162924bba3e2]::run_test::{closure#1}, ()>::{closure#1} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x73669073d37f - <alloc[f65cf102c2e86268]::boxed::Box<dyn core[5c14b8d5a259cc4e]::ops::function::FnOnce<(), Output = ()> + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2466:9
[INFO] [stdout]   24:     0x73669073d37f - <std[218a0f7bb9a8af32]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x736690495dfa - <unknown>
[INFO] [stdout]   26:     0x7366905293d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[INFO] [stdout] 
[INFO] [stdout] ---- tests::two_interfaces stdout ----
[INFO] [stdout] rustfmt terminated with failure status code
[INFO] [stdout] // output of #[implement] :
[INFO] [stdout] 
[INFO] [stdout] struct Baz ; impl Baz :: < > { # [inline (always)] const fn into_outer (self) -> Baz_Impl :: < > { Baz_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Baz_Impl :: < > :: VTABLE_IDENTITY , interface1_ifoo : & Baz_Impl :: < > :: VTABLE_INTERFACE1_IFOO , interface2_ibar : & Baz_Impl :: < > :: VTABLE_INTERFACE2_IBAR , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Baz_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_ifoo : & 'static < IFoo < > as :: windows_core :: Interface > :: Vtable , interface2_ibar : & 'static < IBar < > as :: windows_core :: Interface > :: Vtable , this : Baz :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Baz_Impl :: < > { type Target = Baz :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Baz_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Baz_Impl :: < > , IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_IFOO : < IFoo < > as :: windows_core :: Interface > :: Vtable = < IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Baz_Impl :: < > , - 2isize , > () ; const VTABLE_INTERFACE2_IBAR : < IBar < > as :: windows_core :: Interface > :: Vtable = < IBar < > as :: windows_core :: Interface > :: Vtable :: new :: < Baz_Impl :: < > , - 3isize , > () ; } impl :: windows_core :: IUnknownImpl for Baz_Impl :: < > { type Impl = Baz :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_ifoo as * const _ as * const :: core :: ffi :: c_void ; } if < IBar < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface2_ibar as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Baz :: < > { type Outer = Baz_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Baz :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Baz :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Baz :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Baz :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Baz :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Baz :: < > > for IFoo < > { # [inline (always)] fn from (this : Baz :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Baz :: < > > for IBar < > { # [inline (always)] fn from (this : Baz :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Baz_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Baz_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IFoo < > > for Baz_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_ifoo) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IBar < > > for Baz_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IBar < > > { unsafe { :: core :: mem :: transmute (& self . interface2_ibar) } } } impl :: windows_core :: AsImpl < Baz :: < > > for IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Baz :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Baz_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Baz :: < > as * mut Baz :: < >) } } } impl :: windows_core :: AsImpl < Baz :: < > > for IBar < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Baz :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 1usize) as * mut Baz_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Baz :: < > as * mut Baz :: < >) } } }
[INFO] [stdout] 
[INFO] [stdout] thread 'tests::two_interfaces' (254) panicked at src/tests.rs:32:9:
[INFO] [stdout] output does not contain expected item:
[INFO] [stdout]   expected: impl ::windows_core::IUnknownImpl for Baz_Impl
[INFO] [stdout] 
[INFO] [stdout] full output:
[INFO] [stdout] struct Baz ; impl Baz :: < > { # [inline (always)] const fn into_outer (self) -> Baz_Impl :: < > { Baz_Impl :: < > { base : :: windows_core :: ComposeBase :: new () , identity : & Baz_Impl :: < > :: VTABLE_IDENTITY , interface1_ifoo : & Baz_Impl :: < > :: VTABLE_INTERFACE1_IFOO , interface2_ibar : & Baz_Impl :: < > :: VTABLE_INTERFACE2_IBAR , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } # [doc = r" This converts a partially-constructed COM object (containing application state but"] # [doc = r" without vtable and reference count yet set up) into a `StaticComObject`. This allows"] # [doc = r" the COM object to be stored in static (global) variables."] pub const fn into_static (self) -> :: windows_core :: StaticComObject < Self > { :: windows_core :: StaticComObject :: from_outer (self . into_outer ()) } } # [repr (C)] # [allow (non_camel_case_types)] struct Baz_Impl { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_ifoo : & 'static < IFoo < > as :: windows_core :: Interface > :: Vtable , interface2_ibar : & 'static < IBar < > as :: windows_core :: Interface > :: Vtable , this : Baz :: < > , count : :: windows_core :: imp :: WeakRefCount , } impl :: core :: ops :: Deref for Baz_Impl :: < > { type Target = Baz :: < > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl Baz_Impl :: < > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Baz_Impl :: < > , IFoo < > , - 1 , > () ; const VTABLE_INTERFACE1_IFOO : < IFoo < > as :: windows_core :: Interface > :: Vtable = < IFoo < > as :: windows_core :: Interface > :: Vtable :: new :: < Baz_Impl :: < > , - 2isize , > () ; const VTABLE_INTERFACE2_IBAR : < IBar < > as :: windows_core :: Interface > :: Vtable = < IBar < > as :: windows_core :: Interface > :: Vtable :: new :: < Baz_Impl :: < > , - 3isize , > () ; } impl :: windows_core :: IUnknownImpl for Baz_Impl :: < > { type Impl = Baz :: < > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IFoo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_ifoo as * const _ as * const :: core :: ffi :: c_void ; } if < IBar < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface2_ibar as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl :: windows_core :: ComObjectInner for Baz :: < > { type Outer = Baz_Impl :: < > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl :: windows_core :: Compose for Baz :: < > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl :: core :: convert :: From < Baz :: < > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Baz :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Baz :: < > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Baz :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Baz :: < > > for IFoo < > { # [inline (always)] fn from (this : Baz :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: core :: convert :: From < Baz :: < > > for IBar < > { # [inline (always)] fn from (this : Baz :: < >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Baz_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Baz_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IFoo < > > for Baz_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IFoo < > > { unsafe { :: core :: mem :: transmute (& self . interface1_ifoo) } } } # [allow (clippy :: needless_lifetimes)] impl :: windows_core :: ComObjectInterface < IBar < > > for Baz_Impl :: < > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IBar < > > { unsafe { :: core :: mem :: transmute (& self . interface2_ibar) } } } impl :: windows_core :: AsImpl < Baz :: < > > for IFoo < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Baz :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut Baz_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Baz :: < > as * mut Baz :: < >) } } } impl :: windows_core :: AsImpl < Baz :: < > > for IBar < > { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < Baz :: < > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 1usize) as * mut Baz_Impl :: < > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const Baz :: < > as * mut Baz :: < >) } } }
[INFO] [stdout] stack backtrace:
[INFO] [stdout]    0:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::trace_unsynchronized::<std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x7366907419f1 - std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x7366907419f1 - <<std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[5c14b8d5a259cc4e]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x73669078963a - <core[5c14b8d5a259cc4e]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x73669078963a - core[5c14b8d5a259cc4e]::fmt::write
[INFO] [stdout]    6:     0x736690753d1c - core[5c14b8d5a259cc4e]::io::write::default_write_fmt::<alloc[f65cf102c2e86268]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x736690753d1c - <alloc[f65cf102c2e86268]::vec::Vec<u8> as core[5c14b8d5a259cc4e]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x73669070a006 - <std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x73669070a006 - std[218a0f7bb9a8af32]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x736690731b79 - std[218a0f7bb9a8af32]::panicking::default_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x56583e254e50 - test[2df5162924bba3e2]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x736690731ea2 - <alloc[f65cf102c2e86268]::boxed::Box<dyn for<'a, 'b> core[5c14b8d5a259cc4e]::ops::function::Fn<(&'a std[218a0f7bb9a8af32]::panic::PanicHookInfo<'b>,), Output = ()> + core[5c14b8d5a259cc4e]::marker::Sync + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::Fn<(&std[218a0f7bb9a8af32]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2480:9
[INFO] [stdout]   13:     0x736690731ea2 - std[218a0f7bb9a8af32]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x73669070a0b2 - std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x7366907000c9 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_end_short_backtrace::<std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x73669070bc3d - __rustc[abc93889656912e2]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x73669078a71c - core[5c14b8d5a259cc4e]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x56583e22978f - <windows_implement[7f29206608a99f54]::tests::two_interfaces::{closure#0} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x56583e247cbb - test[2df5162924bba3e2]::__rust_begin_short_backtrace::<core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>, fn() -> core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>>
[INFO] [stdout]   20:     0x56583e255475 - test[2df5162924bba3e2]::run_test::{closure#0}
[INFO] [stdout]   21:     0x56583e24e8c4 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_begin_short_backtrace::<test[2df5162924bba3e2]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x56583e258402 - <std[218a0f7bb9a8af32]::thread::lifecycle::spawn_unchecked<test[2df5162924bba3e2]::run_test::{closure#1}, ()>::{closure#1} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x73669073d37f - <alloc[f65cf102c2e86268]::boxed::Box<dyn core[5c14b8d5a259cc4e]::ops::function::FnOnce<(), Output = ()> + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2466:9
[INFO] [stdout]   24:     0x73669073d37f - <std[218a0f7bb9a8af32]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x736690495dfa - <unknown>
[INFO] [stdout]   26:     0x7366905293d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[INFO] [stdout] 
[INFO] [stdout] ---- tests::generic_no_lifetime stdout ----
[INFO] [stdout] rustfmt terminated with failure status code
[INFO] [stdout] // output of #[implement] :
[INFO] [stdout] 
[INFO] [stdout] struct OperationWithProgress < T : RuntimeType + 'static , P > (SyncState < IAsyncOperationWithProgress < T , P > >) where P : RuntimeType + 'static ; impl < T : RuntimeType + 'static , P > OperationWithProgress :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn into_outer (self) -> OperationWithProgress_Impl :: < T , P > { OperationWithProgress_Impl :: < T , P > { base : :: windows_core :: ComposeBase :: new () , identity : & OperationWithProgress_Impl :: < T , P > :: VTABLE_IDENTITY , interface1_iasyncoperationwithp : & OperationWithProgress_Impl :: < T , P > :: VTABLE_INTERFACE1_IASYNCOPERATIONWITHP , interface2_iasyncinfo : & OperationWithProgress_Impl :: < T , P > :: VTABLE_INTERFACE2_IASYNCINFO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } } # [repr (C)] # [allow (non_camel_case_types)] struct OperationWithProgress_Impl < T : RuntimeType + 'static , P > where P : RuntimeType + 'static { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_iasyncoperationwithp : & 'static < IAsyncOperationWithProgress < T < > , P < > , > as :: windows_core :: Interface > :: Vtable , interface2_iasyncinfo : & 'static < IAsyncInfo < > as :: windows_core :: Interface > :: Vtable , this : OperationWithProgress :: < T , P > , count : :: windows_core :: imp :: WeakRefCount , } impl < T : RuntimeType + 'static , P > :: core :: ops :: Deref for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { type Target = OperationWithProgress :: < T , P > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl < T : RuntimeType + 'static , P > OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < OperationWithProgress_Impl :: < T , P > , IAsyncOperationWithProgress < T < > , P < > , > , - 1 , > () ; const VTABLE_INTERFACE1_IASYNCOPERATIONWITHP : < IAsyncOperationWithProgress < T < > , P < > , > as :: windows_core :: Interface > :: Vtable = < IAsyncOperationWithProgress < T < > , P < > , > as :: windows_core :: Interface > :: Vtable :: new :: < OperationWithProgress_Impl :: < T , P > , - 2isize , > () ; const VTABLE_INTERFACE2_IASYNCINFO : < IAsyncInfo < > as :: windows_core :: Interface > :: Vtable = < IAsyncInfo < > as :: windows_core :: Interface > :: Vtable :: new :: < OperationWithProgress_Impl :: < T , P > , - 3isize , > () ; } impl < T : RuntimeType + 'static , P > :: windows_core :: IUnknownImpl for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { type Impl = OperationWithProgress :: < T , P > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IAsyncOperationWithProgress < T < > , P < > , > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_iasyncoperationwithp as * const _ as * const :: core :: ffi :: c_void ; } if < IAsyncInfo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface2_iasyncinfo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInner for OperationWithProgress :: < T , P > where P : RuntimeType + 'static { type Outer = OperationWithProgress_Impl :: < T , P > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl < T : RuntimeType + 'static , P > :: windows_core :: Compose for OperationWithProgress :: < T , P > where P : RuntimeType + 'static { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl < T : RuntimeType + 'static , P > :: core :: convert :: From < OperationWithProgress :: < T , P > > for :: windows_core :: IUnknown where P : RuntimeType + 'static { # [inline (always)] fn from (this : OperationWithProgress :: < T , P >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < T : RuntimeType + 'static , P > :: core :: convert :: From < OperationWithProgress :: < T , P > > for :: windows_core :: IInspectable where P : RuntimeType + 'static { # [inline (always)] fn from (this : OperationWithProgress :: < T , P >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < T : RuntimeType + 'static , P > :: core :: convert :: From < OperationWithProgress :: < T , P > > for IAsyncOperationWithProgress < T < > , P < > , > where P : RuntimeType + 'static { # [inline (always)] fn from (this : OperationWithProgress :: < T , P >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < T : RuntimeType + 'static , P > :: core :: convert :: From < OperationWithProgress :: < T , P > > for IAsyncInfo < > where P : RuntimeType + 'static { # [inline (always)] fn from (this : OperationWithProgress :: < T , P >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInterface < IAsyncOperationWithProgress < T < > , P < > , > > for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IAsyncOperationWithProgress < T < > , P < > , > > { unsafe { :: core :: mem :: transmute (& self . interface1_iasyncoperationwithp) } } } # [allow (clippy :: needless_lifetimes)] impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInterface < IAsyncInfo < > > for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IAsyncInfo < > > { unsafe { :: core :: mem :: transmute (& self . interface2_iasyncinfo) } } } impl < T : RuntimeType + 'static , P > :: windows_core :: AsImpl < OperationWithProgress :: < T , P > > for IAsyncOperationWithProgress < T < > , P < > , > where P : RuntimeType + 'static { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < OperationWithProgress :: < T , P > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut OperationWithProgress_Impl :: < T , P > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const OperationWithProgress :: < T , P > as * mut OperationWithProgress :: < T , P >) } } } impl < T : RuntimeType + 'static , P > :: windows_core :: AsImpl < OperationWithProgress :: < T , P > > for IAsyncInfo < > where P : RuntimeType + 'static { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < OperationWithProgress :: < T , P > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 1usize) as * mut OperationWithProgress_Impl :: < T , P > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const OperationWithProgress :: < T , P > as * mut OperationWithProgress :: < T , P >) } } }
[INFO] [stdout] 
[INFO] [stdout] thread 'tests::generic_no_lifetime' (247) panicked at src/tests.rs:32:9:
[INFO] [stdout] output does not contain expected item:
[INFO] [stdout]   expected: ::windows_core::IUnknownImpl for OperationWithProgress_Impl
[INFO] [stdout] 
[INFO] [stdout] full output:
[INFO] [stdout] struct OperationWithProgress < T : RuntimeType + 'static , P > (SyncState < IAsyncOperationWithProgress < T , P > >) where P : RuntimeType + 'static ; impl < T : RuntimeType + 'static , P > OperationWithProgress :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn into_outer (self) -> OperationWithProgress_Impl :: < T , P > { OperationWithProgress_Impl :: < T , P > { base : :: windows_core :: ComposeBase :: new () , identity : & OperationWithProgress_Impl :: < T , P > :: VTABLE_IDENTITY , interface1_iasyncoperationwithp : & OperationWithProgress_Impl :: < T , P > :: VTABLE_INTERFACE1_IASYNCOPERATIONWITHP , interface2_iasyncinfo : & OperationWithProgress_Impl :: < T , P > :: VTABLE_INTERFACE2_IASYNCINFO , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } } # [repr (C)] # [allow (non_camel_case_types)] struct OperationWithProgress_Impl < T : RuntimeType + 'static , P > where P : RuntimeType + 'static { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , interface1_iasyncoperationwithp : & 'static < IAsyncOperationWithProgress < T < > , P < > , > as :: windows_core :: Interface > :: Vtable , interface2_iasyncinfo : & 'static < IAsyncInfo < > as :: windows_core :: Interface > :: Vtable , this : OperationWithProgress :: < T , P > , count : :: windows_core :: imp :: WeakRefCount , } impl < T : RuntimeType + 'static , P > :: core :: ops :: Deref for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { type Target = OperationWithProgress :: < T , P > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl < T : RuntimeType + 'static , P > OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < OperationWithProgress_Impl :: < T , P > , IAsyncOperationWithProgress < T < > , P < > , > , - 1 , > () ; const VTABLE_INTERFACE1_IASYNCOPERATIONWITHP : < IAsyncOperationWithProgress < T < > , P < > , > as :: windows_core :: Interface > :: Vtable = < IAsyncOperationWithProgress < T < > , P < > , > as :: windows_core :: Interface > :: Vtable :: new :: < OperationWithProgress_Impl :: < T , P > , - 2isize , > () ; const VTABLE_INTERFACE2_IASYNCINFO : < IAsyncInfo < > as :: windows_core :: Interface > :: Vtable = < IAsyncInfo < > as :: windows_core :: Interface > :: Vtable :: new :: < OperationWithProgress_Impl :: < T , P > , - 3isize , > () ; } impl < T : RuntimeType + 'static , P > :: windows_core :: IUnknownImpl for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { type Impl = OperationWithProgress :: < T , P > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } if < IAsyncOperationWithProgress < T < > , P < > , > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface1_iasyncoperationwithp as * const _ as * const :: core :: ffi :: c_void ; } if < IAsyncInfo < > as :: windows_core :: Interface > :: Vtable :: matches (& iid) { break 'found & self . interface2_iasyncinfo as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } if iid == :: windows_core :: DYNAMIC_CAST_IID { (interface as * mut * const dyn core :: any :: Any) . write (self as & dyn :: core :: any :: Any as * const dyn :: core :: any :: Any) ; return :: windows_core :: HRESULT (0) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInner for OperationWithProgress :: < T , P > where P : RuntimeType + 'static { type Outer = OperationWithProgress_Impl :: < T , P > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl < T : RuntimeType + 'static , P > :: windows_core :: Compose for OperationWithProgress :: < T , P > where P : RuntimeType + 'static { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl < T : RuntimeType + 'static , P > :: core :: convert :: From < OperationWithProgress :: < T , P > > for :: windows_core :: IUnknown where P : RuntimeType + 'static { # [inline (always)] fn from (this : OperationWithProgress :: < T , P >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < T : RuntimeType + 'static , P > :: core :: convert :: From < OperationWithProgress :: < T , P > > for :: windows_core :: IInspectable where P : RuntimeType + 'static { # [inline (always)] fn from (this : OperationWithProgress :: < T , P >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < T : RuntimeType + 'static , P > :: core :: convert :: From < OperationWithProgress :: < T , P > > for IAsyncOperationWithProgress < T < > , P < > , > where P : RuntimeType + 'static { # [inline (always)] fn from (this : OperationWithProgress :: < T , P >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < T : RuntimeType + 'static , P > :: core :: convert :: From < OperationWithProgress :: < T , P > > for IAsyncInfo < > where P : RuntimeType + 'static { # [inline (always)] fn from (this : OperationWithProgress :: < T , P >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } # [allow (clippy :: needless_lifetimes)] impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInterface < IAsyncOperationWithProgress < T < > , P < > , > > for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IAsyncOperationWithProgress < T < > , P < > , > > { unsafe { :: core :: mem :: transmute (& self . interface1_iasyncoperationwithp) } } } # [allow (clippy :: needless_lifetimes)] impl < T : RuntimeType + 'static , P > :: windows_core :: ComObjectInterface < IAsyncInfo < > > for OperationWithProgress_Impl :: < T , P > where P : RuntimeType + 'static { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , IAsyncInfo < > > { unsafe { :: core :: mem :: transmute (& self . interface2_iasyncinfo) } } } impl < T : RuntimeType + 'static , P > :: windows_core :: AsImpl < OperationWithProgress :: < T , P > > for IAsyncOperationWithProgress < T < > , P < > , > where P : RuntimeType + 'static { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < OperationWithProgress :: < T , P > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 0usize) as * mut OperationWithProgress_Impl :: < T , P > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const OperationWithProgress :: < T , P > as * mut OperationWithProgress :: < T , P >) } } } impl < T : RuntimeType + 'static , P > :: windows_core :: AsImpl < OperationWithProgress :: < T , P > > for IAsyncInfo < > where P : RuntimeType + 'static { # [inline (always)] unsafe fn as_impl_ptr (& self) -> :: core :: ptr :: NonNull < OperationWithProgress :: < T , P > > { unsafe { let this = :: windows_core :: Interface :: as_raw (self) ; let this = (this as * mut * mut :: core :: ffi :: c_void) . sub (2 + 1usize) as * mut OperationWithProgress_Impl :: < T , P > ; :: core :: ptr :: NonNull :: new_unchecked (:: core :: ptr :: addr_of ! ((* this) . this) as * const OperationWithProgress :: < T , P > as * mut OperationWithProgress :: < T , P >) } } }
[INFO] [stdout] stack backtrace:
[INFO] [stdout]    0:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::trace_unsynchronized::<std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x7366907419f1 - std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x7366907419f1 - <<std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[5c14b8d5a259cc4e]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x73669078963a - <core[5c14b8d5a259cc4e]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x73669078963a - core[5c14b8d5a259cc4e]::fmt::write
[INFO] [stdout]    6:     0x736690753d1c - core[5c14b8d5a259cc4e]::io::write::default_write_fmt::<alloc[f65cf102c2e86268]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x736690753d1c - <alloc[f65cf102c2e86268]::vec::Vec<u8> as core[5c14b8d5a259cc4e]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x73669070a006 - <std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x73669070a006 - std[218a0f7bb9a8af32]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x736690731b79 - std[218a0f7bb9a8af32]::panicking::default_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x56583e254e50 - test[2df5162924bba3e2]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x736690731ea2 - <alloc[f65cf102c2e86268]::boxed::Box<dyn for<'a, 'b> core[5c14b8d5a259cc4e]::ops::function::Fn<(&'a std[218a0f7bb9a8af32]::panic::PanicHookInfo<'b>,), Output = ()> + core[5c14b8d5a259cc4e]::marker::Sync + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::Fn<(&std[218a0f7bb9a8af32]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2480:9
[INFO] [stdout]   13:     0x736690731ea2 - std[218a0f7bb9a8af32]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x73669070a0b2 - std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x7366907000c9 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_end_short_backtrace::<std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x73669070bc3d - __rustc[abc93889656912e2]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x73669078a71c - core[5c14b8d5a259cc4e]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x56583e229f4a - <windows_implement[7f29206608a99f54]::tests::generic_no_lifetime::{closure#0} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x56583e247cbb - test[2df5162924bba3e2]::__rust_begin_short_backtrace::<core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>, fn() -> core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>>
[INFO] [stdout]   20:     0x56583e255475 - test[2df5162924bba3e2]::run_test::{closure#0}
[INFO] [stdout]   21:     0x56583e24e8c4 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_begin_short_backtrace::<test[2df5162924bba3e2]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x56583e258402 - <std[218a0f7bb9a8af32]::thread::lifecycle::spawn_unchecked<test[2df5162924bba3e2]::run_test::{closure#1}, ()>::{closure#1} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x73669073d37f - <alloc[f65cf102c2e86268]::boxed::Box<dyn core[5c14b8d5a259cc4e]::ops::function::FnOnce<(), Output = ()> + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2466:9
[INFO] [stdout]   24:     0x73669073d37f - <std[218a0f7bb9a8af32]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x736690495dfa - <unknown>
[INFO] [stdout]   26:     0x7366905293d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[INFO] [stdout] 
[INFO] [stdout] ---- tests::generic_with_lifetime stdout ----
[INFO] [stdout] rustfmt terminated with failure status code
[INFO] [stdout] // output of #[implement] :
[INFO] [stdout] 
[INFO] [stdout] pub struct Foo < 'a > { pub x : & 'a [u8] , } impl < 'a > Foo :: < 'a > { # [inline (always)] fn into_outer (self) -> Foo_Impl :: < 'a > { Foo_Impl :: < 'a > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < 'a > :: VTABLE_IDENTITY , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } } # [repr (C)] # [allow (non_camel_case_types)] pub struct Foo_Impl < 'a > { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , this : Foo :: < 'a > , count : :: windows_core :: imp :: WeakRefCount , } impl < 'a > :: core :: ops :: Deref for Foo_Impl :: < 'a > { type Target = Foo :: < 'a > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl < 'a > Foo_Impl :: < 'a > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < 'a > , :: windows_core :: IInspectable , - 1 , > () ; } impl < 'a > :: windows_core :: IUnknownImpl for Foo_Impl :: < 'a > { type Impl = Foo :: < 'a > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl < 'a > :: windows_core :: ComObjectInner for Foo :: < 'a > { type Outer = Foo_Impl :: < 'a > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl < 'a > :: windows_core :: Compose for Foo :: < 'a > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl < 'a > :: core :: convert :: From < Foo :: < 'a > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < 'a >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < 'a > :: core :: convert :: From < Foo :: < 'a > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < 'a >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < 'a > :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < 'a > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl < 'a > :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < 'a > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } }
[INFO] [stdout] 
[INFO] [stdout] thread 'tests::generic_with_lifetime' (248) panicked at src/tests.rs:32:9:
[INFO] [stdout] output does not contain expected item:
[INFO] [stdout]   expected: ::windows_core::IUnknownImpl for Foo_Impl
[INFO] [stdout] 
[INFO] [stdout] full output:
[INFO] [stdout] pub struct Foo < 'a > { pub x : & 'a [u8] , } impl < 'a > Foo :: < 'a > { # [inline (always)] fn into_outer (self) -> Foo_Impl :: < 'a > { Foo_Impl :: < 'a > { base : :: windows_core :: ComposeBase :: new () , identity : & Foo_Impl :: < 'a > :: VTABLE_IDENTITY , count : :: windows_core :: imp :: WeakRefCount :: new () , this : self , } } } # [repr (C)] # [allow (non_camel_case_types)] pub struct Foo_Impl < 'a > { base : :: windows_core :: ComposeBase , identity : & 'static :: windows_core :: IInspectable_Vtbl , this : Foo :: < 'a > , count : :: windows_core :: imp :: WeakRefCount , } impl < 'a > :: core :: ops :: Deref for Foo_Impl :: < 'a > { type Target = Foo :: < 'a > ; # [inline (always)] fn deref (& self) -> & Self :: Target { & self . this } } impl < 'a > Foo_Impl :: < 'a > { const VTABLE_IDENTITY : :: windows_core :: IInspectable_Vtbl = :: windows_core :: IInspectable_Vtbl :: new :: < Foo_Impl :: < 'a > , :: windows_core :: IInspectable , - 1 , > () ; } impl < 'a > :: windows_core :: IUnknownImpl for Foo_Impl :: < 'a > { type Impl = Foo :: < 'a > ; # [inline (always)] fn get_impl (& self) -> & Self :: Impl { & self . this } # [inline (always)] fn get_impl_mut (& mut self) -> & mut Self :: Impl { & mut self . this } # [inline (always)] fn into_inner (self) -> Self :: Impl { self . this } # [inline (always)] fn AddRef (& self) -> u32 { self . count . add_ref () } # [inline (always)] unsafe fn Release (self_ : * mut Self) -> u32 { let remaining = (* self_) . count . release () ; if remaining == 0 { _ = :: windows_core :: imp :: box_from_raw (self_) ; } remaining } # [inline (always)] fn is_reference_count_one (& self) -> bool { self . count . is_one () } unsafe fn GetTrustLevel (& self , value : * mut i32) -> :: windows_core :: HRESULT { if value . is_null () { return :: windows_core :: imp :: E_POINTER ; } * value = 0 ; :: windows_core :: HRESULT (0) } fn to_object (& self) -> :: windows_core :: ComObject < Self :: Impl > { self . count . add_ref () ; unsafe { :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (self as * const Self as * mut Self)) } } unsafe fn QueryInterface (& self , iid : * const :: windows_core :: GUID , interface : * mut * mut :: core :: ffi :: c_void ,) -> :: windows_core :: HRESULT { unsafe { if iid . is_null () || interface . is_null () { return :: windows_core :: imp :: E_POINTER ; } let iid = * iid ; let interface_ptr : * const :: core :: ffi :: c_void = 'found : { if iid == < :: windows_core :: IUnknown as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: IInspectable as :: windows_core :: Interface > :: IID || iid == < :: windows_core :: imp :: IAgileObject as :: windows_core :: Interface > :: IID { break 'found & self . identity as * const _ as * const :: core :: ffi :: c_void ; } # [cfg (windows)] if iid == < :: windows_core :: imp :: IMarshal as :: windows_core :: Interface > :: IID { return :: windows_core :: imp :: marshaler (self . to_interface () , interface) ; } let tear_off_ptr = self . count . query (& iid , & self . identity as * const _ as * mut _) ; if ! tear_off_ptr . is_null () { * interface = tear_off_ptr ; return :: windows_core :: HRESULT (0) ; } if let :: core :: option :: Option :: Some (base) = self . base . as_option () { return :: windows_core :: Interface :: query (base , & iid as * const :: windows_core :: GUID , interface) ; } * interface = :: core :: ptr :: null_mut () ; return :: windows_core :: imp :: E_NOINTERFACE ; } ; debug_assert ! (! interface_ptr . is_null ()) ; * interface = interface_ptr as * mut :: core :: ffi :: c_void ; self . count . add_ref () ; return :: windows_core :: HRESULT (0) ; } } } impl < 'a > :: windows_core :: ComObjectInner for Foo :: < 'a > { type Outer = Foo_Impl :: < 'a > ; fn into_object (self) -> :: windows_core :: ComObject < Self > { let boxed = :: windows_core :: imp :: box_new (self . into_outer ()) ; unsafe { let ptr = :: windows_core :: imp :: box_into_raw (boxed) ; :: windows_core :: ComObject :: from_raw (:: core :: ptr :: NonNull :: new_unchecked (ptr)) } } } impl < 'a > :: windows_core :: Compose for Foo :: < 'a > { unsafe fn compose < 'a > (implementation : Self ,) -> (:: windows_core :: IInspectable , & 'a mut :: core :: option :: Option < :: windows_core :: IInspectable >) { unsafe { let inspectable : :: windows_core :: IInspectable = implementation . into () ; let identity_ptr : * mut :: core :: ffi :: c_void = :: windows_core :: Interface :: as_raw (& inspectable) ; let base_ptr = (identity_ptr as * mut * mut :: core :: ffi :: c_void) . sub (1) as * mut :: core :: option :: Option < :: windows_core :: IInspectable > ; (inspectable , & mut * base_ptr) } } } impl < 'a > :: core :: convert :: From < Foo :: < 'a > > for :: windows_core :: IUnknown { # [inline (always)] fn from (this : Foo :: < 'a >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < 'a > :: core :: convert :: From < Foo :: < 'a > > for :: windows_core :: IInspectable { # [inline (always)] fn from (this : Foo :: < 'a >) -> Self { let com_object = :: windows_core :: ComObject :: new (this) ; com_object . into_interface () } } impl < 'a > :: windows_core :: ComObjectInterface < :: windows_core :: IUnknown > for Foo_Impl :: < 'a > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IUnknown > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } } impl < 'a > :: windows_core :: ComObjectInterface < :: windows_core :: IInspectable > for Foo_Impl :: < 'a > { # [inline (always)] fn as_interface_ref (& self) -> :: windows_core :: InterfaceRef < '_ , :: windows_core :: IInspectable > { unsafe { let interface_ptr = & self . identity ; :: core :: mem :: transmute (interface_ptr) } } }
[INFO] [stdout] stack backtrace:
[INFO] [stdout]    0:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x7366907419f1 - std[218a0f7bb9a8af32]::backtrace_rs::backtrace::trace_unsynchronized::<std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x7366907419f1 - std[218a0f7bb9a8af32]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x7366907419f1 - <<std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[5c14b8d5a259cc4e]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x73669078963a - <core[5c14b8d5a259cc4e]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x73669078963a - core[5c14b8d5a259cc4e]::fmt::write
[INFO] [stdout]    6:     0x736690753d1c - core[5c14b8d5a259cc4e]::io::write::default_write_fmt::<alloc[f65cf102c2e86268]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x736690753d1c - <alloc[f65cf102c2e86268]::vec::Vec<u8> as core[5c14b8d5a259cc4e]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x73669070a006 - <std[218a0f7bb9a8af32]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x73669070a006 - std[218a0f7bb9a8af32]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x736690731b79 - std[218a0f7bb9a8af32]::panicking::default_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x56583e254e50 - test[2df5162924bba3e2]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x736690731ea2 - <alloc[f65cf102c2e86268]::boxed::Box<dyn for<'a, 'b> core[5c14b8d5a259cc4e]::ops::function::Fn<(&'a std[218a0f7bb9a8af32]::panic::PanicHookInfo<'b>,), Output = ()> + core[5c14b8d5a259cc4e]::marker::Sync + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::Fn<(&std[218a0f7bb9a8af32]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2480:9
[INFO] [stdout]   13:     0x736690731ea2 - std[218a0f7bb9a8af32]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x73669070a0b2 - std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x7366907000c9 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_end_short_backtrace::<std[218a0f7bb9a8af32]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x73669070bc3d - __rustc[abc93889656912e2]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x73669078a71c - core[5c14b8d5a259cc4e]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x56583e22a514 - <windows_implement[7f29206608a99f54]::tests::generic_with_lifetime::{closure#0} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x56583e247cbb - test[2df5162924bba3e2]::__rust_begin_short_backtrace::<core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>, fn() -> core[5c14b8d5a259cc4e]::result::Result<(), alloc[f65cf102c2e86268]::string::String>>
[INFO] [stdout]   20:     0x56583e255475 - test[2df5162924bba3e2]::run_test::{closure#0}
[INFO] [stdout]   21:     0x56583e24e8c4 - std[218a0f7bb9a8af32]::sys::backtrace::__rust_begin_short_backtrace::<test[2df5162924bba3e2]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x56583e258402 - <std[218a0f7bb9a8af32]::thread::lifecycle::spawn_unchecked<test[2df5162924bba3e2]::run_test::{closure#1}, ()>::{closure#1} as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x73669073d37f - <alloc[f65cf102c2e86268]::boxed::Box<dyn core[5c14b8d5a259cc4e]::ops::function::FnOnce<(), Output = ()> + core[5c14b8d5a259cc4e]::marker::Send> as core[5c14b8d5a259cc4e]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/alloc/src/boxed.rs:2466:9
[INFO] [stdout]   24:     0x73669073d37f - <std[218a0f7bb9a8af32]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/bbcdfd90a3f81ca2a5f6d69b943a6ff0d8582102/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x736690495dfa - <unknown>
[INFO] [stdout]   26:     0x7366905293d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] failures:
[INFO] [stdout]     tests::generic_no_lifetime
[INFO] [stdout]     tests::generic_with_lifetime
[INFO] [stdout]     tests::namespaced_interface
[INFO] [stdout]     tests::no_interfaces
[INFO] [stdout]     tests::simple_type
[INFO] [stdout]     tests::tuple_type
[INFO] [stdout]     tests::two_interfaces
[INFO] [stdout]     tests::zero_sized_type
[INFO] [stdout] 
[INFO] [stdout] test result: FAILED. 1 passed; 8 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.90s
[INFO] [stdout] 
[INFO] [stderr] error: test failed, to rerun pass `--lib`
[INFO] running `"docker" "inspect" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5"`
[INFO] running `"docker" "rm" "-f" "ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5"`
[INFO] [stdout] ce816437b9438bfe8506315787804997e8a412e67aee0d123b5478b7d2eacde5
