Skip to content

tests: fix pub-priv-dep test expectation#156764

Open
mladedav wants to merge 1 commit into
rust-lang:mainfrom
mladedav:dm/private-public
Open

tests: fix pub-priv-dep test expectation#156764
mladedav wants to merge 1 commit into
rust-lang:mainfrom
mladedav:dm/private-public

Conversation

@mladedav
Copy link
Copy Markdown
Contributor

@mladedav mladedav commented May 19, 2026

Related to private dependencies #44663

The test had wrongly configured dependency privacy. The ascii graph shows that both dependencies should be private. Furthermore, the way this test existed was effectively identical to shared_direct_private.rs.

@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. labels May 19, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 19, 2026

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 20 candidates

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
1 error: type `Shared` from private dependency 'shared' in public interface
-   --> $DIR/shared_both_private.rs:24:1
+   --> $DIR/shared_both_private.rs:23:1
3    |
4 LL | pub fn leaks_priv() -> shared::Shared {
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

11    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 
13 error: type `Shared` from private dependency 'shared' in public interface
---
To only update this specific test, also pass `--test-args privacy/pub-priv-dep/shared_both_private.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/pub-priv-dep/shared_both_private.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/privacy/pub-priv-dep/shared_both_private" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/privacy/pub-priv-dep/shared_both_private/auxiliary" "-Zunstable-options" "--extern" "priv:shared=/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/privacy/pub-priv-dep/shared_both_private/auxiliary/libshared.so" "--extern" "priv:reexport=/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/privacy/pub-priv-dep/shared_both_private/auxiliary/libreexport.so"
stdout: none
--- stderr -------------------------------
error: type `Shared` from private dependency 'shared' in public interface
##[error]  --> /checkout/tests/ui/privacy/pub-priv-dep/shared_both_private.rs:23:1
   |
LL | pub fn leaks_priv() -> shared::Shared {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> /checkout/tests/ui/privacy/pub-priv-dep/shared_both_private.rs:18:9
   |

@Zalathar
Copy link
Copy Markdown
Member

Looks like the test needs another bless to fix the line numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants