Closed
Description
Hi,
pub struct Foo;
macro_rules! call_bar {
() => {
self.bar();
}
}
impl Foo {
pub fn foo(&self) {
call_bar!();
}
pub fn bar(&self) {
}
}
... returns:
error[E0424]: expected value, found module `self`
--> src/lib.rs:5:9
|
5 | self.bar();
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
...
10 | / pub fn foo(&self) {
11 | | call_bar!();
| | ------------ in this macro invocation
12 | | }
| |_____- this function doesn't have a `self` parameter
Message says this function doesn't have a 'self' parameter
, even though it does have a self
parameter, which is kinda confusing.
This happens only on beta and nightly, since current stable doesn't provide that hint at all.
Thanks,
Patryk.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Category: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Diagnostics: A diagnostic that is giving misleading or incorrect information.Relevant to the compiler team, which will review and decide on the PR/issue.