diff --git a/src/cargo/core/compiler/standard_lib.rs b/src/cargo/core/compiler/standard_lib.rs index a83650f33da..ed3dd77336c 100644 --- a/src/cargo/core/compiler/standard_lib.rs +++ b/src/cargo/core/compiler/standard_lib.rs @@ -46,7 +46,7 @@ pub fn resolve_std<'cfg>( let patches = to_patch .iter() .map(|&name| { - let source_path = SourceId::for_path(&src_path.join("src").join("tools").join(name))?; + let source_path = SourceId::for_path(&src_path.join("library").join(name))?; let dep = Dependency::parse_no_deprecated(name, None, source_path)?; Ok(dep) }) @@ -55,10 +55,10 @@ pub fn resolve_std<'cfg>( let mut patch = HashMap::new(); patch.insert(crates_io_url, patches); let members = vec![ - String::from("src/libstd"), - String::from("src/libcore"), - String::from("src/liballoc"), - String::from("src/libtest"), + String::from("library/std"), + String::from("library/core"), + String::from("library/alloc"), + String::from("library/test"), ]; let ws_config = crate::core::WorkspaceConfig::Root(crate::core::WorkspaceRootConfig::new( &src_path, @@ -85,7 +85,7 @@ pub fn resolve_std<'cfg>( // other crates need to alter their features, this should be fine, for // now. Perhaps in the future features will be decoupled from the resolver // and it will be easier to control feature selection. - let current_manifest = src_path.join("src/libtest/Cargo.toml"); + let current_manifest = src_path.join("library/test/Cargo.toml"); // TODO: Consider doing something to enforce --locked? Or to prevent the // lock file from being written, such as setting ephemeral. let mut std_ws = Workspace::new_virtual(src_path, current_manifest, virtual_manifest, config)?; diff --git a/tests/testsuite/mock-std/Cargo.toml b/tests/testsuite/mock-std/Cargo.toml index 3cc10acb2e4..a69aa4b88fa 100644 --- a/tests/testsuite/mock-std/Cargo.toml +++ b/tests/testsuite/mock-std/Cargo.toml @@ -1,8 +1,8 @@ [workspace] members = [ - "src/liballoc", - "src/libcore", - "src/libproc_macro", - "src/libstd", - "src/libtest", + "library/alloc", + "library/core", + "library/proc_macro", + "library/std", + "library/test", ] diff --git a/tests/testsuite/mock-std/src/liballoc/Cargo.toml b/tests/testsuite/mock-std/library/alloc/Cargo.toml similarity index 89% rename from tests/testsuite/mock-std/src/liballoc/Cargo.toml rename to tests/testsuite/mock-std/library/alloc/Cargo.toml index 23034673665..dc965abffac 100644 --- a/tests/testsuite/mock-std/src/liballoc/Cargo.toml +++ b/tests/testsuite/mock-std/library/alloc/Cargo.toml @@ -4,8 +4,5 @@ version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" -[lib] -path = "lib.rs" - [dependencies] registry-dep-using-core = { version = "*", features = ['mockbuild'] } diff --git a/tests/testsuite/mock-std/src/liballoc/lib.rs b/tests/testsuite/mock-std/library/alloc/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/liballoc/lib.rs rename to tests/testsuite/mock-std/library/alloc/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libcompiler_builtins/Cargo.toml b/tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml similarity index 84% rename from tests/testsuite/mock-std/src/libcompiler_builtins/Cargo.toml rename to tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml index 1bb02f9907c..d1df281d6d0 100644 --- a/tests/testsuite/mock-std/src/libcompiler_builtins/Cargo.toml +++ b/tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml @@ -3,6 +3,3 @@ name = "compiler_builtins" version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" - -[lib] -path = "lib.rs" diff --git a/tests/testsuite/mock-std/src/libcompiler_builtins/lib.rs b/tests/testsuite/mock-std/library/compiler_builtins/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libcompiler_builtins/lib.rs rename to tests/testsuite/mock-std/library/compiler_builtins/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libcore/Cargo.toml b/tests/testsuite/mock-std/library/core/Cargo.toml similarity index 82% rename from tests/testsuite/mock-std/src/libcore/Cargo.toml rename to tests/testsuite/mock-std/library/core/Cargo.toml index b448bdb085d..3f7de53db06 100644 --- a/tests/testsuite/mock-std/src/libcore/Cargo.toml +++ b/tests/testsuite/mock-std/library/core/Cargo.toml @@ -3,6 +3,3 @@ name = "core" version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" - -[lib] -path = "lib.rs" diff --git a/tests/testsuite/mock-std/src/libcore/lib.rs b/tests/testsuite/mock-std/library/core/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libcore/lib.rs rename to tests/testsuite/mock-std/library/core/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libpanic_unwind/Cargo.toml b/tests/testsuite/mock-std/library/panic_unwind/Cargo.toml similarity index 83% rename from tests/testsuite/mock-std/src/libpanic_unwind/Cargo.toml rename to tests/testsuite/mock-std/library/panic_unwind/Cargo.toml index 9dc111d29f0..e7beb923fcb 100644 --- a/tests/testsuite/mock-std/src/libpanic_unwind/Cargo.toml +++ b/tests/testsuite/mock-std/library/panic_unwind/Cargo.toml @@ -3,6 +3,3 @@ name = "panic_unwind" version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" - -[lib] -path = "lib.rs" diff --git a/tests/testsuite/mock-std/src/libpanic_unwind/lib.rs b/tests/testsuite/mock-std/library/panic_unwind/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libpanic_unwind/lib.rs rename to tests/testsuite/mock-std/library/panic_unwind/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libproc_macro/Cargo.toml b/tests/testsuite/mock-std/library/proc_macro/Cargo.toml similarity index 83% rename from tests/testsuite/mock-std/src/libproc_macro/Cargo.toml rename to tests/testsuite/mock-std/library/proc_macro/Cargo.toml index c400a4a51c0..939a113b20b 100644 --- a/tests/testsuite/mock-std/src/libproc_macro/Cargo.toml +++ b/tests/testsuite/mock-std/library/proc_macro/Cargo.toml @@ -3,6 +3,3 @@ name = "proc_macro" version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" - -[lib] -path = "lib.rs" diff --git a/tests/testsuite/mock-std/src/libproc_macro/lib.rs b/tests/testsuite/mock-std/library/proc_macro/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libproc_macro/lib.rs rename to tests/testsuite/mock-std/library/proc_macro/src/lib.rs diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml similarity index 82% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/Cargo.toml rename to tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml index 18fc7004259..6b86f22ca5c 100644 --- a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/Cargo.toml +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" path = "lib.rs" [dependencies] -alloc = { path = "../../liballoc" } +alloc = { path = "../alloc" } diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/lib.rs rename to tests/testsuite/mock-std/library/rustc-std-workspace-alloc/lib.rs diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml similarity index 83% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/Cargo.toml rename to tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml index 39d704fd995..8d1921600aa 100644 --- a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/Cargo.toml +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" path = "lib.rs" [dependencies] -core = { path = "../../libcore" } +core = { path = "../core" } diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-core/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/lib.rs rename to tests/testsuite/mock-std/library/rustc-std-workspace-core/lib.rs diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml similarity index 84% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/Cargo.toml rename to tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml index 9cf5530ae15..91572b8158f 100644 --- a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/Cargo.toml +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" path = "lib.rs" [dependencies] -std = { path = "../../libstd" } +std = { path = "../std" } diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-std/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/lib.rs rename to tests/testsuite/mock-std/library/rustc-std-workspace-std/lib.rs diff --git a/tests/testsuite/mock-std/src/libstd/Cargo.toml b/tests/testsuite/mock-std/library/std/Cargo.toml similarity index 90% rename from tests/testsuite/mock-std/src/libstd/Cargo.toml rename to tests/testsuite/mock-std/library/std/Cargo.toml index 17ecd8efca4..d2cfdea3986 100644 --- a/tests/testsuite/mock-std/src/libstd/Cargo.toml +++ b/tests/testsuite/mock-std/library/std/Cargo.toml @@ -4,9 +4,6 @@ version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" -[lib] -path = "lib.rs" - [dependencies] registry-dep-using-alloc = { version = "*", features = ['mockbuild'] } diff --git a/tests/testsuite/mock-std/src/libstd/lib.rs b/tests/testsuite/mock-std/library/std/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libstd/lib.rs rename to tests/testsuite/mock-std/library/std/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libtest/Cargo.toml b/tests/testsuite/mock-std/library/test/Cargo.toml similarity index 58% rename from tests/testsuite/mock-std/src/libtest/Cargo.toml rename to tests/testsuite/mock-std/library/test/Cargo.toml index 078e91289d1..299db7bfd49 100644 --- a/tests/testsuite/mock-std/src/libtest/Cargo.toml +++ b/tests/testsuite/mock-std/library/test/Cargo.toml @@ -4,14 +4,11 @@ version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" -[lib] -path = "lib.rs" - [dependencies] -proc_macro = { path = "../libproc_macro" } -std = { path = "../libstd" } -panic_unwind = { path = "../libpanic_unwind" } -compiler_builtins = { path = "../libcompiler_builtins" } +proc_macro = { path = "../proc_macro" } +std = { path = "../std" } +panic_unwind = { path = "../panic_unwind" } +compiler_builtins = { path = "../compiler_builtins" } registry-dep-using-std = { version = "*", features = ['mockbuild'] } [features] diff --git a/tests/testsuite/mock-std/src/libtest/lib.rs b/tests/testsuite/mock-std/library/test/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libtest/lib.rs rename to tests/testsuite/mock-std/library/test/src/lib.rs