Skip to content

Add compatibility with the #[auto_impl] macro#686

Merged
asomers merged 1 commit into
asomers:masterfrom
Kranzes:automock-auto_impl-compat
Jun 22, 2026
Merged

Add compatibility with the #[auto_impl] macro#686
asomers merged 1 commit into
asomers:masterfrom
Kranzes:automock-auto_impl-compat

Conversation

@Kranzes

@Kranzes Kranzes commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

#[automock] was copying the trait-only #[auto_impl] attribute onto the
generated mock, where it can't apply ("expected trait"). Strip it like
the other trait-only attributes so the two compose on one trait.

@Kranzes
Kranzes requested a review from asomers as a code owner June 18, 2026 15:18
@Kranzes
Kranzes force-pushed the automock-auto_impl-compat branch from 4003434 to 120a88c Compare June 18, 2026 15:19
asomers
asomers previously approved these changes Jun 21, 2026

@asomers asomers left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks for your contribution.

@asomers

asomers commented Jun 21, 2026

Copy link
Copy Markdown
Owner

The CI failure should be resolved by a rebase.

@Kranzes
Kranzes force-pushed the automock-auto_impl-compat branch from 90c069e to 88d59b5 Compare June 21, 2026 21:45
@Kranzes

Kranzes commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Done, please create a release after so I can pull this change from crates.io.

@asomers
asomers dismissed their stale review June 21, 2026 22:39

Why aren't workflows running? Maybe dismissing my review will jog github's logic.

@asomers

asomers commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Github's AI says that workflows aren't running because "Most likely conclusion: this is a GitHub-side trigger problem for that PR update". @Kranzes could you please force-push to job the triggers?

FTR, I'm annoyed that I have to use Github's CI just to tell me that Github has a bug.

@Kranzes

Kranzes commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

GHA strikes again 😂

`#[automock]` was copying the trait-only `#[auto_impl]` attribute onto the
generated mock, where it can't apply ("expected `trait`"). Strip it like
the other trait-only attributes so the two compose on one trait.
@Kranzes
Kranzes force-pushed the automock-auto_impl-compat branch from 88d59b5 to d3b041d Compare June 22, 2026 10:21
@Kranzes
Kranzes requested a review from asomers June 22, 2026 22:24

@asomers asomers left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever you just did "fixed" it. Workflows are running again.

@Kranzes

Kranzes commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

I simply force pushed as you suggested :D

@asomers
asomers merged commit 2270cdb into asomers:master Jun 22, 2026
3 checks passed
GavBog pushed a commit to GavBog/snix that referenced this pull request Jun 27, 2026
Requires asomers/mockall#686, which didn't end
up in a release yet.

We need to be a tiny bit more explicit with where the lifetime is coming
from in DirectoryService::put_multiple_start() as the compiler doesn't
seem to be able to infer it anymore, but that's only necessary for the
trait definition, not all impls.

Change-Id: I3863bf208621c5e65c044c6723705a5081fa7267
Reviewed-on: https://cl.snix.dev/c/snix/+/31414
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: kenji <aks.kenji@protonmail.com>
@asomers

asomers commented Jun 28, 2026

Copy link
Copy Markdown
Owner

@Kranzes released as 0.15.0

GavBog pushed a commit to GavBog/snix that referenced this pull request Jul 12, 2026
asomers/mockall#686, fixing compatibility with
the auto_impl macro ended in the latest release, so no more need to pin
a git revision here.

Change-Id: Ie7b491fb97b102176930d031c6cbc361440a1966
Reviewed-on: https://cl.snix.dev/c/snix/+/31454
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: besadii
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 this pull request may close these issues.

2 participants