hygiene: Do not treat Self ctor as a local variable
This commit is contained in:
parent
75a369c5b1
commit
805099cf3e
2 changed files with 28 additions and 9 deletions
21
src/test/ui/resolve/issue-57523.rs
Normal file
21
src/test/ui/resolve/issue-57523.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// compile-pass
|
||||
|
||||
struct S(u8);
|
||||
|
||||
impl S {
|
||||
fn method1() -> Self {
|
||||
Self(0)
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! define_method { () => {
|
||||
impl S {
|
||||
fn method2() -> Self {
|
||||
Self(0) // OK
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
define_method!();
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue