Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade "soft" deprecations #47

Closed
cpu opened this issue Apr 18, 2023 · 1 comment · Fixed by #48
Closed

Upgrade "soft" deprecations #47

cpu opened this issue Apr 18, 2023 · 1 comment · Fixed by #48

Comments

@cpu
Copy link
Member

cpu commented Apr 18, 2023

In two places (Time::try_from and From::from for DnsName) there are "soft" deprecation comments:

webpki/src/time.rs

Lines 26 to 31 in 6dd4a44

/// Deprecated. Use `TryFrom::try_from`.
#[cfg(feature = "std")]
// Soft deprecation. #[deprecated(note = "Use TryFrom::try_from")]
pub fn try_from(time: std::time::SystemTime) -> Result<Self, ring::error::Unspecified> {
core::convert::TryFrom::try_from(time)
}

/// Requires the `alloc` feature.
// Deprecated
#[cfg(feature = "alloc")]
impl From<DnsNameRef<'_>> for DnsName {
fn from(dns_name: DnsNameRef) -> Self {
dns_name.to_owned()
}
}

We should consider replacing these with "hard" deprecated attributes so that the the deprecations are warned about. Probably best done as part of the next breaking changeset.

@djc
Copy link
Member

djc commented Apr 20, 2023

I think we can just get the #[deprecated] attributes in now. This doesn't break the API, just adds warnings (which is not considered to be semver-incompatible) -- and don't forget that rustls is by far the largest direct user of webpki anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants