rust/tests/ui/resolve/false-self-in-macro-issue-143134.stderr
xizheyin 000f038e99 Add ui test resolve/false-self-in-macro-issue-143134.rs
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-03 23:11:57 +08:00

13 lines
550 B
Plaintext

error[E0424]: expected unit struct, unit variant or constant, found local variable `self`
--> $DIR/false-self-in-macro-issue-143134.rs:6:13
|
LL | / fn f(self) {
LL | | let self = ();
| | ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
LL | | }
| |_____- this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0424`.