Delay a bug when we see SelfCtor in ref pattern
This commit is contained in:
parent
18f32b73bd
commit
285b9d1cd4
3 changed files with 29 additions and 0 deletions
12
src/test/ui/pattern/issue-95878.rs
Normal file
12
src/test/ui/pattern/issue-95878.rs
Normal 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() {}
|
||||
8
src/test/ui/pattern/issue-95878.stderr
Normal file
8
src/test/ui/pattern/issue-95878.stderr
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue