diff --git a/crates/ruma-client-api/src/account/request_3pid_management_token_via_email.rs b/crates/ruma-client-api/src/account/request_3pid_management_token_via_email.rs index 3cfd001b..d4fc872b 100644 --- a/crates/ruma-client-api/src/account/request_3pid_management_token_via_email.rs +++ b/crates/ruma-client-api/src/account/request_3pid_management_token_via_email.rs @@ -42,9 +42,8 @@ pub mod v3 { pub next_link: Option, /// Optional identity server hostname and access token. - /// - /// Deprecated since r0.6.0. #[serde(flatten, skip_serializing_if = "Option::is_none")] + #[deprecated(since = "0.6.0")] pub identity_server_info: Option, } @@ -70,6 +69,7 @@ pub mod v3 { impl Request { /// Creates a new `Request` with the client secret, email and send-attempt counter. + #[allow(deprecated)] pub fn new(client_secret: OwnedClientSecret, email: String, send_attempt: UInt) -> Self { Self { client_secret, email, send_attempt, next_link: None, identity_server_info: None } } diff --git a/crates/ruma-client-api/src/account/request_3pid_management_token_via_msisdn.rs b/crates/ruma-client-api/src/account/request_3pid_management_token_via_msisdn.rs index 45c52409..a4c60e3c 100644 --- a/crates/ruma-client-api/src/account/request_3pid_management_token_via_msisdn.rs +++ b/crates/ruma-client-api/src/account/request_3pid_management_token_via_msisdn.rs @@ -45,9 +45,8 @@ pub mod v3 { pub next_link: Option, /// Optional identity server hostname and access token. - /// - /// Deprecated since r0.6.0. #[serde(flatten, skip_serializing_if = "Option::is_none")] + #[deprecated(since = "0.6.0")] pub identity_server_info: Option, } @@ -74,6 +73,7 @@ pub mod v3 { impl Request { /// Creates a new `Request` with the given client secret, country code, phone number and /// send-attempt counter. + #[allow(deprecated)] pub fn new( client_secret: OwnedClientSecret, country: String, diff --git a/crates/ruma-client-api/src/account/request_password_change_token_via_email.rs b/crates/ruma-client-api/src/account/request_password_change_token_via_email.rs index c7cb82e2..59c07d98 100644 --- a/crates/ruma-client-api/src/account/request_password_change_token_via_email.rs +++ b/crates/ruma-client-api/src/account/request_password_change_token_via_email.rs @@ -42,9 +42,8 @@ pub mod v3 { pub next_link: Option, /// Optional identity server hostname and access token. - /// - /// Deprecated since r0.6.0. #[serde(flatten, skip_serializing_if = "Option::is_none")] + #[deprecated(since = "0.6.0")] pub identity_server_info: Option, } @@ -71,6 +70,7 @@ pub mod v3 { impl Request { /// Creates a new `Request` with the given client secret, email address and send-attempt /// counter. + #[allow(deprecated)] pub fn new(client_secret: OwnedClientSecret, email: String, send_attempt: UInt) -> Self { Self { client_secret, email, send_attempt, next_link: None, identity_server_info: None } } diff --git a/crates/ruma-client-api/src/account/request_registration_token_via_email.rs b/crates/ruma-client-api/src/account/request_registration_token_via_email.rs index afa09eae..095bfa27 100644 --- a/crates/ruma-client-api/src/account/request_registration_token_via_email.rs +++ b/crates/ruma-client-api/src/account/request_registration_token_via_email.rs @@ -42,9 +42,8 @@ pub mod v3 { pub next_link: Option, /// Optional identity server hostname and access token. - /// - /// Deprecated since r0.6.0. #[serde(flatten, skip_serializing_if = "Option::is_none")] + #[deprecated(since = "0.6.0")] pub identity_server_info: Option, } @@ -71,6 +70,7 @@ pub mod v3 { impl Request { /// Creates a new `Request` with the given client secret, email address and send-attempt /// counter. + #[allow(deprecated)] pub fn new(client_secret: OwnedClientSecret, email: String, send_attempt: UInt) -> Self { Self { client_secret, email, send_attempt, next_link: None, identity_server_info: None } } diff --git a/crates/ruma-client-api/src/account/request_registration_token_via_msisdn.rs b/crates/ruma-client-api/src/account/request_registration_token_via_msisdn.rs index 8a450aee..6c95f7a0 100644 --- a/crates/ruma-client-api/src/account/request_registration_token_via_msisdn.rs +++ b/crates/ruma-client-api/src/account/request_registration_token_via_msisdn.rs @@ -45,9 +45,8 @@ pub mod v3 { pub next_link: Option, /// Optional identity server hostname and access token. - /// - /// Deprecated since r0.6.0. #[serde(flatten, skip_serializing_if = "Option::is_none")] + #[deprecated(since = "0.6.0")] pub identity_server_info: Option, } @@ -74,6 +73,7 @@ pub mod v3 { impl Request { /// Creates a new `Request` with the given client secret, country code, phone number and /// send-attempt counter. + #[allow(deprecated)] pub fn new( client_secret: OwnedClientSecret, country: String, diff --git a/crates/ruma-client-api/src/session/login.rs b/crates/ruma-client-api/src/session/login.rs index a88ef340..b34d8f49 100644 --- a/crates/ruma-client-api/src/session/login.rs +++ b/crates/ruma-client-api/src/session/login.rs @@ -67,10 +67,8 @@ pub mod v3 { pub access_token: String, /// The hostname of the homeserver on which the account has been registered. - /// - /// Deprecated: Clients should instead use the `user_id.server_name()` - /// method if they require it. #[serde(skip_serializing_if = "Option::is_none")] + #[deprecated = "Clients should instead use the `user_id.server_name()` method if they require it."] pub home_server: Option, /// ID of the logged-in device. @@ -124,6 +122,7 @@ pub mod v3 { impl Response { /// Creates a new `Response` with the given user ID, access token and device ID. + #[allow(deprecated)] pub fn new(user_id: OwnedUserId, access_token: String, device_id: OwnedDeviceId) -> Self { Self { user_id, diff --git a/crates/ruma-macros/src/api/request.rs b/crates/ruma-macros/src/api/request.rs index c81253f3..3295debc 100644 --- a/crates/ruma-macros/src/api/request.rs +++ b/crates/ruma-macros/src/api/request.rs @@ -81,7 +81,12 @@ pub fn expand_derive_request(input: DeriveInput) -> syn::Result { Ok(quote! { #types_impls - #test + + #[allow(deprecated)] + #[cfg(tests)] + mod __request { + #test + } }) } @@ -183,8 +188,12 @@ impl Request { #request_body_struct #request_query_struct - #outgoing_request_impl - #incoming_request_impl + #[allow(deprecated)] + mod __request_impls { + use super::*; + #outgoing_request_impl + #incoming_request_impl + } } } @@ -242,6 +251,7 @@ impl Request { let path_fields = self.path_fields().map(|f| f.ident.as_ref().unwrap().to_string()); let mut tests = quote! { #[::std::prelude::v1::test] + #[allow(deprecated)] fn path_parameters() { let path_params = METADATA._path_parameters(); let request_path_fields: &[&::std::primitive::str] = &[#(#path_fields),*];