Skip to content

Unrelated Code Fails to Typecheck when Feature Enabled #74919

@cwfitzgerald

Description

@cwfitzgerald

When building the following wgpu-rs commit with default features, everything compiles. When the subscriber feature is enabled with --features subscriber, the these two lines of code fail to compile. They are unrelated to the feature. The error is:

error[E0282]: type annotations needed
  --> src\util\mod.rs:38:9
   |
38 |         debug_assert_eq!(pre, &[]);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

gfx-rs/wgpu-rs@9a9bf53

I have no idea how to even start making a reduced example.

Meta

Issue happens on both stable and nightly:

rustc --version --verbose:

rustc 1.44.1 (c7087fe00 2020-06-17)
binary: rustc
commit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7
commit-date: 2020-06-17
host: x86_64-pc-windows-msvc
release: 1.44.1
LLVM version: 9.0

rustc +nightly --version --verbose

rustc 1.47.0-nightly (6c8927b0c 2020-07-26)
binary: rustc
commit-hash: 6c8927b0cf80ceee19386026cf9d7fd4fd9d486f
commit-date: 2020-07-26
host: x86_64-pc-windows-msvc
release: 1.47.0-nightly
LLVM version: 10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inferenceArea: Type inferenceC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions