Skip to content

bindgen! named_imports edge cases #14856

Open

Description

@jrandolf

A few smaller bindgen! issues around labelled imports and named_imports:

  • A named_imports key naming an interface that's in the package but not imported by the world (e.g. only exported) makes the proc macro panic with no entry found for key instead of reporting an error. An unknown key gives a proper error.
  • @unstable gates on labelled imports are looked up by interface id, so every label of an interface gets the first label's gate. With import a: store; @unstable(feature = x) import b: store;, b is linked with default LinkOptions, and gating a instead gates b.
  • An unversioned key like named_imports: { "foo:foo/store": u32 } binds only the first matching version when the world imports a: foo:foo/store@0.1.0 and b: foo:foo/store@0.2.0; b is silently left unbound.
  • Export labels can collide with generated names: in package foo:foo, export foo: greeter; export greeter; fails with E0428.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions