diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-04-12 23:16:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-12 23:16:59 +0200 |
| commit | 91813a7175dacce03be33ba63c7abbdea3da1748 (patch) | |
| tree | b5b403fe47641f67dd2952fe5c2be68756ab3c10 /src | |
| parent | 6aa875aa9629b985638984b32a8adfb46da9ee66 (diff) | |
| parent | 285b9d1cd4e170f6a6c98cbdf5f5059b52735d01 (diff) | |
| download | rust-91813a7175dacce03be33ba63c7abbdea3da1748.tar.gz rust-91813a7175dacce03be33ba63c7abbdea3da1748.zip | |
Rollup merge of #95918 - compiler-errors:issue-95878, r=cjgillot
Delay a bug when we see SelfCtor in ref pattern Fixes #95878
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/pattern/issue-95878.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/pattern/issue-95878.stderr | 8 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/pattern/issue-95878.rs b/src/test/ui/pattern/issue-95878.rs new file mode 100644 index 00000000000..f59814468b2 --- /dev/null +++ b/src/test/ui/pattern/issue-95878.rs @@ -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() {} diff --git a/src/test/ui/pattern/issue-95878.stderr b/src/test/ui/pattern/issue-95878.stderr new file mode 100644 index 00000000000..e0eea06e0a3 --- /dev/null +++ b/src/test/ui/pattern/issue-95878.stderr @@ -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 + |
