<commit_before>use ruma_api::Outgoing;
use ruma_identifiers::UserId;

#[allow(unused)]
pub struct Thing<'t, T> {
    some: &'t str,
    t: &'t T,
}

#[derive(Debug)]
pub struct IncomingThing<T> {
    some: String,
    t: T,
}

#[derive(Outgoing)]
#[incoming_no_deserialize]
pub struct Request<'a, T> {
    pub abc: &'a str,
    pub thing: Thing<'a, T>,
    pub device_id: &'a ::ruma_identifiers::DeviceId,
    pub user_id: &'a UserId,
    pub bytes: &'a [u8],
    pub recursive: &'a [Thing<'a, T>],
    pub option: Option<&'a [u8]>,
}

#[derive(Outgoing)]
#[incoming_no_deserialize]
pub enum EnumThing<'a, T> {
    Abc(&'a str),
    Stuff(Thing<'a, T>),
    Boxy(&'a ::ruma_identifiers::DeviceId),
    Other(Option<&'a str>),
    StructVar { stuff: &'a str, more: &'a ::ruma_identifiers::ServerName },
}<commit_msg>Add failing test to ruma-api for lifetimes in ruma_api! macro<commit_after>use ruma_api::Outgoing;
use ruma_identifiers::UserId;

#[allow(unused)]
pub struct Thing<'t, T> {
    some: &'t str,
    t: &'t T,
}

#[derive(Debug)]
pub struct IncomingThing<T> {
    some: String,
    t: T,
}

#[allow(unused)]
#[derive(Copy, Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct OtherThing<'t> {
    some: &'t str,
    t: &'t [u8],
}

#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct IncomingOtherThing {
    some: String,
    t: Vec<u8>,
}

use ruma_api::ruma_api;

ruma_api! {
    metadata: {
        description: "Does something.",
        method: GET,
        name: "no_fields",
        path: "/_matrix/my/endpoint/:thing",
        rate_limited: false,
        requires_authentication: false,
    }

    request: {
        #[ruma_api(query)]
        pub abc: &'a str,
        #[ruma_api(path)]
        pub thing: &'a str,
        #[ruma_api(header = CONTENT_TYPE)]
        pub stuff: &'a str,
    }

    response: {
        pub body: &'a str,
        pub thing: OtherThing<'a>,
        pub stuff: &'a [u8],
    }
}

// #[derive(Outgoing)]
// #[incoming_no_deserialize]
// pub struct Request<'a, T> {
//     pub abc: &'a str,
//     pub thing: Thing<'a, T>,
//     pub device_id: &'a ::ruma_identifiers::DeviceId,
//     pub user_id: &'a UserId,
//     pub bytes: &'a [u8],
//     pub recursive: &'a [Thing<'a, T>],
//     pub option: Option<&'a [u8]>,
// }

// #[derive(Outgoing)]
// #[incoming_no_deserialize]
// pub enum EnumThing<'a, T> {
//     Abc(&'a str),
//     Stuff(Thing<'a, T>),
//     Boxy(&'a ::ruma_identifiers::DeviceId),
//     Other(Option<&'a str>),
//     StructVar { stuff: &'a str, more: &'a ::ruma_identifiers::ServerName },
// }
{'fraction_non_alphanumeric': 0.1889188149288188, 'fraction_numerical': 0.0026933435936898806, 'mean_word_length': 3.0688575899843507, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5079182', 'n_tokens_mistral': 1018, 'n_tokens_neox': 1062, 'n_words': 239}