From e3d78587d0ba6c738741b115090c165b2c123862 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 5 Jan 2024 00:47:40 +0000 Subject: [PATCH] repro derive-adhoc#31 --- Cargo.lock | 131 +++++++--------------------------------------------- Cargo.toml | 7 +-- src/main.rs | 15 ++++-- 3 files changed, 32 insertions(+), 121 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23b3165..50e38d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,78 +3,31 @@ version = 3 [[package]] -name = "autocfg" -version = "1.1.0" +name = "educe" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "foo" -version = "0.1.0" +checksum = "e93898956a40b4e5aadd52d57674426a14b0c5598ac5305b93b8560101083065" dependencies = [ - "downcast-rs", - "futures", -] - -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", - "futures-sink", + "enum-ordinalize", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-executor" -version = "0.3.28" +name = "enum-ordinalize" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" dependencies = [ - "futures-core", - "futures-task", - "futures-util", + "enum-ordinalize-derive", ] [[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-macro" -version = "0.3.28" +name = "enum-ordinalize-derive" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", @@ -82,53 +35,12 @@ dependencies = [ ] [[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - -[[package]] -name = "futures-task" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" - -[[package]] -name = "futures-util" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +name = "foo" +version = "0.1.0" dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", + "educe", ] -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "pin-project-lite" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "proc-macro2" version = "1.0.66" @@ -147,15 +59,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "slab" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" -dependencies = [ - "autocfg", -] - [[package]] name = "syn" version = "2.0.28" diff --git a/Cargo.toml b/Cargo.toml index d4b15f4..6a7a16f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,14 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -downcast-rs = "1" -futures = "0.3.28" +educe = "0.5" +#downcast-rs = "1" +#futures = "0.3.28" #tokio = { version = "1", features = ["full"] } #serde-value = "0.7" #serde = { version="1", features=["derive"] } diff --git a/src/main.rs b/src/main.rs index 9ce70ab..8fe77a5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,15 @@ -use futures::channel::oneshot; +use educe::Educe; -enum Void {} +#[derive(Educe, Clone)] +#[educe(Debug)] +pub enum Limit { + True, + Name(String), + Field { f: String, n: String }, + Fields { n: String }, + Others(#[educe(Debug(ignore))] Vec<()>), +} fn main() { - type F = futures::future::Shared>; - println!("{:?}", std::alloc::Layout::new::()); + println!("{:?}", Limit::True); } -- 2.30.2