summaryrefslogtreecommitdiffstats
path: root/tests/ui/thir-print/thir-flat-const-variant.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/thir-print/thir-flat-const-variant.rs')
-rw-r--r--tests/ui/thir-print/thir-flat-const-variant.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/thir-print/thir-flat-const-variant.rs b/tests/ui/thir-print/thir-flat-const-variant.rs
new file mode 100644
index 000000000..2cd87a5cb
--- /dev/null
+++ b/tests/ui/thir-print/thir-flat-const-variant.rs
@@ -0,0 +1,18 @@
+// compile-flags: -Z unpretty=thir-flat
+// check-pass
+
+// Previously, the constants with `Self::Bar(())` would be `Call`s instead of
+// `Adt`s in THIR.
+
+pub enum Foo {
+ Bar(()),
+}
+
+impl Foo {
+ const BAR1: Foo = Foo::Bar(());
+ const BAR2: Foo = Self::Bar(());
+ const BAR3: Self = Foo::Bar(());
+ const BAR4: Self = Self::Bar(());
+}
+
+fn main() {}