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

Raw method identifiers stopped working with mockall 0.12.0 #533

Closed
tim3z opened this issue Dec 15, 2023 · 3 comments · Fixed by #534
Closed

Raw method identifiers stopped working with mockall 0.12.0 #533

tim3z opened this issue Dec 15, 2023 · 3 comments · Fixed by #534
Labels
bug Something isn't working

Comments

@tim3z
Copy link

tim3z commented Dec 15, 2023

Since mockall 0.12.0 the following

#[mockall::automock]
trait Foo {
    fn r#match(&self);
}

doesn't compile anymore:

error: custom attribute panicked
 --> src/main.rs:1:1
1 | #[mockall::automock]
  | ^^^^^^^^^^^^^^^^^^^^
  |
  = help: message: `"expect_r#match"` is not a valid identifier

With 0.11.4 this worked just fine.

@asomers
Copy link
Owner

asomers commented Dec 15, 2023

This is odd: the buggy code was recommended by Clippy: 60acf8e . I'll have it fixed soon. Thanks for reporting it.

@asomers asomers added the bug Something isn't working label Dec 15, 2023
asomers added a commit that referenced this issue Dec 15, 2023
This was a regression in 0.12.0, introduced by 60acf8e .

Fixes #533
@tim3z
Copy link
Author

tim3z commented Dec 18, 2023

Odd indeed. Clippy should probably not propose changes to formatting macros from crates outside the stdlib...

asomers added a commit that referenced this issue Dec 21, 2023
This was a regression in 0.12.0, introduced by 60acf8e .

Fixes #533
@asomers
Copy link
Owner

asomers commented Dec 21, 2023

Odd indeed. Clippy should probably not propose changes to formatting macros from crates outside the stdlib...

The current nightly Clippy doesn't. So maybe that proposed change was due to a short-lived bug in Clippy, now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants