Delay a bug when we see SelfCtor in ref pattern

This commit is contained in:
Michael Goulet 2022-04-10 20:55:10 -07:00
parent 18f32b73bd
commit 285b9d1cd4
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,12 @@
struct Foo<'a>(&'a ());
impl<'a> Foo<'a> {
fn spam(&mut self, baz: &mut Vec<u32>) {
match 15 {
ref Self => (),
//~^ ERROR expected identifier, found keyword `Self`
}
}
}
fn main() {}

View file

@ -0,0 +1,8 @@
error: expected identifier, found keyword `Self`
--> $DIR/issue-95878.rs:6:17
|
LL | ref Self => (),
| ^^^^ expected identifier, found keyword
error: aborting due to previous error