about summary refs log tree commit diff
path: root/tests/ui/enum/enum-variant-field-error-80607.rs
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2025-07-13 16:56:31 -0400
committerOneirical <manchot@videotron.ca>2025-08-17 13:01:02 -0400
commit75e0263af9ca27eac2c922538582deec764d1e7b (patch)
treebc8584c15f51966d5ddee98a6782785d5c158fe0 /tests/ui/enum/enum-variant-field-error-80607.rs
parent2e2642e641a941f0a1400c7827fd89aa86fef8f4 (diff)
downloadrust-75e0263af9ca27eac2c922538582deec764d1e7b.tar.gz
rust-75e0263af9ca27eac2c922538582deec764d1e7b.zip
Rehome tests/ui/issues/ tests [5/?]
Diffstat (limited to 'tests/ui/enum/enum-variant-field-error-80607.rs')
-rw-r--r--tests/ui/enum/enum-variant-field-error-80607.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/enum/enum-variant-field-error-80607.rs b/tests/ui/enum/enum-variant-field-error-80607.rs
new file mode 100644
index 00000000000..aa3f2f7c526
--- /dev/null
+++ b/tests/ui/enum/enum-variant-field-error-80607.rs
@@ -0,0 +1,11 @@
+// https://github.com/rust-lang/rust/issues/80607
+// This tests makes sure the diagnostics print the offending enum variant, not just the type.
+pub enum Enum {
+    V1(i32),
+}
+
+pub fn foo(x: i32) -> Enum {
+    Enum::V1 { x } //~ ERROR `Enum::V1` has no field named `x`
+}
+
+fn main() {}