From 5c6f27b1e064af7c0d922eb00b5494fc6ca81b82 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 3 Nov 2024 22:30:02 +0100 Subject: [PATCH 1/2] extract rustc-std-workspace crate sources from crates.io and place them here --- src/rustc-std-workspace/README.md | 4 ++++ .../rustc-std-workspace-alloc/Cargo.toml | 9 +++++++++ .../rustc-std-workspace-alloc/src/lib.rs | 0 .../rustc-std-workspace-core/Cargo.toml | 10 ++++++++++ .../rustc-std-workspace-core/src/lib.rs | 0 .../rustc-std-workspace-std/Cargo.toml | 10 ++++++++++ .../rustc-std-workspace-std/src/lib.rs | 1 + 7 files changed, 34 insertions(+) create mode 100644 src/rustc-std-workspace/README.md create mode 100644 src/rustc-std-workspace/rustc-std-workspace-alloc/Cargo.toml create mode 100644 src/rustc-std-workspace/rustc-std-workspace-alloc/src/lib.rs create mode 100644 src/rustc-std-workspace/rustc-std-workspace-core/Cargo.toml create mode 100644 src/rustc-std-workspace/rustc-std-workspace-core/src/lib.rs create mode 100644 src/rustc-std-workspace/rustc-std-workspace-std/Cargo.toml create mode 100644 src/rustc-std-workspace/rustc-std-workspace-std/src/lib.rs diff --git a/src/rustc-std-workspace/README.md b/src/rustc-std-workspace/README.md new file mode 100644 index 00000000000..996fe0d3ba1 --- /dev/null +++ b/src/rustc-std-workspace/README.md @@ -0,0 +1,4 @@ +See `library/rustc-std-workspace-core/README.md` for context. + +These are the crates.io versions of these crates, as opposed to the versions +in `library` which are the ones used inside the rustc workspace. diff --git a/src/rustc-std-workspace/rustc-std-workspace-alloc/Cargo.toml b/src/rustc-std-workspace/rustc-std-workspace-alloc/Cargo.toml new file mode 100644 index 00000000000..777d57d2011 --- /dev/null +++ b/src/rustc-std-workspace/rustc-std-workspace-alloc/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "rustc-std-workspace-alloc" +version = "1.0.0" +authors = ["Alex Crichton "] +edition = "2018" +license = 'MIT/Apache-2.0' +description = 'workspace hack' + +[dependencies] diff --git a/src/rustc-std-workspace/rustc-std-workspace-alloc/src/lib.rs b/src/rustc-std-workspace/rustc-std-workspace-alloc/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rustc-std-workspace/rustc-std-workspace-core/Cargo.toml b/src/rustc-std-workspace/rustc-std-workspace-core/Cargo.toml new file mode 100644 index 00000000000..9f99308bf68 --- /dev/null +++ b/src/rustc-std-workspace/rustc-std-workspace-core/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "rustc-std-workspace-core" +version = "1.0.0" +authors = ["Alex Crichton "] +license = "MIT/Apache-2.0" +description = """ +Explicitly empty crate for rust-lang/rust integration +""" + +[dependencies] diff --git a/src/rustc-std-workspace/rustc-std-workspace-core/src/lib.rs b/src/rustc-std-workspace/rustc-std-workspace-core/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rustc-std-workspace/rustc-std-workspace-std/Cargo.toml b/src/rustc-std-workspace/rustc-std-workspace-std/Cargo.toml new file mode 100644 index 00000000000..d5bf3133e2c --- /dev/null +++ b/src/rustc-std-workspace/rustc-std-workspace-std/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "rustc-std-workspace-std" +version = "1.0.1" +authors = ["Alex Crichton "] +license = "MIT/Apache-2.0" +description = "Workaround for rustbuild" + +[lib] +name = "std" + diff --git a/src/rustc-std-workspace/rustc-std-workspace-std/src/lib.rs b/src/rustc-std-workspace/rustc-std-workspace-std/src/lib.rs new file mode 100644 index 00000000000..f40d09cafbb --- /dev/null +++ b/src/rustc-std-workspace/rustc-std-workspace-std/src/lib.rs @@ -0,0 +1 @@ +pub use std::*; From b12745863e409420e5f7650eb0af670c4060acad Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 3 Nov 2024 22:30:16 +0100 Subject: [PATCH 2/2] update rustc-std-workspace crates - make rustc-std-workspace-core/alloc re-exports of their underlying crates, like std = cleanup manifests --- Cargo.lock | 12 ++++++++++++ Cargo.toml | 3 +++ library/rustc-std-workspace-core/README.md | 3 +++ src/rustc-std-workspace/README.md | 2 +- .../rustc-std-workspace-alloc/Cargo.toml | 10 ++++++---- .../rustc-std-workspace-alloc/src/lib.rs | 3 +++ .../rustc-std-workspace-core/Cargo.toml | 7 ++++--- .../rustc-std-workspace-core/src/lib.rs | 3 +++ .../rustc-std-workspace-std/Cargo.toml | 9 +++++---- 9 files changed, 40 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 500992ff8c1..86a253d7118 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3196,6 +3196,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5c9f15eec8235d7cb775ee6f81891db79b98fd54ba1ad8fae565b88ef1ae4e2" +[[package]] +name = "rustc-std-workspace-alloc" +version = "1.0.1" + +[[package]] +name = "rustc-std-workspace-core" +version = "1.0.1" + +[[package]] +name = "rustc-std-workspace-std" +version = "1.0.1" + [[package]] name = "rustc_abi" version = "0.0.0" diff --git a/Cargo.toml b/Cargo.toml index d4b84250fc4..e1d667bf015 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,9 @@ resolver = "2" members = [ "compiler/rustc", "src/etc/test-float-parse", + "src/rustc-std-workspace/rustc-std-workspace-core", + "src/rustc-std-workspace/rustc-std-workspace-alloc", + "src/rustc-std-workspace/rustc-std-workspace-std", "src/rustdoc-json-types", "src/tools/build_helper", "src/tools/cargotest", diff --git a/library/rustc-std-workspace-core/README.md b/library/rustc-std-workspace-core/README.md index 40e0b62afab..55a36e74106 100644 --- a/library/rustc-std-workspace-core/README.md +++ b/library/rustc-std-workspace-core/README.md @@ -27,3 +27,6 @@ it'll look like when Cargo invokes the compiler, satisfying the implicit `extern crate core` directive injected by the compiler. + +The sources for the crates.io version can be found in +[`src/rustc-std-workspace`](../../src/rustc-std-workspace). diff --git a/src/rustc-std-workspace/README.md b/src/rustc-std-workspace/README.md index 996fe0d3ba1..a8e925f243d 100644 --- a/src/rustc-std-workspace/README.md +++ b/src/rustc-std-workspace/README.md @@ -1,4 +1,4 @@ -See `library/rustc-std-workspace-core/README.md` for context. +See [`library/rustc-std-workspace-core/README.md`](../../library/rustc-std-workspace-core/README.md) for context. These are the crates.io versions of these crates, as opposed to the versions in `library` which are the ones used inside the rustc workspace. diff --git a/src/rustc-std-workspace/rustc-std-workspace-alloc/Cargo.toml b/src/rustc-std-workspace/rustc-std-workspace-alloc/Cargo.toml index 777d57d2011..1a8ebdcfeae 100644 --- a/src/rustc-std-workspace/rustc-std-workspace-alloc/Cargo.toml +++ b/src/rustc-std-workspace/rustc-std-workspace-alloc/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "rustc-std-workspace-alloc" -version = "1.0.0" +version = "1.0.1" authors = ["Alex Crichton "] -edition = "2018" +edition = "2021" license = 'MIT/Apache-2.0' -description = 'workspace hack' +description = """ +crate for integration of crates.io crates into rust-lang/rust standard library workspace +""" -[dependencies] +repository = "https://github.com/rust-lang/rust/tree/master/src/rustc-std-workspace" diff --git a/src/rustc-std-workspace/rustc-std-workspace-alloc/src/lib.rs b/src/rustc-std-workspace/rustc-std-workspace-alloc/src/lib.rs index e69de29bb2d..938b8bb29b6 100644 --- a/src/rustc-std-workspace/rustc-std-workspace-alloc/src/lib.rs +++ b/src/rustc-std-workspace/rustc-std-workspace-alloc/src/lib.rs @@ -0,0 +1,3 @@ +#![no_std] +extern crate alloc as the_alloc; +pub use the_alloc::*; diff --git a/src/rustc-std-workspace/rustc-std-workspace-core/Cargo.toml b/src/rustc-std-workspace/rustc-std-workspace-core/Cargo.toml index 9f99308bf68..116cf3fb6bc 100644 --- a/src/rustc-std-workspace/rustc-std-workspace-core/Cargo.toml +++ b/src/rustc-std-workspace/rustc-std-workspace-core/Cargo.toml @@ -1,10 +1,11 @@ [package] name = "rustc-std-workspace-core" -version = "1.0.0" +version = "1.0.1" authors = ["Alex Crichton "] +edition = "2021" license = "MIT/Apache-2.0" description = """ -Explicitly empty crate for rust-lang/rust integration +crate for integration of crates.io crates into rust-lang/rust standard library workspace """ -[dependencies] +repository = "https://github.com/rust-lang/rust/tree/master/src/rustc-std-workspace" diff --git a/src/rustc-std-workspace/rustc-std-workspace-core/src/lib.rs b/src/rustc-std-workspace/rustc-std-workspace-core/src/lib.rs index e69de29bb2d..38b1615a024 100644 --- a/src/rustc-std-workspace/rustc-std-workspace-core/src/lib.rs +++ b/src/rustc-std-workspace/rustc-std-workspace-core/src/lib.rs @@ -0,0 +1,3 @@ +#![no_std] +extern crate core as the_core; +pub use the_core::*; diff --git a/src/rustc-std-workspace/rustc-std-workspace-std/Cargo.toml b/src/rustc-std-workspace/rustc-std-workspace-std/Cargo.toml index d5bf3133e2c..fcd1ca3deaf 100644 --- a/src/rustc-std-workspace/rustc-std-workspace-std/Cargo.toml +++ b/src/rustc-std-workspace/rustc-std-workspace-std/Cargo.toml @@ -2,9 +2,10 @@ name = "rustc-std-workspace-std" version = "1.0.1" authors = ["Alex Crichton "] +edition = "2021" license = "MIT/Apache-2.0" -description = "Workaround for rustbuild" - -[lib] -name = "std" +description = """ +crate for integration of crates.io crates into rust-lang/rust standard library workspace +""" +repository = "https://github.com/rust-lang/rust/tree/master/src/rustc-std-workspace"