Commit 79065272 authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1716518 - Upgrade rental to v0.5.6. r=emilio

parent 1a6915b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4266,9 +4266,9 @@ checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157"

[[package]]
name = "rental"
version = "0.5.5"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f"
checksum = "cc89fe2acac36d212474d138aaf939c04a82df5b61d07011571ebce5aef81f2e"
dependencies = [
 "rental-impl",
 "stable_deref_trait",
+1 −1
Original line number Diff line number Diff line
{"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"}
 No newline at end of file
{"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"}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@

[package]
name = "rental"
version = "0.5.5"
version = "0.5.6"
authors = ["Jameson Ernst <jameson@jpernst.com>"]
description = "A macro to generate safe self-referential structs, plus premade types for common use cases."
documentation = "https://docs.rs/rental"
+4 −1
Original line number Diff line number Diff line
# WARNING: This crate is NO LONGER MAINTAINED OR SUPPORTED
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.

# Rental - A macro to generate safe self-referential structs, plus premade types for common use cases.

[Documentation](http://docs.rs/rental)

# Overview
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.
//!

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.

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`).
+5 −5
Original line number Diff line number Diff line
//! A macro to generate safe self-referntial structs, plus premade types for common use cases.
//! A macro to generate safe self-referential structs, plus premade types for common use cases.
//! 
//! # Overview
//! 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.
@@ -92,7 +92,7 @@ macro_rules! define_rental_traits {
		#[allow(unused)]
		#[derive(__rental_traits)]
		enum ProceduralMasqueradeDummyType {
			Input = (0, stringify!($max_arity)).0
			Input = (0, stringify!($max_arity)).0,
		}
	};
}
@@ -238,7 +238,7 @@ macro_rules! rental {
			#[allow(unused)]
			#[derive(__rental_structs_and_impls)]
			enum ProceduralMasqueradeDummyType {
				Input = (0, stringify!($($body)*)).0
				Input = (0, stringify!($($body)*)).0,
			}
		}
	};
@@ -256,7 +256,7 @@ macro_rules! rental {
			#[allow(unused)]
			#[derive(__rental_structs_and_impls)]
			enum ProceduralMasqueradeDummyType {
				Input = (0, stringify!($($body)*)).0
				Input = (0, stringify!($($body)*)).0,
			}
		}
	};
@@ -274,7 +274,7 @@ macro_rules! rental {
			#[allow(unused)]
			#[derive(__rental_structs_and_impls)]
			enum ProceduralMasqueradeDummyType {
				Input = (0, stringify!($($body)*)).0
				Input = (0, stringify!($($body)*)).0,
			}
		}
	};