Skip to content

Commit

Permalink
Update derive_utils to 0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 16, 2025
1 parent 74cc2ce commit 0e34ac1
Show file tree
Hide file tree
Showing 32 changed files with 78 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com

## [Unreleased]

- Update `derive_utils` to 0.15. This uses `#[automatically_derived]` on generated impls to improve coverage support.

## [0.8.6] - 2024-08-23

- Disable `derive` feature of `syn` dependency.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ trusted_len = []

# Note: futures, tokio, rayon, serde, and http-body are public dependencies.
[dependencies]
derive_utils = "0.14.1"
derive_utils = "0.15"
proc-macro2 = "1.0.60"
quote = "1.0.25"
syn = { version = "2.0.1", default-features = false, features = ["parsing", "printing", "clone-impls", "proc-macro", "full", "visit-mut"] }
Expand Down
2 changes: 2 additions & 0 deletions src/enum_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ fn expand(args: TokenStream, input: TokenStream) -> Result<TokenStream> {
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl #impl_generics MustNotImplDrop for #name #ty_generics #where_clause {}
};
});
Expand Down
1 change: 1 addition & 0 deletions tests/expand/enum_derive/example-1.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ fn foo(x: i32) -> impl Iterator<Item = i32> {
__T1(__T1),
__T2(__T2),
}
#[automatically_derived]
impl<__T1, __T2> ::core::iter::Iterator for __Enum1<__T1, __T2>
where
__T1: ::core::iter::Iterator,
Expand Down
4 changes: 4 additions & 0 deletions tests/expand/external/futures/async_buf_read.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::futures::io::AsyncBufRead for Enum<A, B>
where
A: ::futures::io::AsyncBufRead,
Expand Down Expand Up @@ -51,6 +52,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -59,7 +61,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/futures/async_read.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::futures::io::AsyncRead for Enum<A, B>
where
A: ::futures::io::AsyncRead,
Expand Down Expand Up @@ -60,6 +61,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -68,7 +70,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/futures/async_seek.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::futures::io::AsyncSeek for Enum<A, B>
where
A: ::futures::io::AsyncSeek,
Expand Down Expand Up @@ -35,6 +36,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -43,7 +45,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/futures/async_write.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::futures::io::AsyncWrite for Enum<A, B>
where
A: ::futures::io::AsyncWrite,
Expand Down Expand Up @@ -104,6 +105,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -112,7 +114,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/futures/sink.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B, __Item> ::futures::sink::Sink<__Item> for Enum<A, B>
where
A: ::futures::sink::Sink<__Item>,
Expand Down Expand Up @@ -94,6 +95,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -102,7 +104,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/futures/stream.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::futures::stream::Stream for Enum<A, B>
where
A: ::futures::stream::Stream,
Expand Down Expand Up @@ -40,6 +41,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -48,7 +50,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/http_body/body.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::http_body::Body for Enum<A, B>
where
A: ::http_body::Body,
Expand Down Expand Up @@ -54,6 +55,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -62,7 +64,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::rayon::iter::ParallelIterator for Enum<A, B>
where
A: ::rayon::iter::ParallelIterator,
Expand Down Expand Up @@ -34,6 +35,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::rayon::iter::IndexedParallelIterator for Enum<A, B>
where
A: ::rayon::iter::IndexedParallelIterator,
Expand Down
1 change: 1 addition & 0 deletions tests/expand/external/rayon/parallel_extend.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B, __T: Send> ::rayon::iter::ParallelExtend<__T> for Enum<A, B>
where
A: ::rayon::iter::ParallelExtend<__T>,
Expand Down
1 change: 1 addition & 0 deletions tests/expand/external/rayon/parallel_iterator.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::rayon::iter::ParallelIterator for Enum<A, B>
where
A: ::rayon::iter::ParallelIterator,
Expand Down
1 change: 1 addition & 0 deletions tests/expand/external/serde/serialize.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::serde::ser::Serialize for Enum<A, B>
where
A: ::serde::ser::Serialize,
Expand Down
4 changes: 4 additions & 0 deletions tests/expand/external/tokio/async_buf_read.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::tokio::io::AsyncBufRead for Enum<A, B>
where
A: ::tokio::io::AsyncBufRead,
Expand Down Expand Up @@ -49,6 +50,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -57,7 +59,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/tokio/async_read.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::tokio::io::AsyncRead for Enum<A, B>
where
A: ::tokio::io::AsyncRead,
Expand Down Expand Up @@ -34,6 +35,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -42,7 +44,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/tokio/async_seek.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::tokio::io::AsyncSeek for Enum<A, B>
where
A: ::tokio::io::AsyncSeek,
Expand Down Expand Up @@ -52,6 +53,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -60,7 +62,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
4 changes: 4 additions & 0 deletions tests/expand/external/tokio/async_write.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::tokio::io::AsyncWrite for Enum<A, B>
where
A: ::tokio::io::AsyncWrite,
Expand Down Expand Up @@ -106,6 +107,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::marker::Unpin for Enum<A, B>
where
A: ::core::marker::Unpin,
Expand All @@ -114,7 +116,9 @@ where
const _: () = {
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
#[automatically_derived]
impl<T: ::core::ops::Drop> MustNotImplDrop for T {}
#[automatically_derived]
impl<A, B> MustNotImplDrop for Enum<A, B> {}
};
fn main() {}
1 change: 1 addition & 0 deletions tests/expand/std/debug.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::core::fmt::Debug for Enum<A, B>
where
A: ::core::fmt::Debug,
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/std/error.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::core::fmt::Display for Enum<A, B>
where
A: ::core::fmt::Display,
Expand All @@ -16,6 +17,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::core::fmt::Debug for Enum<A, B>
where
A: ::core::fmt::Debug,
Expand All @@ -29,6 +31,7 @@ where
}
}
}
#[automatically_derived]
impl<A, B> ::std::error::Error for Enum<A, B>
where
A: ::std::error::Error,
Expand Down
Loading

0 comments on commit 0e34ac1

Please sign in to comment.