[INFO] fetching crate windows-implement 0.100.0...
[INFO] testing windows-implement-0.100.0 against 1.100.0-beta.13+cargoflags=--release for beta-release-1.101-2
[INFO] extracting crate windows-implement 0.100.0 into /workspace/builds/worker-7-tc1/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-tc1/source/Cargo.toml
[INFO] validating manifest of crates.io crate windows-implement 0.100.0 on toolchain 1.100.0-beta.13
[INFO] running `"cargo" "+1.100.0-beta.13" "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.100.0-beta.13" "fetch" "--manifest-path" "Cargo.toml"`
[INFO] running `"docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/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] bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8
[INFO] running `"docker" "start" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8"`
[INFO] running `"docker" "inspect" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8"`
[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" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8" "/opt/rustwide/cargo-home/bin/cargo" "+1.100.0-beta.13" "metadata" "--no-deps" "--format-version=1"`
[INFO] running `"docker" "inspect" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8"`
[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" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8" "/opt/rustwide/cargo-home/bin/cargo" "+1.100.0-beta.13" "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 8.34s
[INFO] running `"docker" "inspect" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8"`
[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" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8" "/opt/rustwide/cargo-home/bin/cargo" "+1.100.0-beta.13" "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.82s
[INFO] running `"docker" "inspect" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8"`
[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" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8" "/opt/rustwide/cargo-home/bin/cargo" "+1.100.0-beta.13" "test" "--frozen" "--release"`
[INFO] [stderr]     Finished `release` profile [optimized] target(s) in 0.03s
[INFO] [stderr]      Running unittests src/lib.rs (/opt/rustwide/target/release/build/windows-implement/e30cdf82639e6195/out/windows_implement-e30cdf82639e6195)
[INFO] [stdout] 
[INFO] [stdout] running 9 tests
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::generic_with_lifetime ... FAILED
[INFO] [stdout] test tests::two_interfaces ... FAILED
[INFO] [stdout] test tests::no_interfaces ... FAILED
[INFO] [stdout] test tests::namespaced_interface ... FAILED
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-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.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::zero_sized_type ... FAILED
[INFO] [stdout] test tests::tuple_type ... FAILED
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stderr] error: 'rustfmt' is not installed for the toolchain '1.100.0-beta.13-x86_64-unknown-linux-gnu'.
[INFO] [stderr] help: run `rustup component add --toolchain 1.100.0-beta.13-x86_64-unknown-linux-gnu rustfmt` to install it
[INFO] [stdout] test tests::simple_type ... FAILED
[INFO] [stdout] test tests::generic_no_lifetime ... FAILED
[INFO] [stdout] 
[INFO] [stdout] failures:
[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' (246) 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:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::trace_unsynchronized::<std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x70e93bfc4951 - <<std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a2c1a7cd948629ec]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x70e93c00b4da - <core[a2c1a7cd948629ec]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x70e93c00b4da - core[a2c1a7cd948629ec]::fmt::write
[INFO] [stdout]    6:     0x70e93bfd559c - core[a2c1a7cd948629ec]::io::write::default_write_fmt::<alloc[9de6908353064a78]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x70e93bfd559c - <alloc[9de6908353064a78]::vec::Vec<u8> as core[a2c1a7cd948629ec]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x70e93bf8deb6 - <std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x70e93bf8deb6 - std[f3a103f8b3fbc6]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x70e93bfb58a9 - std[f3a103f8b3fbc6]::panicking::default_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x57e9c6f04d50 - test[4d2796dde4b18a79]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x70e93bfb5bd2 - <alloc[9de6908353064a78]::boxed::Box<dyn for<'a, 'b> core[a2c1a7cd948629ec]::ops::function::Fn<(&'a std[f3a103f8b3fbc6]::panic::PanicHookInfo<'b>,), Output = ()> + core[a2c1a7cd948629ec]::marker::Send + core[a2c1a7cd948629ec]::marker::Sync> as core[a2c1a7cd948629ec]::ops::function::Fn<(&std[f3a103f8b3fbc6]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2409:9
[INFO] [stdout]   13:     0x70e93bfb5bd2 - std[f3a103f8b3fbc6]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x70e93bf8df62 - std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x70e93bf85899 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_end_short_backtrace::<std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x70e93bf8fa4d - __rustc[72b30b8c63551d82]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x70e93c00bf6c - core[a2c1a7cd948629ec]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x57e9c6eda9c4 - <windows_implement[524d9cb96e8c4e68]::tests::generic_with_lifetime::{closure#0} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x57e9c6ef819b - test[4d2796dde4b18a79]::__rust_begin_short_backtrace::<core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>, fn() -> core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>>
[INFO] [stdout]   20:     0x57e9c6f05375 - test[4d2796dde4b18a79]::run_test::{closure#0}
[INFO] [stdout]   21:     0x57e9c6efe764 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_begin_short_backtrace::<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x57e9c6f08402 - <std[f3a103f8b3fbc6]::thread::lifecycle::spawn_unchecked<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>::{closure#1} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x70e93bfc0e8f - <alloc[9de6908353064a78]::boxed::Box<dyn core[a2c1a7cd948629ec]::ops::function::FnOnce<(), Output = ()> + core[a2c1a7cd948629ec]::marker::Send> as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2395:9
[INFO] [stdout]   24:     0x70e93bfc0e8f - <std[f3a103f8b3fbc6]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x70e93bd1ddfa - <unknown>
[INFO] [stdout]   26:     0x70e93bdb13d4 - 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' (258) 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:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::trace_unsynchronized::<std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x70e93bfc4951 - <<std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a2c1a7cd948629ec]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x70e93c00b4da - <core[a2c1a7cd948629ec]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x70e93c00b4da - core[a2c1a7cd948629ec]::fmt::write
[INFO] [stdout]    6:     0x70e93bfd559c - core[a2c1a7cd948629ec]::io::write::default_write_fmt::<alloc[9de6908353064a78]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x70e93bfd559c - <alloc[9de6908353064a78]::vec::Vec<u8> as core[a2c1a7cd948629ec]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x70e93bf8deb6 - <std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x70e93bf8deb6 - std[f3a103f8b3fbc6]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x70e93bfb58a9 - std[f3a103f8b3fbc6]::panicking::default_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x57e9c6f04d50 - test[4d2796dde4b18a79]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x70e93bfb5bd2 - <alloc[9de6908353064a78]::boxed::Box<dyn for<'a, 'b> core[a2c1a7cd948629ec]::ops::function::Fn<(&'a std[f3a103f8b3fbc6]::panic::PanicHookInfo<'b>,), Output = ()> + core[a2c1a7cd948629ec]::marker::Send + core[a2c1a7cd948629ec]::marker::Sync> as core[a2c1a7cd948629ec]::ops::function::Fn<(&std[f3a103f8b3fbc6]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2409:9
[INFO] [stdout]   13:     0x70e93bfb5bd2 - std[f3a103f8b3fbc6]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x70e93bf8df62 - std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x70e93bf85899 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_end_short_backtrace::<std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x70e93bf8fa4d - __rustc[72b30b8c63551d82]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x70e93c00bf6c - core[a2c1a7cd948629ec]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x57e9c6ed9c3f - <windows_implement[524d9cb96e8c4e68]::tests::two_interfaces::{closure#0} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x57e9c6ef819b - test[4d2796dde4b18a79]::__rust_begin_short_backtrace::<core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>, fn() -> core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>>
[INFO] [stdout]   20:     0x57e9c6f05375 - test[4d2796dde4b18a79]::run_test::{closure#0}
[INFO] [stdout]   21:     0x57e9c6efe764 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_begin_short_backtrace::<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x57e9c6f08402 - <std[f3a103f8b3fbc6]::thread::lifecycle::spawn_unchecked<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>::{closure#1} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x70e93bfc0e8f - <alloc[9de6908353064a78]::boxed::Box<dyn core[a2c1a7cd948629ec]::ops::function::FnOnce<(), Output = ()> + core[a2c1a7cd948629ec]::marker::Send> as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2395:9
[INFO] [stdout]   24:     0x70e93bfc0e8f - <std[f3a103f8b3fbc6]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x70e93bd1ddfa - <unknown>
[INFO] [stdout]   26:     0x70e93bdb13d4 - 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' (248) 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:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::trace_unsynchronized::<std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x70e93bfc4951 - <<std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a2c1a7cd948629ec]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x70e93c00b4da - <core[a2c1a7cd948629ec]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x70e93c00b4da - core[a2c1a7cd948629ec]::fmt::write
[INFO] [stdout]    6:     0x70e93bfd559c - core[a2c1a7cd948629ec]::io::write::default_write_fmt::<alloc[9de6908353064a78]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x70e93bfd559c - <alloc[9de6908353064a78]::vec::Vec<u8> as core[a2c1a7cd948629ec]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x70e93bf8deb6 - <std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x70e93bf8deb6 - std[f3a103f8b3fbc6]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x70e93bfb58a9 - std[f3a103f8b3fbc6]::panicking::default_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x57e9c6f04d50 - test[4d2796dde4b18a79]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x70e93bfb5bd2 - <alloc[9de6908353064a78]::boxed::Box<dyn for<'a, 'b> core[a2c1a7cd948629ec]::ops::function::Fn<(&'a std[f3a103f8b3fbc6]::panic::PanicHookInfo<'b>,), Output = ()> + core[a2c1a7cd948629ec]::marker::Send + core[a2c1a7cd948629ec]::marker::Sync> as core[a2c1a7cd948629ec]::ops::function::Fn<(&std[f3a103f8b3fbc6]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2409:9
[INFO] [stdout]   13:     0x70e93bfb5bd2 - std[f3a103f8b3fbc6]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x70e93bf8df62 - std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x70e93bf85899 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_end_short_backtrace::<std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x70e93bf8fa4d - __rustc[72b30b8c63551d82]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x70e93c00bf6c - core[a2c1a7cd948629ec]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x57e9c6ed991a - <windows_implement[524d9cb96e8c4e68]::tests::no_interfaces::{closure#0} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x57e9c6ef819b - test[4d2796dde4b18a79]::__rust_begin_short_backtrace::<core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>, fn() -> core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>>
[INFO] [stdout]   20:     0x57e9c6f05375 - test[4d2796dde4b18a79]::run_test::{closure#0}
[INFO] [stdout]   21:     0x57e9c6efe764 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_begin_short_backtrace::<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x57e9c6f08402 - <std[f3a103f8b3fbc6]::thread::lifecycle::spawn_unchecked<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>::{closure#1} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x70e93bfc0e8f - <alloc[9de6908353064a78]::boxed::Box<dyn core[a2c1a7cd948629ec]::ops::function::FnOnce<(), Output = ()> + core[a2c1a7cd948629ec]::marker::Send> as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2395:9
[INFO] [stdout]   24:     0x70e93bfc0e8f - <std[f3a103f8b3fbc6]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x70e93bd1ddfa - <unknown>
[INFO] [stdout]   26:     0x70e93bdb13d4 - 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' (247) 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:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::trace_unsynchronized::<std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x70e93bfc4951 - <<std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a2c1a7cd948629ec]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x70e93c00b4da - <core[a2c1a7cd948629ec]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x70e93c00b4da - core[a2c1a7cd948629ec]::fmt::write
[INFO] [stdout]    6:     0x70e93bfd559c - core[a2c1a7cd948629ec]::io::write::default_write_fmt::<alloc[9de6908353064a78]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x70e93bfd559c - <alloc[9de6908353064a78]::vec::Vec<u8> as core[a2c1a7cd948629ec]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x70e93bf8deb6 - <std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x70e93bf8deb6 - std[f3a103f8b3fbc6]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x70e93bfb58a9 - std[f3a103f8b3fbc6]::panicking::default_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x57e9c6f04d50 - test[4d2796dde4b18a79]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x70e93bfb5bd2 - <alloc[9de6908353064a78]::boxed::Box<dyn for<'a, 'b> core[a2c1a7cd948629ec]::ops::function::Fn<(&'a std[f3a103f8b3fbc6]::panic::PanicHookInfo<'b>,), Output = ()> + core[a2c1a7cd948629ec]::marker::Send + core[a2c1a7cd948629ec]::marker::Sync> as core[a2c1a7cd948629ec]::ops::function::Fn<(&std[f3a103f8b3fbc6]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2409:9
[INFO] [stdout]   13:     0x70e93bfb5bd2 - std[f3a103f8b3fbc6]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x70e93bf8df62 - std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x70e93bf85899 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_end_short_backtrace::<std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x70e93bf8fa4d - __rustc[72b30b8c63551d82]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x70e93c00bf6c - core[a2c1a7cd948629ec]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x57e9c6eda64d - <windows_implement[524d9cb96e8c4e68]::tests::namespaced_interface::{closure#0} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x57e9c6ef819b - test[4d2796dde4b18a79]::__rust_begin_short_backtrace::<core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>, fn() -> core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>>
[INFO] [stdout]   20:     0x57e9c6f05375 - test[4d2796dde4b18a79]::run_test::{closure#0}
[INFO] [stdout]   21:     0x57e9c6efe764 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_begin_short_backtrace::<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x57e9c6f08402 - <std[f3a103f8b3fbc6]::thread::lifecycle::spawn_unchecked<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>::{closure#1} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x70e93bfc0e8f - <alloc[9de6908353064a78]::boxed::Box<dyn core[a2c1a7cd948629ec]::ops::function::FnOnce<(), Output = ()> + core[a2c1a7cd948629ec]::marker::Send> as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2395:9
[INFO] [stdout]   24:     0x70e93bfc0e8f - <std[f3a103f8b3fbc6]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x70e93bd1ddfa - <unknown>
[INFO] [stdout]   26:     0x70e93bdb13d4 - 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' (259) 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:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::trace_unsynchronized::<std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x70e93bfc4951 - <<std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a2c1a7cd948629ec]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x70e93c00b4da - <core[a2c1a7cd948629ec]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x70e93c00b4da - core[a2c1a7cd948629ec]::fmt::write
[INFO] [stdout]    6:     0x70e93bfd559c - core[a2c1a7cd948629ec]::io::write::default_write_fmt::<alloc[9de6908353064a78]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x70e93bfd559c - <alloc[9de6908353064a78]::vec::Vec<u8> as core[a2c1a7cd948629ec]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x70e93bf8deb6 - <std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x70e93bf8deb6 - std[f3a103f8b3fbc6]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x70e93bfb58a9 - std[f3a103f8b3fbc6]::panicking::default_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x57e9c6f04d50 - test[4d2796dde4b18a79]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x70e93bfb5bd2 - <alloc[9de6908353064a78]::boxed::Box<dyn for<'a, 'b> core[a2c1a7cd948629ec]::ops::function::Fn<(&'a std[f3a103f8b3fbc6]::panic::PanicHookInfo<'b>,), Output = ()> + core[a2c1a7cd948629ec]::marker::Send + core[a2c1a7cd948629ec]::marker::Sync> as core[a2c1a7cd948629ec]::ops::function::Fn<(&std[f3a103f8b3fbc6]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2409:9
[INFO] [stdout]   13:     0x70e93bfb5bd2 - std[f3a103f8b3fbc6]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x70e93bf8df62 - std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x70e93bf85899 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_end_short_backtrace::<std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x70e93bf8fa4d - __rustc[72b30b8c63551d82]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x70e93c00bf6c - core[a2c1a7cd948629ec]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x57e9c6ed9e9d - <windows_implement[524d9cb96e8c4e68]::tests::zero_sized_type::{closure#0} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x57e9c6ef819b - test[4d2796dde4b18a79]::__rust_begin_short_backtrace::<core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>, fn() -> core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>>
[INFO] [stdout]   20:     0x57e9c6f05375 - test[4d2796dde4b18a79]::run_test::{closure#0}
[INFO] [stdout]   21:     0x57e9c6efe764 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_begin_short_backtrace::<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x57e9c6f08402 - <std[f3a103f8b3fbc6]::thread::lifecycle::spawn_unchecked<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>::{closure#1} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x70e93bfc0e8f - <alloc[9de6908353064a78]::boxed::Box<dyn core[a2c1a7cd948629ec]::ops::function::FnOnce<(), Output = ()> + core[a2c1a7cd948629ec]::marker::Send> as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2395:9
[INFO] [stdout]   24:     0x70e93bfc0e8f - <std[f3a103f8b3fbc6]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x70e93bd1ddfa - <unknown>
[INFO] [stdout]   26:     0x70e93bdb13d4 - 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' (257) 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:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::trace_unsynchronized::<std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x70e93bfc4951 - <<std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a2c1a7cd948629ec]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x70e93c00b4da - <core[a2c1a7cd948629ec]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x70e93c00b4da - core[a2c1a7cd948629ec]::fmt::write
[INFO] [stdout]    6:     0x70e93bfd559c - core[a2c1a7cd948629ec]::io::write::default_write_fmt::<alloc[9de6908353064a78]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x70e93bfd559c - <alloc[9de6908353064a78]::vec::Vec<u8> as core[a2c1a7cd948629ec]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x70e93bf8deb6 - <std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x70e93bf8deb6 - std[f3a103f8b3fbc6]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x70e93bfb58a9 - std[f3a103f8b3fbc6]::panicking::default_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x57e9c6f04d50 - test[4d2796dde4b18a79]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x70e93bfb5bd2 - <alloc[9de6908353064a78]::boxed::Box<dyn for<'a, 'b> core[a2c1a7cd948629ec]::ops::function::Fn<(&'a std[f3a103f8b3fbc6]::panic::PanicHookInfo<'b>,), Output = ()> + core[a2c1a7cd948629ec]::marker::Send + core[a2c1a7cd948629ec]::marker::Sync> as core[a2c1a7cd948629ec]::ops::function::Fn<(&std[f3a103f8b3fbc6]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2409:9
[INFO] [stdout]   13:     0x70e93bfb5bd2 - std[f3a103f8b3fbc6]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x70e93bf8df62 - std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x70e93bf85899 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_end_short_backtrace::<std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x70e93bf8fa4d - __rustc[72b30b8c63551d82]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x70e93c00bf6c - core[a2c1a7cd948629ec]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x57e9c6ed933c - <windows_implement[524d9cb96e8c4e68]::tests::tuple_type::{closure#0} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x57e9c6ef819b - test[4d2796dde4b18a79]::__rust_begin_short_backtrace::<core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>, fn() -> core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>>
[INFO] [stdout]   20:     0x57e9c6f05375 - test[4d2796dde4b18a79]::run_test::{closure#0}
[INFO] [stdout]   21:     0x57e9c6efe764 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_begin_short_backtrace::<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x57e9c6f08402 - <std[f3a103f8b3fbc6]::thread::lifecycle::spawn_unchecked<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>::{closure#1} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x70e93bfc0e8f - <alloc[9de6908353064a78]::boxed::Box<dyn core[a2c1a7cd948629ec]::ops::function::FnOnce<(), Output = ()> + core[a2c1a7cd948629ec]::marker::Send> as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2395:9
[INFO] [stdout]   24:     0x70e93bfc0e8f - <std[f3a103f8b3fbc6]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x70e93bd1ddfa - <unknown>
[INFO] [stdout]   26:     0x70e93bdb13d4 - clone
[INFO] [stdout]   27:                0x0 - <unknown>
[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' (250) 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:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::trace_unsynchronized::<std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x70e93bfc4951 - <<std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a2c1a7cd948629ec]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x70e93c00b4da - <core[a2c1a7cd948629ec]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x70e93c00b4da - core[a2c1a7cd948629ec]::fmt::write
[INFO] [stdout]    6:     0x70e93bfd559c - core[a2c1a7cd948629ec]::io::write::default_write_fmt::<alloc[9de6908353064a78]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x70e93bfd559c - <alloc[9de6908353064a78]::vec::Vec<u8> as core[a2c1a7cd948629ec]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x70e93bf8deb6 - <std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x70e93bf8deb6 - std[f3a103f8b3fbc6]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x70e93bfb58a9 - std[f3a103f8b3fbc6]::panicking::default_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x57e9c6f04d50 - test[4d2796dde4b18a79]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x70e93bfb5bd2 - <alloc[9de6908353064a78]::boxed::Box<dyn for<'a, 'b> core[a2c1a7cd948629ec]::ops::function::Fn<(&'a std[f3a103f8b3fbc6]::panic::PanicHookInfo<'b>,), Output = ()> + core[a2c1a7cd948629ec]::marker::Send + core[a2c1a7cd948629ec]::marker::Sync> as core[a2c1a7cd948629ec]::ops::function::Fn<(&std[f3a103f8b3fbc6]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2409:9
[INFO] [stdout]   13:     0x70e93bfb5bd2 - std[f3a103f8b3fbc6]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x70e93bf8df62 - std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x70e93bf85899 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_end_short_backtrace::<std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x70e93bf8fa4d - __rustc[72b30b8c63551d82]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x70e93c00bf6c - core[a2c1a7cd948629ec]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x57e9c6ed96ae - <windows_implement[524d9cb96e8c4e68]::tests::simple_type::{closure#0} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x57e9c6ef819b - test[4d2796dde4b18a79]::__rust_begin_short_backtrace::<core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>, fn() -> core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>>
[INFO] [stdout]   20:     0x57e9c6f05375 - test[4d2796dde4b18a79]::run_test::{closure#0}
[INFO] [stdout]   21:     0x57e9c6efe764 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_begin_short_backtrace::<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x57e9c6f08402 - <std[f3a103f8b3fbc6]::thread::lifecycle::spawn_unchecked<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>::{closure#1} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x70e93bfc0e8f - <alloc[9de6908353064a78]::boxed::Box<dyn core[a2c1a7cd948629ec]::ops::function::FnOnce<(), Output = ()> + core[a2c1a7cd948629ec]::marker::Send> as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2395:9
[INFO] [stdout]   24:     0x70e93bfc0e8f - <std[f3a103f8b3fbc6]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x70e93bd1ddfa - <unknown>
[INFO] [stdout]   26:     0x70e93bdb13d4 - 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' (245) 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:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::libunwind::trace
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
[INFO] [stdout]    1:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::backtrace_rs::backtrace::trace_unsynchronized::<std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt::{closure#1}>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
[INFO] [stdout]    2:     0x70e93bfc4951 - std[f3a103f8b3fbc6]::sys::backtrace::_print_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:74:9
[INFO] [stdout]    3:     0x70e93bfc4951 - <<std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a2c1a7cd948629ec]::fmt::Display>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:44:26
[INFO] [stdout]    4:     0x70e93c00b4da - <core[a2c1a7cd948629ec]::fmt::rt::Argument>::fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/fmt/rt.rs:152:76
[INFO] [stdout]    5:     0x70e93c00b4da - core[a2c1a7cd948629ec]::fmt::write
[INFO] [stdout]    6:     0x70e93bfd559c - core[a2c1a7cd948629ec]::io::write::default_write_fmt::<alloc[9de6908353064a78]::vec::Vec<u8>>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:402:11
[INFO] [stdout]    7:     0x70e93bfd559c - <alloc[9de6908353064a78]::vec::Vec<u8> as core[a2c1a7cd948629ec]::io::write::Write>::write_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/io/write.rs:335:13
[INFO] [stdout]    8:     0x70e93bf8deb6 - <std[f3a103f8b3fbc6]::sys::backtrace::BacktraceLock>::print
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:47:9
[INFO] [stdout]    9:     0x70e93bf8deb6 - std[f3a103f8b3fbc6]::panicking::default_hook::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:289:27
[INFO] [stdout]   10:     0x70e93bfb58a9 - std[f3a103f8b3fbc6]::panicking::default_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:313:9
[INFO] [stdout]   11:     0x57e9c6f04d50 - test[4d2796dde4b18a79]::test_main_inner::{closure#0}
[INFO] [stdout]   12:     0x70e93bfb5bd2 - <alloc[9de6908353064a78]::boxed::Box<dyn for<'a, 'b> core[a2c1a7cd948629ec]::ops::function::Fn<(&'a std[f3a103f8b3fbc6]::panic::PanicHookInfo<'b>,), Output = ()> + core[a2c1a7cd948629ec]::marker::Send + core[a2c1a7cd948629ec]::marker::Sync> as core[a2c1a7cd948629ec]::ops::function::Fn<(&std[f3a103f8b3fbc6]::panic::PanicHookInfo,)>>::call
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2409:9
[INFO] [stdout]   13:     0x70e93bfb5bd2 - std[f3a103f8b3fbc6]::panicking::panic_with_hook
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:819:13
[INFO] [stdout]   14:     0x70e93bf8df62 - std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:685:13
[INFO] [stdout]   15:     0x70e93bf85899 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_end_short_backtrace::<std[f3a103f8b3fbc6]::panicking::panic_handler::{closure#0}, !>
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/backtrace.rs:182:18
[INFO] [stdout]   16:     0x70e93bf8fa4d - __rustc[72b30b8c63551d82]::rust_begin_unwind
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/panicking.rs:676:5
[INFO] [stdout]   17:     0x70e93c00bf6c - core[a2c1a7cd948629ec]::panicking::panic_fmt
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/core/src/panicking.rs:80:14
[INFO] [stdout]   18:     0x57e9c6eda3fa - <windows_implement[524d9cb96e8c4e68]::tests::generic_no_lifetime::{closure#0} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]   19:     0x57e9c6ef819b - test[4d2796dde4b18a79]::__rust_begin_short_backtrace::<core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>, fn() -> core[a2c1a7cd948629ec]::result::Result<(), alloc[9de6908353064a78]::string::String>>
[INFO] [stdout]   20:     0x57e9c6f05375 - test[4d2796dde4b18a79]::run_test::{closure#0}
[INFO] [stdout]   21:     0x57e9c6efe764 - std[f3a103f8b3fbc6]::sys::backtrace::__rust_begin_short_backtrace::<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>
[INFO] [stdout]   22:     0x57e9c6f08402 - <std[f3a103f8b3fbc6]::thread::lifecycle::spawn_unchecked<test[4d2796dde4b18a79]::run_test::{closure#1}, ()>::{closure#1} as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stdout]   23:     0x70e93bfc0e8f - <alloc[9de6908353064a78]::boxed::Box<dyn core[a2c1a7cd948629ec]::ops::function::FnOnce<(), Output = ()> + core[a2c1a7cd948629ec]::marker::Send> as core[a2c1a7cd948629ec]::ops::function::FnOnce<()>>::call_once
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/alloc/src/boxed.rs:2395:9
[INFO] [stdout]   24:     0x70e93bfc0e8f - <std[f3a103f8b3fbc6]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stdout]                                at /rustc/3b0202dcde0ac75d57351de7b10dfa396747bd5e/library/std/src/sys/thread/unix.rs:127:17
[INFO] [stdout]   25:     0x70e93bd1ddfa - <unknown>
[INFO] [stdout]   26:     0x70e93bdb13d4 - 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.80s
[INFO] [stdout] 
[INFO] [stderr] error: test failed, to rerun pass `--lib`
[INFO] running `"docker" "inspect" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8"`
[INFO] running `"docker" "rm" "-f" "bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8"`
[INFO] [stdout] bdd2599c3a38d14470bc8d545f791926d84cb23a22fae87ddfa5bea93bd578f8
