We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55e7818 commit 12b579fCopy full SHA for 12b579f
tests/ui/auxiliary/use_self_macro.rs
@@ -0,0 +1,16 @@
1
+macro_rules! use_self {
2
+ (
3
+ impl $ty:ident {
4
+ fn func(&$this:ident) {
5
+ [fields($($field:ident)*)]
6
+ }
7
8
+ ) => (
9
+ impl $ty {
10
+ fn func(&$this) {
11
+ let $ty { $($field),* } = $this;
12
13
14
+ )
15
+}
16
+
tests/ui/ice-4671.rs
@@ -0,0 +1,21 @@
+#![warn(clippy::use_self)]
+#[macro_use]
+#[path = "auxiliary/use_self_macro.rs"]
+mod use_self_macro;
+struct Foo {
+ a: u32,
+use_self! {
+ impl Foo {
+ fn func(&self) {
+ [fields(
+ a
+ )]
17
18
19
20
21
+fn main() {}
0 commit comments