Skip to content

Conversation

mladedav
Copy link
Contributor

@mladedav mladedav commented Jul 12, 2025

Part of public/private dependencies #44663
Partially addresses #71043

I'm adding a warning for reexports of private dependencies into rustc_resolve. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in rustc_privacy, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with dcx would be appreciated.

This also sets the std_detect crate as a public dependency of std because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.

@rustbot
Copy link
Collaborator

rustbot commented Jul 12, 2025

r? @compiler-errors

rustbot has assigned @compiler-errors.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 12, 2025
@compiler-errors
Copy link
Member

r? petrochenkov perhaps

@bors

This comment was marked as resolved.

@petrochenkov
Copy link
Contributor

I'm adding a warning for reexports of private dependencies into rustc_resolve. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in rustc_privacy, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with dcx would be appreciated.

See calls to buffer_lint in rustc_resolve, they can be used as examples.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 2025
@mladedav mladedav force-pushed the dm/private-reexport branch from 070e53d to d2fc98c Compare July 14, 2025 20:38
@mladedav
Copy link
Contributor Author

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 14, 2025
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 15, 2025
@mladedav mladedav force-pushed the dm/private-reexport branch 2 times, most recently from a0d9f53 to d6ea20e Compare July 15, 2025 13:39
@mladedav mladedav force-pushed the dm/private-reexport branch from d6ea20e to d627e25 Compare July 15, 2025 13:46
@petrochenkov
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Jul 15, 2025

📌 Commit d627e25 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 15, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 16, 2025
…trochenkov

Linting public reexport of private dependencies

Part of public/private dependencies rust-lang#44663
Partially addresses rust-lang#71043

I'm adding a warning for reexports of private dependencies into `rustc_resolve`. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in `rustc_privacy`, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with `dcx` would be appreciated.

This also sets the `std_detect` crate as a public dependency of `std` because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 16, 2025
…trochenkov

Linting public reexport of private dependencies

Part of public/private dependencies rust-lang#44663
Partially addresses rust-lang#71043

I'm adding a warning for reexports of private dependencies into `rustc_resolve`. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in `rustc_privacy`, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with `dcx` would be appreciated.

This also sets the `std_detect` crate as a public dependency of `std` because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 16, 2025
…trochenkov

Linting public reexport of private dependencies

Part of public/private dependencies rust-lang#44663
Partially addresses rust-lang#71043

I'm adding a warning for reexports of private dependencies into `rustc_resolve`. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in `rustc_privacy`, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with `dcx` would be appreciated.

This also sets the `std_detect` crate as a public dependency of `std` because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.
bors added a commit that referenced this pull request Jul 16, 2025
Rollup of 11 pull requests

Successful merges:

 - #143595 (add `const_make_global`; err for `const_allocate` ptrs if didn't call)
 - #143678 (Added error for invalid char cast)
 - #143793 (Opaque type collection: Guard against endlessly recursing free alias types)
 - #143820 (Fixed a core crate compilation failure when enabling the `optimize_for_size` feature on some targets)
 - #143829 (Trim `BorrowedCursor` API)
 - #143856 (Linting public reexport of private dependencies)
 - #143891 (Port `#[coverage]` to the new attribute system)
 - #143914 (Reword mismatched-lifetime-syntaxes text based on feedback)
 - #143922 (Improve path segment joining)
 - #143926 (Remove deprecated fields in bootstrap)
 - #143975 (type_id_eq: check that the hash fully matches the type)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request Jul 16, 2025
…trochenkov

Linting public reexport of private dependencies

Part of public/private dependencies rust-lang#44663
Partially addresses rust-lang#71043

I'm adding a warning for reexports of private dependencies into `rustc_resolve`. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in `rustc_privacy`, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with `dcx` would be appreciated.

This also sets the `std_detect` crate as a public dependency of `std` because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.
bors added a commit that referenced this pull request Jul 17, 2025
Rollup of 15 pull requests

