rust/tests/ui/delegation/self-hygiene.rs
Vadim Petrochenkov cbc3bdbe01 delegation: Fix hygiene for self
And fix diagnostics for `self` from a macro.
2024-06-15 00:45:05 +03:00

21 lines
339 B
Rust

#![feature(fn_delegation)]
#![allow(incomplete_features)]
macro_rules! emit_self { () => { self } }
//~^ ERROR expected value, found module `self`
//~| ERROR expected value, found module `self`
struct S;
impl S {
fn method(self) {
emit_self!();
}
}
fn foo(arg: u8) {}
reuse foo as bar {
emit_self!()
}
fn main() {}