Skip to content

winapi broken in recent nightly #65709

New issue

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

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

Already on GitHub? # to your account

Closed
retep998 opened this issue Oct 22, 2019 · 4 comments
Closed

winapi broken in recent nightly #65709

retep998 opened this issue Oct 22, 2019 · 4 comments
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@retep998
Copy link
Member

error: attempt to shift left with overflow
   --> src\macros.rs:350:29
    |
350 |                   let mask = ((1 << ($r.end - $r.start)) - 1) << $r.start;
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^
    | 
   ::: src\shared\d3dukmdt.rs:257:1
    |
257 | / BITFIELD!{D3DDDICB_LOCK2FLAGS Value: UINT [
258 | |     Reserved set_Reserved[0..32],
259 | | ]}
    | |__- in this macro invocation
    |
    = note: `#[deny(const_err)]` on by default

Using rustc 1.40.0-nightly (7979016af 2019-10-20)

@retep998 retep998 added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Oct 22, 2019
@jonas-schievink jonas-schievink added A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) C-bug Category: This is a bug. I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 22, 2019
@jonas-schievink
Copy link
Contributor

cc @oli-obk

@Centril
Copy link
Contributor

Centril commented Oct 22, 2019

and cc @wesleywiser

@wesleywiser
Copy link
Member

I assume in this context UINT is a 32-bit unsigned integer? If so, the lint appears to be triggering correctly. This has likely started triggering because of some recent improvements to the ConstProp pass.

I believe this behavior is covered under RFC 1129 so this is expected behavior.

If you want to continue using this code as is, you can either add #![warn(const_err)] or #![allow(const_err)] to the appropriate module.

This won't break crates dependent on winapi since cargo passes --cap-lints allow to rustc when compiling dependencies.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 23, 2019

It may also have started getting reported due to #65320 which makes sure that we report const_err even if the code causing the lint to trigger is part of a macro from another crate.

Closing as wontfix because this is the expected behaviour and is easily silenced by an allow attribute.

@oli-obk oli-obk closed this as completed Oct 23, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants