Skip to content

Commit 572ed3f

Browse files
Workaround for async-graphql#900
1 parent e839ffa commit 572ed3f

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ async-graphql-value = { path = "value", version = "4.0.4" }
3535
async-stream = "0.3.0"
3636
async-trait = "0.1.48"
3737
bytes = { version = "1.0.1", features = ["serde"] }
38+
fix-hidden-lifetime-bug = "0.2.4" # See #900
3839
fnv = "1.0.7"
3940
futures-util = { version = "0.3.0", default-features = false, features = [
4041
"io",

derive/src/interface.rs

+1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ pub fn generate(interface_args: &args::Interface) -> GeneratorResult<TokenStream
250250
let schema_ty = oty.value_type();
251251

252252
methods.push(quote! {
253+
#[crate_name::fix_hidden_lifetime_bug] // See #900
253254
#[inline]
254255
pub async fn #method_name<'ctx>(&self, #(#decl_params),*) -> #crate_name::Result<#ty> {
255256
match self {

derive/src/simple_object.rs

+1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ pub fn generate(object_args: &args::SimpleObject) -> GeneratorResult<TokenStream
226226
getters.push(quote! {
227227
#[inline]
228228
#[allow(missing_docs)]
229+
#[#crate_name::fix_hidden_lifetime_bug] // See #900
229230
#vis async fn #ident(&self, ctx: &#crate_name::Context<'_>) -> #crate_name::Result<#ty> {
230231
::std::result::Result::Ok(#block)
231232
}

src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ pub use async_graphql_value::{
214214
pub use async_stream;
215215
#[doc(hidden)]
216216
pub use async_trait;
217+
#[doc(hidden)]
218+
pub use ::fix_hidden_lifetime_bug::fix_hidden_lifetime_bug;
217219
pub use base::{
218220
ComplexObject, Description, InputObjectType, InputType, InterfaceType, ObjectType,
219221
OneofObjectType, OutputType, TypeName, UnionType,

0 commit comments

Comments
 (0)