rust-lang / rust-lang/rust

`#[export_stable]` should also check whether items are exportable on non-sdylib crate_types

Open
#158,227 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-attributes C-bug F-export_stable needs-triage
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Currently #[export_stable] is blindly allowed on all targets on non-sdylib crates.
https://github.com/rust-lang/rust/pull/158221 will fix this to limit the set of targets.

But the set of checks on check_export.rs should also run on all crate_types.
After this is fixed, the exportable.rs test should be adjusted to test this for all crate types.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading check_export.rs to see which exportability checks currently apply only to sdylib crate types. Then inspect tests/ui/attributes/export/exportable.rs and extend its coverage across all crate types; done means the checks run consistently and the UI test passes for each relevant crate type.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
67/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.