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

Bug: Can't compile with the implement feature #1614

Closed
robmikh opened this issue Mar 18, 2022 · 2 comments
Closed

Bug: Can't compile with the implement feature #1614

robmikh opened this issue Mar 18, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@robmikh
Copy link
Member

robmikh commented Mar 18, 2022

Which crate is this about?

windows

Crate version

v0.34.0

Summary

Using the implement feature causes several compiler errors.

Toolchain version/configuration

Default host: x86_64-pc-windows-msvc
rustup home:  C:\...\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-msvc
beta-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc

installed targets for active toolchain
--------------------------------------

aarch64-pc-windows-msvc
wasm32-unknown-unknown
wasm32-wasi
x86_64-pc-windows-msvc

active toolchain
----------------

stable-x86_64-pc-windows-msvc (default)
rustc 1.59.0 (9d1b2106e 2022-02-23)

Reproducible example

fn main() {
    println!("Hello, world!");
}

Crate manifest

[dependencies.windows]
version = "0.34.0"
features = [
    "alloc",
    "implement",
    "Win32_System_WinRT",
]

Expected behavior

No compiler errors.

Actual behavior

There are 90 errors, but they're all variations on these:

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> C:\...\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.34.0\src\Windows\Win32\System\WinRT\impl.rs:939:63
    |
939 |     pub const fn new<Identity: ::windows::core::IUnknownImpl, Impl: IWeakReferenceSource_Impl, const OFFSET: isize>() -> IWeakReferenceSo...
    |                                                               ^^^^
    |
    = 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:\...\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.34.0\src\Windows\Win32\System\WinRT\impl.rs:951:98
    |
951 | ...:new::<Identity, OFFSET>(), GetWeakReference: GetWeakReference::<Identity, Impl, OFFSET> }
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information

Additional comments

No response

@robmikh robmikh added the bug Something isn't working label Mar 18, 2022
@robmikh
Copy link
Member Author

robmikh commented Mar 18, 2022

Ah, I missed that implement now requires nightly. I had been using build in a previous version of the create.

@robmikh robmikh closed this as completed Mar 18, 2022
@kennykerr
Copy link
Collaborator

Sorry about the confusion. I have pinned #1523 to make this more discoverable. Won't be long now. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants