Skip to content

Compilation error in the vulkano crate on nightly expected isize, found i32 #137662

@ogoffart

Description

@ogoffart
Contributor

Compiling the vulkano crate fails with the latest nightly.

Error:

error[E0308]: mismatched types
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/vulkano-0.34.1/src/macros.rs:658:48
    |
658 |                   $flag_name = ash::vk::$ty_ffi::$flag_name_ffi.as_raw(),
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `i32`
    |
   ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/vulkano-0.34.1/src/acceleration_structure.rs:315:1
    |
315 | / vulkan_enum! {
316 | |     #[non_exhaustive]
317 | |
318 | |     /// The type of an acceleration structure.
...   |
330 | |     Generic = GENERIC,
331 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `vulkan_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/vulkano-0.34.1/src/macros.rs:658:48
     |
658  |                   $flag_name = ash::vk::$ty_ffi::$flag_name_ffi.as_raw(),
     |                                                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `i32`
     |
    ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/vulkano-0.34.1/src/acceleration_structure.rs:1591:1
     |
1591 | / vulkan_enum! {
1592 | |     #[non_exhaustive]
1593 | |
1594 | |     /// What mode an acceleration structure copy command should operate in.
...    |
1618 | |     Deserialize = DESERIALIZE,
1619 | | }
     | |_- in this macro invocation
     |
     = note: this error originates in the macro `vulkan_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/vulkano-0.34.1/src/macros.rs:658:48
     |
658  |                   $flag_name = ash::vk::$ty_ffi::$flag_name_ffi.as_raw(),
     |                                                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `i32`
     |
    ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/vulkano-0.34.1/src/acceleration_structure.rs:1621:1
     |
1621 | / vulkan_enum! {
1622 | |     #[non_exhaustive]
1623 | |
1624 | |     /// Where the building of an acceleration structure will take place.
...    |
1634 | |     HostOrDevice = HOST_OR_DEVICE,
1635 | | }
     | |_- in this macro invocation
     |
     = note: this error originates in the macro `vulkan_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

(... skipped more of the same ...)

This is using the version 0.34.1 of vulkano but I have verified this also fails in the master branch of https://github.com/vulkano-rs/vulkano/

The error was noticed because we build with nightly on our CI, and we depends on that crate

Version it worked on

Works on nightly-2025-02-24

rustc 1.87.0-nightly (f8a913b 2025-02-23)

Version with regression

Current nightly

rustc 1.87.0-nightly (85abb27 2025-02-25)

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged

Activity

added
C-bugCategory: This is a bug.
regression-untriagedUntriaged performance or correctness regression.
on Feb 26, 2025
added
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
and removed
regression-untriagedUntriaged performance or correctness regression.
on Feb 26, 2025
added a commit that references this issue on Feb 26, 2025
added
E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Feb 26, 2025
Noratrieb

Noratrieb commented on Feb 26, 2025

@Noratrieb
Member

Thank you for the report! It would be useful to bisect the regression using cargo-bisect-rustc to make it easier to figure out what happened and ping the relevant people.
@rustbot label E-needs-bisection

cyrgani

cyrgani commented on Feb 26, 2025

@cyrgani
Contributor

working on reducing this

cyrgani

cyrgani commented on Feb 26, 2025

@cyrgani
Contributor

reduction:

macro_rules! vulkan_enum {
    {
        $repr:ty
    } => {
        #[repr($repr)]
        pub enum Foo {
            Bar = 0i32,
        }
    }
}

vulkan_enum! {
    i32
}

bisection:

searched nightlies: from nightly-2025-02-24 to nightly-2025-02-26
regressed nightly: nightly-2025-02-26
searched commit range: 617aad8...85abb27
regressed commit: 7d8c6e7

bisected with cargo-bisect-rustc v0.6.9

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start=2025-02-24 
cc @jdonszelmann

@rustbot label:S-has-mcve -E-needs-mcve S-has-bisection -E-needs-bisection

added
S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
and removed
E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
on Feb 26, 2025

20 remaining items

added 2 commits that reference this issue on Mar 4, 2025
73bea6c
37bc59a
added 3 commits that reference this issue on Mar 4, 2025
f3a72c2
3f559bd
4fad28f
added 3 commits that reference this issue on Mar 5, 2025
ff89925
43ef0d7
128a5ec
added a commit that references this issue on Mar 6, 2025
7d5a65f
added a commit that references this issue on Mar 6, 2025
f983315
added a commit that references this issue on Mar 6, 2025
34d273b
added a commit that references this issue on Mar 7, 2025
7d8f2b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-reprArea: the `#[repr(stuff)]` attributeC-bugCategory: This is a bug.P-criticalCritical priorityS-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @ogoffart@apiraino@jdonszelmann@jieyouxu@rustbot

    Issue actions

      Compilation error in the vulkano crate on nightly `expected isize, found i32` · Issue #137662 · rust-lang/rust