diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/consts/issue-43105.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/consts/issue-43105.rs b/src/test/ui/consts/issue-43105.rs new file mode 100644 index 000000000..cac12b909 --- /dev/null +++ b/src/test/ui/consts/issue-43105.rs @@ -0,0 +1,13 @@ +fn xyz() -> u8 { 42 } + +const NUM: u8 = xyz(); +//~^ ERROR cannot call non-const fn + +fn main() { + match 1 { + NUM => unimplemented!(), + //~^ ERROR could not evaluate constant pattern + //~| ERROR could not evaluate constant pattern + _ => unimplemented!(), + } +} |