Successful merges:

 - #142304 (tests: Add `RUST_BACKTRACE` and `-Cpanic` revisions to `panic-main.rs` test)
 - #143388 (Various refactors to the LTO handling code)
 - #143409 (Enable xgot feature for mips64 musl targets)
 - #143592 (UWP: link ntdll functions using raw-dylib)
 - #143595 (add `const_make_global`; err for `const_allocate` ptrs if didn't call)
 - #143678 (Added error for invalid char cast)
 - #143820 (Fixed a core crate compilation failure when enabling the `optimize_for_size` feature on some targets)
 - #143829 (Trim `BorrowedCursor` API)
 - #143846 (pass --gc-sections if -Zexport-executable-symbols is enabled and improve tests)
 - #143851 (ci cleanup: rustdoc-gui-test now installs browser-ui-test)
 - #143856 (Linting public reexport of private dependencies)
 - #143895 (Dont collect assoc ty item bounds from trait where clause for host effect predicates)
 - #143922 (Improve path segment joining)
 - #143964 (Fix handling of SCRIPT_ARG in docker images)
 - #144016 (trait_sel: `MetaSized` always holds temporarily)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 17, 2025
Rollup of 15 pull requests

Successful merges:

 - #142304 (tests: Add `RUST_BACKTRACE` and `-Cpanic` revisions to `panic-main.rs` test)
 - #143388 (Various refactors to the LTO handling code)
 - #143409 (Enable xgot feature for mips64 musl targets)
 - #143592 (UWP: link ntdll functions using raw-dylib)
 - #143595 (add `const_make_global`; err for `const_allocate` ptrs if didn't call)
 - #143678 (Added error for invalid char cast)
 - #143820 (Fixed a core crate compilation failure when enabling the `optimize_for_size` feature on some targets)
 - #143829 (Trim `BorrowedCursor` API)
 - #143851 (ci cleanup: rustdoc-gui-test now installs browser-ui-test)
 - #143856 (Linting public reexport of private dependencies)
 - #143895 (Dont collect assoc ty item bounds from trait where clause for host effect predicates)
 - #143922 (Improve path segment joining)
 - #143964 (Fix handling of SCRIPT_ARG in docker images)
 - #144002 (Update poison.rs)
 - #144016 (trait_sel: `MetaSized` always holds temporarily)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 36a362b into rust-lang:master Jul 17, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 17, 2025
rust-timer added a commit that referenced this pull request Jul 17, 2025
Rollup merge of #143856 - mladedav:dm/private-reexport, r=petrochenkov

Linting public reexport of private dependencies

Part of public/private dependencies #44663
Partially addresses #71043

I'm adding a warning for reexports of private dependencies into `rustc_resolve`. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in `rustc_privacy`, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with `dcx` would be appreciated.

This also sets the `std_detect` crate as a public dependency of `std` because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Jul 21, 2025
…trochenkov

Linting public reexport of private dependencies

Part of public/private dependencies rust-lang#44663
Partially addresses rust-lang#71043

I'm adding a warning for reexports of private dependencies into `rustc_resolve`. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in `rustc_privacy`, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with `dcx` would be appreciated.

This also sets the `std_detect` crate as a public dependency of `std` because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Jul 21, 2025
Rollup of 15 pull requests

Successful merges:

 - rust-lang#142304 (tests: Add `RUST_BACKTRACE` and `-Cpanic` revisions to `panic-main.rs` test)
 - rust-lang#143388 (Various refactors to the LTO handling code)
 - rust-lang#143409 (Enable xgot feature for mips64 musl targets)
 - rust-lang#143592 (UWP: link ntdll functions using raw-dylib)
 - rust-lang#143595 (add `const_make_global`; err for `const_allocate` ptrs if didn't call)
 - rust-lang#143678 (Added error for invalid char cast)
 - rust-lang#143820 (Fixed a core crate compilation failure when enabling the `optimize_for_size` feature on some targets)
 - rust-lang#143829 (Trim `BorrowedCursor` API)
 - rust-lang#143851 (ci cleanup: rustdoc-gui-test now installs browser-ui-test)
 - rust-lang#143856 (Linting public reexport of private dependencies)
 - rust-lang#143895 (Dont collect assoc ty item bounds from trait where clause for host effect predicates)
 - rust-lang#143922 (Improve path segment joining)
 - rust-lang#143964 (Fix handling of SCRIPT_ARG in docker images)
 - rust-lang#144002 (Update poison.rs)
 - rust-lang#144016 (trait_sel: `MetaSized` always holds temporarily)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Jul 29, 2025
…trochenkov

Linting public reexport of private dependencies

Part of public/private dependencies rust-lang#44663
Partially addresses rust-lang#71043

I'm adding a warning for reexports of private dependencies into `rustc_resolve`. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in `rustc_privacy`, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with `dcx` would be appreciated.

This also sets the `std_detect` crate as a public dependency of `std` because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.
rust-cloud-vms bot pushed a commit to makai410/rustc_public that referenced this pull request Aug 16, 2025
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#142304 (tests: Add `RUST_BACKTRACE` and `-Cpanic` revisions to `panic-main.rs` test)
 - rust-lang/rust#143388 (Various refactors to the LTO handling code)
 - rust-lang/rust#143409 (Enable xgot feature for mips64 musl targets)
 - rust-lang/rust#143592 (UWP: link ntdll functions using raw-dylib)
 - rust-lang/rust#143595 (add `const_make_global`; err for `const_allocate` ptrs if didn't call)
 - rust-lang/rust#143678 (Added error for invalid char cast)
 - rust-lang/rust#143820 (Fixed a core crate compilation failure when enabling the `optimize_for_size` feature on some targets)
 - rust-lang/rust#143829 (Trim `BorrowedCursor` API)
 - rust-lang/rust#143851 (ci cleanup: rustdoc-gui-test now installs browser-ui-test)
 - rust-lang/rust#143856 (Linting public reexport of private dependencies)
 - rust-lang/rust#143895 (Dont collect assoc ty item bounds from trait where clause for host effect predicates)
 - rust-lang/rust#143922 (Improve path segment joining)
 - rust-lang/rust#143964 (Fix handling of SCRIPT_ARG in docker images)
 - rust-lang/rust#144002 (Update poison.rs)
 - rust-lang/rust#144016 (trait_sel: `MetaSized` always holds temporarily)

r? `@ghost`
`@rustbot` modify labels: rollup
rust-cloud-vms bot pushed a commit to makai410/rustc_public that referenced this pull request Aug 20, 2025
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#142304 (tests: Add `RUST_BACKTRACE` and `-Cpanic` revisions to `panic-main.rs` test)
 - rust-lang/rust#143388 (Various refactors to the LTO handling code)
 - rust-lang/rust#143409 (Enable xgot feature for mips64 musl targets)
 - rust-lang/rust#143592 (UWP: link ntdll functions using raw-dylib)
 - rust-lang/rust#143595 (add `const_make_global`; err for `const_allocate` ptrs if didn't call)
 - rust-lang/rust#143678 (Added error for invalid char cast)
 - rust-lang/rust#143820 (Fixed a core crate compilation failure when enabling the `optimize_for_size` feature on some targets)
 - rust-lang/rust#143829 (Trim `BorrowedCursor` API)
 - rust-lang/rust#143851 (ci cleanup: rustdoc-gui-test now installs browser-ui-test)
 - rust-lang/rust#143856 (Linting public reexport of private dependencies)
 - rust-lang/rust#143895 (Dont collect assoc ty item bounds from trait where clause for host effect predicates)
 - rust-lang/rust#143922 (Improve path segment joining)
 - rust-lang/rust#143964 (Fix handling of SCRIPT_ARG in docker images)
 - rust-lang/rust#144002 (Update poison.rs)
 - rust-lang/rust#144016 (trait_sel: `MetaSized` always holds temporarily)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants