Skip to content

latest nightly won't compile old versions of winapi #49765

Closed
@dimbleby

Description

@dimbleby

As reported at tokio-rs/mio#832 (where I proposed having mio just sidestep this): old versions of winapi fail to build with the nightly compiler.

But @carllerche points out that this seems like a compiler regression, so let's report it here.

Various failures, different in different winapi releases:

2.4:

   Compiling winapi v0.2.4
error[E0391]: cyclic dependency detected
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\sapi.rs:1653:9
     |
1653 | /         SPGO_SRGS as i32 | SPGO_SRGS_MS_SCRIPT as i32 | SPGO_SRGS_W3C_SCRIPT as i32 |
1654 | |         SPGO_SRGS_STG_SCRIPT as i32,
     | |___________________________________^ cyclic reference
     |
note: the cycle begins when const-evaluating `sapi::SPGRAMMAROPTIONS::SPGO_SRGS_SCRIPT::{{initializer}}`...
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\sapi.rs:1653:9
     |
1653 | /         SPGO_SRGS as i32 | SPGO_SRGS_MS_SCRIPT as i32 | SPGO_SRGS_W3C_SCRIPT as i32 |
1654 | |         SPGO_SRGS_STG_SCRIPT as i32,
     | |___________________________________^
note: ...which then requires computing layout of `sapi::SPGRAMMAROPTIONS`...
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\sapi.rs:1653:9
     |
1653 |         SPGO_SRGS as i32 | SPGO_SRGS_MS_SCRIPT as i32 | SPGO_SRGS_W3C_SCRIPT as i32 |
     |         ^^^^^^^^^
     = note: ...which then again requires const-evaluating `sapi::SPGRAMMAROPTIONS::SPGO_SRGS_SCRIPT::{{initializer}}`, completing the cycle.

error: aborting due to previous error

For more information about this error, try `rustc --explain E0391`.
error: Could not compile `winapi`.

To learn more, run the command again with --verbose.

2.5:

   Compiling winapi v0.2.5
error[E0592]: duplicate definitions with name `item`
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.5\src\macros.rs:148:13
     |
148  |                pub unsafe fn $variant(&self) -> &$fieldtype {
     |   _____________-
     |  |_____________|
     | ||
149  | ||                 ::std::mem::transmute(&self.$field)
150  | ||             }
     | ||             -
     | ||_____________|
     | |______________duplicate definitions for `item`
     |                other definition for `item`
     |
    ::: C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.5\src\commctrl.rs:2496:1
     |
2496 |    UNION!(TVINSERTSTRUCTA, itemex, item, item_mut, TV_ITEMA);
     |    ---------------------------------------------------------- in this macro invocation

error[E0592]: duplicate definitions with name `item_mut`
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.5\src\macros.rs:152:13
     |
152  |                pub unsafe fn $variantmut(&mut self) -> &mut $fieldtype {
     |   _____________-
     |  |_____________|
     | ||
153  | ||                 ::std::mem::transmute(&mut self.$field)
154  | ||             }
     | ||             -
     | ||_____________|
     | |______________duplicate definitions for `item_mut`
     |                other definition for `item_mut`
     |
    ::: C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.5\src\commctrl.rs:2496:1
     |
2496 |    UNION!(TVINSERTSTRUCTA, itemex, item, item_mut, TV_ITEMA);
     |    ---------------------------------------------------------- in this macro invocation

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0592`.

2.6:

   Compiling winapi v0.2.6
error[E0080]: constant evaluation error
   --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.6\src\commctrl.rs:162:31
    |
162 | pub const BCN_FIRST: ::UINT = 0 - 1250;
    |                               ^^^^^^^^ attempt to subtract with overflow

error[E0080]: constant evaluation error
   --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.6\src\commctrl.rs:130:31
    |
130 | pub const HDN_FIRST: ::UINT = 0 - 300;
    |                               ^^^^^^^ attempt to subtract with overflow

error[E0080]: constant evaluation error
   --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.6\src\commctrl.rs:140:31
    |
140 | pub const TBN_FIRST: ::UINT = 0 - 700;
    |                               ^^^^^^^ attempt to subtract with overflow

... etc.

Compiler is rustc 1.27.0-nightly (eeea94c11 2018-04-06)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions