forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#122757 - h1467792822:priv-dep, r=davidtwco Fixed the `private-dependency` bug Fixed the private-dependency bug: If the directly dependent crate is loaded last and is not configured with `--extern`, it may be incorrectly set to `private-dependency` Fixes rust-lang#122756
- Loading branch information
Showing
4 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//@ aux-crate:priv:foo=foo.rs | ||
//@ compile-flags: -Zunstable-options | ||
|
||
#![crate_type = "rlib"] | ||
extern crate foo; | ||
pub struct Bar(pub i32); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#![crate_type = "rlib"] | ||
pub struct Foo(pub i32); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//@ aux-build: bar.rs | ||
//@ aux-build: foo.rs | ||
//@ build-pass | ||
|
||
#![deny(exported_private_dependencies)] | ||
|
||
// Ensure the libbar.rlib is loaded first. If the command line parameter `--extern foo` does not | ||
// exist, previus version would fail to compile | ||
#![crate_type = "rlib"] | ||
extern crate bar; | ||
extern crate foo; | ||
pub fn baz() -> (Option<foo::Foo>, Option<bar::Bar>) { (None, None) } |