tests: fix pub-priv-dep test expectation

This commit is contained in:
David Mládek
2026-05-20 00:13:35 +02:00
parent 1ea1171c1e
commit 018ac99bc0
2 changed files with 23 additions and 4 deletions
@@ -1,7 +1,6 @@
//@ aux-crate:priv:shared=shared.rs
//@ aux-crate:reexport=reexport.rs
//@ aux-crate:priv:reexport=reexport.rs
//@ compile-flags: -Zunstable-options
//@ check-pass
// A shared dependency, where a private dependency reexports a public dependency.
//
@@ -21,12 +20,12 @@
extern crate shared;
extern crate reexport;
// FIXME: This should trigger.
pub fn leaks_priv() -> shared::Shared {
//~^ ERROR type `Shared` from private dependency 'shared' in public interface
shared::Shared
}
// FIXME: This should trigger.
pub fn leaks_priv_reexport() -> reexport::Shared {
//~^ ERROR type `Shared` from private dependency 'shared' in public interface
reexport::Shared
}
@@ -0,0 +1,20 @@
error: type `Shared` from private dependency 'shared' in public interface
--> $DIR/shared_both_private.rs:23:1
|
LL | pub fn leaks_priv() -> shared::Shared {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/shared_both_private.rs:18:9
|
LL | #![deny(exported_private_dependencies)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: type `Shared` from private dependency 'shared' in public interface
--> $DIR/shared_both_private.rs:28:1
|
LL | pub fn leaks_priv_reexport() -> reexport::Shared {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors