From f67744bb4fed43a584f27844f1305615684b4805 Mon Sep 17 00:00:00 2001 From: Devin Ragotzy Date: Thu, 6 Aug 2020 09:54:41 -0400 Subject: [PATCH] Throw error if query_map has any ref types --- ruma-api-macros/src/api/request.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ruma-api-macros/src/api/request.rs b/ruma-api-macros/src/api/request.rs index 10e62f52..e8588b4d 100644 --- a/ruma-api-macros/src/api/request.rs +++ b/ruma-api-macros/src/api/request.rs @@ -356,6 +356,14 @@ impl TryFrom for Request { )); } + // TODO when/if `&[(&str, &str)]` is supported remove this + if query_map_field.is_some() && !lifetimes.query.is_empty() { + return Err(syn::Error::new_spanned( + raw.request_kw, + "Lifetimes are not allowed for query_map fields", + )); + } + Ok(Self { fields, lifetimes }) } }