rust-lang / rust-lang/rust

Tracking issue for future-incompatibility lint `pub_use_of_private_extern_crate`

Open
#127,909 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-crates A-lints A-resolve A-visibility C-future-incompatibility C-tracking-issue T-compiler T-lang
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

The pub_use_of_private_extern_crate lint detects a specific situation of re-exporting a private extern crate:

extern crate core;
pub use core as reexported_core;

A public use declaration should not be used to publicly re-export a private extern crate. pub extern crate should be used instead.This was historically allowed, but is not the intended behavior according to the visibility rules.

This used to be tracked as part of https://github.com/rust-lang/rust/issues/34537, but is only tangentially related so it got a new dedicated tracking issue.

Related PRs

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 the lint description and the related PR #127656, then review the linked crater report for the regressions that blocked making this a hard error. Done would require resolving the compatibility concerns and determining an acceptable path for enforcing the intended visibility rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.