diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-28992-empty.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-28992-empty.rs b/src/test/ui/issues/issue-28992-empty.rs new file mode 100644 index 000000000..74cfeb6db --- /dev/null +++ b/src/test/ui/issues/issue-28992-empty.rs @@ -0,0 +1,16 @@ +// Can't use constants as tuple struct patterns + + +const C1: i32 = 0; + +struct S; + +impl S { + const C2: i32 = 0; +} + +fn main() { + if let C1(..) = 0 {} //~ ERROR expected tuple struct or tuple variant, found constant `C1` + if let S::C2(..) = 0 {} + //~^ ERROR expected tuple struct or tuple variant, found associated constant `S::C2` +} |