diff options
| author | Michael Goulet <michael@errs.io> | 2022-04-10 20:55:10 -0700 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-04-10 20:55:10 -0700 |
| commit | 285b9d1cd4e170f6a6c98cbdf5f5059b52735d01 (patch) | |
| tree | f622e50c35928a15dc50200dec71734c2729879f /src/test/ui/pattern | |
| parent | 18f32b73bdb3833c18c73fe3062bde8e1721ccca (diff) | |
| download | rust-285b9d1cd4e170f6a6c98cbdf5f5059b52735d01.tar.gz rust-285b9d1cd4e170f6a6c98cbdf5f5059b52735d01.zip | |
Delay a bug when we see SelfCtor in ref pattern
Diffstat (limited to 'src/test/ui/pattern')
| -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 + |
