-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if rust-src contains a vendor dir, and patch it in
This is the cargo side of rust-lang/wg-cargo-std-aware#23
- Loading branch information
Showing
15 changed files
with
188 additions
and
72 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
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
9 changes: 9 additions & 0 deletions
9
tests/testsuite/mock-std/vendor/registry-dep-only-used-by-test/Cargo.toml
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,9 @@ | ||
[package] | ||
name = "registry-dep-only-used-by-test" | ||
version = "1.0.0" | ||
authors = ["Alex Crichton <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
|
||
[features] |
2 changes: 2 additions & 0 deletions
2
tests/testsuite/mock-std/vendor/registry-dep-only-used-by-test/src/lib.rs
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 @@ | ||
pub fn wow_testing_is_so_easy() { | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/testsuite/mock-std/vendor/registry-dep-using-alloc/Cargo.toml
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 @@ | ||
[package] | ||
name = "registry-dep-using-alloc" | ||
version = "1.0.0" | ||
authors = ["Alex Crichton <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
rustc-std-workspace-alloc = { version = "*", optional = true } | ||
rustc-std-workspace-core = { version = "*", optional = true } | ||
|
||
[features] | ||
mockbuild = ["rustc-std-workspace-alloc", "rustc-std-workspace-core"] |
9 changes: 9 additions & 0 deletions
9
tests/testsuite/mock-std/vendor/registry-dep-using-alloc/src/lib.rs
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,9 @@ | ||
#[cfg(feature = "mockbuild")] | ||
pub fn custom_api() { | ||
} | ||
|
||
#[cfg(not(feature = "mockbuild"))] | ||
pub fn non_sysroot_api() { | ||
core::custom_api(); | ||
alloc::custom_api(); | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/testsuite/mock-std/vendor/registry-dep-using-core/Cargo.toml
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,11 @@ | ||
[package] | ||
name = "registry-dep-using-core" | ||
version = "1.0.0" | ||
authors = ["Alex Crichton <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
rustc-std-workspace-core = { version = "*", optional = true } | ||
|
||
[features] | ||
mockbuild = ["rustc-std-workspace-core"] |
8 changes: 8 additions & 0 deletions
8
tests/testsuite/mock-std/vendor/registry-dep-using-core/src/lib.rs
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,8 @@ | ||
#[cfg(feature = "mockbuild")] | ||
pub fn custom_api() { | ||
} | ||
|
||
#[cfg(not(feature = "mockbuild"))] | ||
pub fn non_sysroot_api() { | ||
core::custom_api(); | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/testsuite/mock-std/vendor/registry-dep-using-std/Cargo.toml
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,11 @@ | ||
[package] | ||
name = "registry-dep-using-std" | ||
version = "1.0.0" | ||
authors = ["Alex Crichton <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
rustc-std-workspace-std = { version = "*", optional = true } | ||
|
||
[features] | ||
mockbuild = ["rustc-std-workspace-std"] |
8 changes: 8 additions & 0 deletions
8
tests/testsuite/mock-std/vendor/registry-dep-using-std/src/lib.rs
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,8 @@ | ||
#[cfg(feature = "mockbuild")] | ||
pub fn custom_api() { | ||
} | ||
|
||
#[cfg(not(feature = "mockbuild"))] | ||
pub fn non_sysroot_api() { | ||
std::custom_api(); | ||
} |
1 change: 1 addition & 0 deletions
1
tests/testsuite/mock-std/vendor/rustc-std-workspace-alloc/Cargo.toml
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 @@ | ||
this file shouldn't be read |
1 change: 1 addition & 0 deletions
1
tests/testsuite/mock-std/vendor/rustc-std-workspace-core/Cargo.toml
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 @@ | ||
this file shouldn't be read |
1 change: 1 addition & 0 deletions
1
tests/testsuite/mock-std/vendor/rustc-std-workspace-std/Cargo.toml
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 @@ | ||
this file shouldn't be read |
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