From 88ba260fb32c2e9ecb2925fc7af4d9bb6f0491a2 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 21 Sep 2023 17:03:42 +0000 Subject: [PATCH] Prepare for a breaking change in the Rust compiler. The soundness fix in rust-lang/rust#115008 will cause `discord` to break, even though it is not unsound. The missing bound is very hard to abuse, but still a soundness hole in our type system. It will likely take 12 weeks before a stable compiler with the soundness fix is shipped. --- discord/partial_id/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/partial_id/src/lib.rs b/discord/partial_id/src/lib.rs index ed4a77b..c7d40b9 100644 --- a/discord/partial_id/src/lib.rs +++ b/discord/partial_id/src/lib.rs @@ -117,7 +117,7 @@ pub fn derive_partial(input: proc_macro::TokenStream) -> proc_macro::TokenStream *self = ::core::convert::Into::into(full); crate::request::Result::Ok(()) } - #vis async fn get_field(&mut self, client: &crate::request::Bot, f: fn(&Self) -> &::core::option::Option) -> crate::request::Result<&T> { + #vis async fn get_field<'a, T: 'a>(&'a mut self, client: &crate::request::Bot, f: fn(&Self) -> &::core::option::Option) -> crate::request::Result<&'a T> { crate::request::Result::Ok(match f(self) { ::core::option::Option::Some(_) => { f(self).as_ref().unwrap()