Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface macro not usable on stable #1617

Closed
MolotovCherry opened this issue Mar 18, 2022 · 1 comment
Closed

Interface macro not usable on stable #1617

MolotovCherry opened this issue Mar 18, 2022 · 1 comment

Comments

@MolotovCherry
Copy link

MolotovCherry commented Mar 18, 2022

The new interface macro requires a user to use nightly, because errors about missing features are output. Originally required these features (below), although they were stabilized on 1.61.0. Still though however they will not work without a beta/nightly until 1.61.0 is officially released.

I'm unsure if this is worthy of a bug report, especially since these were stabilized (albeit in a future edition). If this is a "won't-fix" kind of thing, then I suppose it would be nicer if it was documented perhaps. You can close this issue otherwise - I just wanted to make a note about this behavior in case it was undesirable

Workaround: Install latest nightly
Features:

#![feature(const_fn_fn_ptr_basics)]
#![feature(const_fn_trait_bound)]

Errors:

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
    --> C:\Users\<user>\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.34.0\src\Windows\Win32\System\Wmi\impl.rs:3564:63
     |
3564 |     pub const fn new<Identity: ::windows::core::IUnknownImpl, Impl: IWbemEventSink_Impl, const OFFSET: isize>() -> IWbemEventSink_Vtbl {        
     |                                                               ^^^^
     |
     = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
error[E0658]: function pointer casts are not allowed in constant functions
    --> C:\Users\user>\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.34.0\src\Windows\Win32\System\Wmi\impl.rs:3593:30
     |
3593 |             SetSinkSecurity: SetSinkSecurity::<Identity, Impl, OFFSET>,
     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information

Reproduce: use this in cargo.toml with 1.59.0

[dependencies.windows]
version = "0.34.0"
features = [
    "interface",
    # workaround https://github.com/microsoft/windows-rs/pull/1612
    "implement"
]
@kennykerr
Copy link
Collaborator

Thanks for the feedback. I have clarified this further in #1523 and pinned that issue so that it is more easily discoverable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants