|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Mike Hommey < [email protected]> |
| 3 | +Date: Tue, 15 Jun 2021 20:39:42 +0000 |
| 4 | +Subject: [PATCH] Bug 1716518 - Upgrade rental to v0.5.6. r=emilio |
| 5 | + |
| 6 | +Differential Revision: https://phabricator.services.mozilla.com/D117748 |
| 7 | +--- |
| 8 | + Cargo.lock | 4 ++-- |
| 9 | + third_party/rust/rental/.cargo-checksum.json | 2 +- |
| 10 | + third_party/rust/rental/Cargo.toml | 2 +- |
| 11 | + third_party/rust/rental/README.md | 5 ++++- |
| 12 | + third_party/rust/rental/src/lib.rs | 10 +++++----- |
| 13 | + 5 files changed, 13 insertions(+), 10 deletions(-) |
| 14 | + |
| 15 | +diff --git a/Cargo.lock b/Cargo.lock |
| 16 | +index 990d6a4a582b1d24e4e377084f1efb6838e573f6..ecd1e025b8dd5e42982af3c9b4c7a61534461056 100644 |
| 17 | +--- a/Cargo.lock |
| 18 | ++++ b/Cargo.lock |
| 19 | +@@ -3993,9 +3993,9 @@ dependencies = [ |
| 20 | + |
| 21 | + [[package]] |
| 22 | + name = "rental" |
| 23 | +-version = "0.5.5" |
| 24 | ++version = "0.5.6" |
| 25 | + source = "registry+https://github.com/rust-lang/crates.io-index" |
| 26 | +-checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" |
| 27 | ++checksum = "cc89fe2acac36d212474d138aaf939c04a82df5b61d07011571ebce5aef81f2e" |
| 28 | + dependencies = [ |
| 29 | + "rental-impl", |
| 30 | + "stable_deref_trait", |
| 31 | +diff --git a/third_party/rust/rental/.cargo-checksum.json b/third_party/rust/rental/.cargo-checksum.json |
| 32 | +index 24a34677109d076edbbf86b60322a78ea5309a35..020e203d55288252aa9aec6c609f067488f024b6 100644 |
| 33 | +--- a/third_party/rust/rental/.cargo-checksum.json |
| 34 | ++++ b/third_party/rust/rental/.cargo-checksum.json |
| 35 | +@@ -1 +1 @@ |
| 36 | +-{"files":{"Cargo.toml":"99e1c578dbb4b110ee59a7ba54e0812067bda50b2e39954a86c95db0cbcbc460","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0caa93d2b69a83cfb0c2d4db6b782a5dba5ecc4f9fa1f54b04b268af739bf868","README.md":"f45eef4d1177d0b66657e49fbda9dfc963b2a0110e5825e9c9b19d9d9a26dd3d","src/lib.rs":"2cfcf8833642107e34dab2a4457a9c9be144b21dd6d37090444f055067fd551b","tests/clone.rs":"0bf3267771ef8b3bf3c0d0ab98b7e99597c808f50596e0b6c12dfd5598eaf820","tests/complex.rs":"7c7f685e7ae7435698e34f8c29bd5bd8b89143ea43c3381a4627d366902b1285","tests/complex_mut.rs":"374d4a0782b00a5679b55d73b112c424977c0dba525072fadf0fc96ed00f632a","tests/covariant.rs":"fc5697208f44b96047e6423f8b9621a379e29cc5709dcf91f860f1424ef2a0d1","tests/debug.rs":"38e345ca450effc80898a267a1214a72d615441fa31697410ed1465638b85813","tests/drop_order.rs":"8c98fef9f0ea4eac8cebbd384be8c8e8db6d5aaffe42b83a6390e74d91dfd1ac","tests/generic.rs":"2f9d7aa9cc3dd3887b7270835cad8d914150b9809fb41430dc317b14788d3fa5","tests/lt_params.rs":"4f3e9252a35836c4a3a76a68b4fe4eeedb002169b278a0cbc82705716b2a3e6a","tests/map.rs":"314c5cd5163e6bef174fd7a4e37d9b8b9248d4e71f3387f5d6aa29ee784332b7","tests/simple_mut.rs":"beaabd34ed1c06c2f60d05c19c103c32588f52621e7a953e1bf3e2a0759cb09d","tests/simple_ref.rs":"aa64fa94f08926957293129cd26c128c6be21934f026bd052aa9b49a2e8987c7","tests/string.rs":"4e12df6b4e67991c8d912422935f75f2b0016dfa2d26a3305532fc98facc7c67","tests/subrental.rs":"dad1f751c9c8ef3b76e1be6513ae7419ddd16032e5fd71d8baa445d3d3f9e044","tests/target_ty_hack.rs":"d13301dbfb36646eb461928edbb088fe4ed5b01934c12fa1c2b3cd486f7bfb8d","tests/trait.rs":"b3697d80b7b61238401d133f53d058d2e3ad17e6925cc45ed8b8718bcf755e1a","tests/unused.rs":"e420e6d13bcd8b8e3def4a77e8de6502fdf5fd55d44ccad611f16e57c2d67704","tests/vec_slice.rs":"bd2826caeba5ae64268c0e2aed870afacc6d8ba3da850a309b19c7f0b17428eb"},"package":"8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f"} |
| 37 | +\ No newline at end of file |
| 38 | ++{"files":{"Cargo.toml":"84a87592ab606b0ec7cf484472679111fc1513ab6f493f496a876d432e1f77ab","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0caa93d2b69a83cfb0c2d4db6b782a5dba5ecc4f9fa1f54b04b268af739bf868","README.md":"d0abd379ad7ad547be83a98d6dabecfe6ea2ec53b811c50ddc2d4bb09a9448a0","src/lib.rs":"da0e1cbfcaa47662e74216231ddc1cd10a450d79132decbe99d05832649301e1","tests/clone.rs":"0bf3267771ef8b3bf3c0d0ab98b7e99597c808f50596e0b6c12dfd5598eaf820","tests/complex.rs":"7c7f685e7ae7435698e34f8c29bd5bd8b89143ea43c3381a4627d366902b1285","tests/complex_mut.rs":"374d4a0782b00a5679b55d73b112c424977c0dba525072fadf0fc96ed00f632a","tests/covariant.rs":"fc5697208f44b96047e6423f8b9621a379e29cc5709dcf91f860f1424ef2a0d1","tests/debug.rs":"38e345ca450effc80898a267a1214a72d615441fa31697410ed1465638b85813","tests/drop_order.rs":"8c98fef9f0ea4eac8cebbd384be8c8e8db6d5aaffe42b83a6390e74d91dfd1ac","tests/generic.rs":"2f9d7aa9cc3dd3887b7270835cad8d914150b9809fb41430dc317b14788d3fa5","tests/lt_params.rs":"4f3e9252a35836c4a3a76a68b4fe4eeedb002169b278a0cbc82705716b2a3e6a","tests/map.rs":"314c5cd5163e6bef174fd7a4e37d9b8b9248d4e71f3387f5d6aa29ee784332b7","tests/simple_mut.rs":"beaabd34ed1c06c2f60d05c19c103c32588f52621e7a953e1bf3e2a0759cb09d","tests/simple_ref.rs":"aa64fa94f08926957293129cd26c128c6be21934f026bd052aa9b49a2e8987c7","tests/string.rs":"4e12df6b4e67991c8d912422935f75f2b0016dfa2d26a3305532fc98facc7c67","tests/subrental.rs":"dad1f751c9c8ef3b76e1be6513ae7419ddd16032e5fd71d8baa445d3d3f9e044","tests/target_ty_hack.rs":"d13301dbfb36646eb461928edbb088fe4ed5b01934c12fa1c2b3cd486f7bfb8d","tests/trait.rs":"b3697d80b7b61238401d133f53d058d2e3ad17e6925cc45ed8b8718bcf755e1a","tests/unused.rs":"e420e6d13bcd8b8e3def4a77e8de6502fdf5fd55d44ccad611f16e57c2d67704","tests/vec_slice.rs":"bd2826caeba5ae64268c0e2aed870afacc6d8ba3da850a309b19c7f0b17428eb"},"package":"cc89fe2acac36d212474d138aaf939c04a82df5b61d07011571ebce5aef81f2e"} |
| 39 | +\ No newline at end of file |
| 40 | +diff --git a/third_party/rust/rental/Cargo.toml b/third_party/rust/rental/Cargo.toml |
| 41 | +index 2634b4881dc3873b5d121a061a3e00ce75a1162c..ef2e79c313b005567e194071cfba2df96781a989 100644 |
| 42 | +--- a/third_party/rust/rental/Cargo.toml |
| 43 | ++++ b/third_party/rust/rental/Cargo.toml |
| 44 | +@@ -12,7 +12,7 @@ |
| 45 | + |
| 46 | + [package] |
| 47 | + name = "rental" |
| 48 | +-version = "0.5.5" |
| 49 | ++version = "0.5.6" |
| 50 | + authors = ["Jameson Ernst < [email protected]>"] |
| 51 | + description = "A macro to generate safe self-referential structs, plus premade types for common use cases." |
| 52 | + documentation = "https://docs.rs/rental" |
| 53 | +diff --git a/third_party/rust/rental/README.md b/third_party/rust/rental/README.md |
| 54 | +index 4124f178cf65ef8674ae468178cb04092d7e458e..c8624275ed97ad8386fbbf16845cd2fa3b27e0e4 100644 |
| 55 | +--- a/third_party/rust/rental/README.md |
| 56 | ++++ b/third_party/rust/rental/README.md |
| 57 | +@@ -1,10 +1,13 @@ |
| 58 | ++# WARNING: This crate is NO LONGER MAINTAINED OR SUPPORTED |
| 59 | ++I'm not going to yank the crate because it's still fit for its intended purpose, but as time goes on it will become increasingly out of step with Rust's evolution, so users are encouraged to explore other solutions. I will also not merge any pull requests, as the code is sufficiently complicated that I'm no longer confident in my ability to effectively review them. Rental can be considered "frozen" in its current state, and any further development will need to take place under a fork for whoever wishes to do so. |
| 60 | ++ |
| 61 | + # Rental - A macro to generate safe self-referential structs, plus premade types for common use cases. |
| 62 | + |
| 63 | + [Documentation](http://docs.rs/rental) |
| 64 | + |
| 65 | + # Overview |
| 66 | + It can sometimes occur in the course of designing an API that it would be convenient, or even necessary, to allow fields within a struct to hold references to other fields within that same struct. Rust's concept of ownership and borrowing is powerful, but can't express such a scenario yet. |
| 67 | +-//! |
| 68 | ++ |
| 69 | + Creating such a struct manually would require unsafe code to erase lifetime parameters from the field types. Accessing the fields directly would be completely unsafe as a result. This library addresses that issue by allowing access to the internal fields only under carefully controlled circumstances, through closures that are bounded by generic lifetimes to prevent infiltration or exfiltration of any data with an incorrect lifetime. In short, while the struct internally uses unsafe code to store the fields, the interface exposed to the consumer of the struct is completely safe. The implementation of this interface is subtle and verbose, hence the macro to automate the process. |
| 70 | + |
| 71 | + The API of this crate consists of the `rental` macro that generates safe self-referential structs, a few example instantiations to demonstrate the API provided by such structs (see `examples`), and a module of premade instantiations to cover common use cases (see `common`). |
| 72 | +diff --git a/third_party/rust/rental/src/lib.rs b/third_party/rust/rental/src/lib.rs |
| 73 | +index d7c9f8aaaf0b8fe20aad5c793da231ef5493287a..c3907d150359f7551f513530fe0212851d5a985f 100644 |
| 74 | +--- a/third_party/rust/rental/src/lib.rs |
| 75 | ++++ b/third_party/rust/rental/src/lib.rs |
| 76 | +@@ -1,4 +1,4 @@ |
| 77 | +-//! A macro to generate safe self-referntial structs, plus premade types for common use cases. |
| 78 | ++//! A macro to generate safe self-referential structs, plus premade types for common use cases. |
| 79 | + //! |
| 80 | + //! # Overview |
| 81 | + //! It can sometimes occur in the course of designing an API that it would be convenient, or even necessary, to allow fields within a struct to hold references to other fields within that same struct. Rust's concept of ownership and borrowing is powerful, but can't express such a scenario yet. |
| 82 | +@@ -92,7 +92,7 @@ macro_rules! define_rental_traits { |
| 83 | + #[allow(unused)] |
| 84 | + #[derive(__rental_traits)] |
| 85 | + enum ProceduralMasqueradeDummyType { |
| 86 | +- Input = (0, stringify!($max_arity)).0 |
| 87 | ++ Input = (0, stringify!($max_arity)).0, |
| 88 | + } |
| 89 | + }; |
| 90 | + } |
| 91 | +@@ -238,7 +238,7 @@ macro_rules! rental { |
| 92 | + #[allow(unused)] |
| 93 | + #[derive(__rental_structs_and_impls)] |
| 94 | + enum ProceduralMasqueradeDummyType { |
| 95 | +- Input = (0, stringify!($($body)*)).0 |
| 96 | ++ Input = (0, stringify!($($body)*)).0, |
| 97 | + } |
| 98 | + } |
| 99 | + }; |
| 100 | +@@ -256,7 +256,7 @@ macro_rules! rental { |
| 101 | + #[allow(unused)] |
| 102 | + #[derive(__rental_structs_and_impls)] |
| 103 | + enum ProceduralMasqueradeDummyType { |
| 104 | +- Input = (0, stringify!($($body)*)).0 |
| 105 | ++ Input = (0, stringify!($($body)*)).0, |
| 106 | + } |
| 107 | + } |
| 108 | + }; |
| 109 | +@@ -274,7 +274,7 @@ macro_rules! rental { |
| 110 | + #[allow(unused)] |
| 111 | + #[derive(__rental_structs_and_impls)] |
| 112 | + enum ProceduralMasqueradeDummyType { |
| 113 | +- Input = (0, stringify!($($body)*)).0 |
| 114 | ++ Input = (0, stringify!($($body)*)).0, |
| 115 | + } |
| 116 | + } |
| 117 | + }; |
0 commit comments