Skip to content

Commit

Permalink
[derive] Emit #[allow(deprecated)] in derived code (#556)
Browse files Browse the repository at this point in the history
Makes progress on #553, although we still need to figure out how to
reproduce the bug that caused that issue in the first place, and add a
test that exercises the same behavior (ie, fails without this commit).

Release 0.7.16.
  • Loading branch information
joshlf committed Oct 27, 2023
1 parent e6c2438 commit 46e0d78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[package]
edition = "2021"
name = "zerocopy"
version = "0.7.15"
version = "0.7.16"
authors = ["Joshua Liebow-Feeser <joshlf@google.com>"]
description = "Utilities for zero-copy parsing and serialization"
license = "BSD-2-Clause OR Apache-2.0 OR MIT"
Expand Down Expand Up @@ -45,7 +45,7 @@ simd-nightly = ["simd"]
__internal_use_only_features_that_work_on_stable = ["alloc", "derive", "simd"]

[dependencies]
zerocopy-derive = { version = "=0.7.15", path = "zerocopy-derive", optional = true }
zerocopy-derive = { version = "=0.7.16", path = "zerocopy-derive", optional = true }

[dependencies.byteorder]
version = "1.3"
Expand All @@ -56,7 +56,7 @@ optional = true
# zerocopy-derive remain equal, even if the 'derive' feature isn't used.
# See: https://github.com/matklad/macro-dep-test
[target.'cfg(any())'.dependencies]
zerocopy-derive = { version = "=0.7.15", path = "zerocopy-derive" }
zerocopy-derive = { version = "=0.7.16", path = "zerocopy-derive" }

[dev-dependencies]
assert_matches = "1.5"
Expand All @@ -71,4 +71,4 @@ testutil = { path = "testutil" }
# CI test failures.
trybuild = { version = "=1.0.85", features = ["diff"] }
# In tests, unlike in production, zerocopy-derive is not optional
zerocopy-derive = { version = "=0.7.15", path = "zerocopy-derive" }
zerocopy-derive = { version = "=0.7.16", path = "zerocopy-derive" }
2 changes: 1 addition & 1 deletion zerocopy-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[package]
edition = "2021"
name = "zerocopy-derive"
version = "0.7.15"
version = "0.7.16"
authors = ["Joshua Liebow-Feeser <joshlf@google.com>"]
description = "Custom derive for traits from the zerocopy crate"
license = "BSD-2-Clause OR Apache-2.0 OR MIT"
Expand Down
3 changes: 3 additions & 0 deletions zerocopy-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@ fn impl_block<D: DataExt>(
});

quote! {
// TODO(#553): Add a test that generates a warning when
// `#[allow(deprecated)]` isn't present.
#[allow(deprecated)]
unsafe impl < #(#params),* > zerocopy::#trait_ident for #type_ident < #(#param_idents),* >
where
#(#bounds,)*
Expand Down

0 comments on commit 46e0d78

Please sign in to comment.