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: Update readme.md warning about "const fn" issues until rust 1.61 is released. #1644

Closed
PapaTBR opened this issue Mar 30, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@PapaTBR
Copy link

PapaTBR commented Mar 30, 2022

Which crate is this about?

windows, windows-sys

Crate version

0.34

Summary

Since the current release of windows-rs breaks the under the current stable release of rustc, shouldn't README.md have a big note at the top explaining the situation and the best resolution? Would save everyone the hassle of reporting the "bug" again and again, and help us newbies understand what's going on.

Thanks,
Tom

Toolchain version/configuration

No response

Reproducible example

No response

Crate manifest

No response

Expected behavior

No response

Actual behavior

No response

Additional comments

No response

@PapaTBR PapaTBR added the bug Something isn't working label Mar 30, 2022
@riverar
Copy link
Collaborator

riverar commented Mar 30, 2022

Hey @PapaTBR, what error are you running into? Where are these duplicate issues you're referring to?

@ryancerium
Copy link
Contributor

I'm guessing a duplicate of #1609, which will have a better error message in 0.35.0. Probably just needs a rustup update to rustc >= 1.59.0 to fix it. It really surprised me.

@riverar
Copy link
Collaborator

riverar commented Mar 30, 2022

@PapaTBR Can you provide rustup show output?

@PapaTBR PapaTBR changed the title Bug: Bug: Update readme.md warning about "const fn" issues until rust 1.61 is released. Mar 30, 2022
@PapaTBR
Copy link
Author

PapaTBR commented Mar 30, 2022

Hi guys, thanks for the patience to a rust newbie. :)

Yes, I'm running rustc 1.59, but the stable release, not a nightly (yet.) And the current stable of windows-rs has several known and closed issues about the "const fn" declarations, including the pinned issue #1523.

Thus I think the readme should temporarily reflect the current issue until rustc 1.61 is released. Sure would have saved me several hours trying to figure out what was going on.

When I build the samples I get 1,149 errors:
O:\rust-src\windows-rs-master\crates\samples\xaml_app>cargo build
Compiling windows v0.34.0
error[E0658]: trait bounds other than Sized on const fn parameters are unstable
--> C:\Users\Tom.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.34.0\src\core\activation_factory.rs:47:22
|
47 | pub const fn new<Identity: ::windows::core::IUnknownImpl, Impl: IActivationFactory_Impl, const OFFSET: isize>() -> IActivationFactory...
| ^^^^^^^^
|
= note: see issue #57563 rust-lang/rust#57563 for more information

error[E0658]: trait bounds other than Sized on const fn parameters are unstable
--> C:\Users\Tom.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.34.0\src\core\activation_factory.rs:47:63
|
47 | pub const fn new<Identity: ::windows::core::IUnknownImpl, Impl: IActivationFactory_Impl, const OFFSET: isize>() -> IActivationFactory...
| ^^^^
|
= note: see issue #57563 rust-lang/rust#57563 for more information

error[E0658]: function pointer casts are not allowed in constant functions
--> C:\Users\Tom.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.34.0\src\core\activation_factory.rs:61:31
|
61 | ActivateInstance: ActivateInstance::<Identity, Impl, OFFSET>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #57563 rust-lang/rust#57563 for more information

error[E0658]: trait bounds other than Sized on const fn parameters are unstable

@kennykerr
Copy link
Collaborator

Even though it is closed, #1523 is pinned for this purpose.

image

@kennykerr
Copy link
Collaborator

Note that this only impacts the implement and interface features. The vast majority of the windows crate (and all of the windows-sys crate) continues to work on the stable Rust compiler. When you use the implement or interface features, the error message clearly identifies the need for "unstable" and thus the nightly Rust compiler. I can appreciate that this might all be a little confusing if you're new to Rust. 😉

Feel free to reach out with more questions. Closing as duplicate of #1523.

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

4 participants