Skip to content

Enabling unstable-provider-api breaks build of dependencies that does not declare the crate attribute #517

@bitdriftr

Description

@bitdriftr

Let's say I have :

  • Crate A which depends on snafu without unstable-provider-api, thus it does not declare #![feature(error_generic_member_access)]
  • Crate B which depends on snafu with unstable-provider-api, and does declare #![feature(error_generic_member_access)]
  • Crate C which depends on A and B.

In that situation :

  • Crate A builds standalone without issue
  • Crate B naturally only builds on nightly
  • Crate C cannot be built at all. It's because enabling the unstable-provider-api will affect generated code in crate A, which will then reference the unstable feature, but still does not declare #![feature(error_generic_member_access)] in lib.rs.

All of this is mostly a limitation when combining macros and features, but I wonder if it could be possible to fix it, by not referencing the nightly feature in generated code, but only in snafu's library code itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions