summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-24365.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-24365.rs')
-rw-r--r--tests/ui/issues/issue-24365.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-24365.rs b/tests/ui/issues/issue-24365.rs
new file mode 100644
index 000000000..eca104b6f
--- /dev/null
+++ b/tests/ui/issues/issue-24365.rs
@@ -0,0 +1,19 @@
+pub enum Attribute {
+ Code {attr_name_idx: u16},
+}
+
+pub enum Foo {
+ Bar
+}
+
+fn test(a: Foo) {
+ println!("{}", a.b); //~ no field `b` on type `Foo`
+}
+
+fn main() {
+ let x = Attribute::Code {
+ attr_name_idx: 42,
+ };
+ let z = (&x).attr_name_idx; //~ no field `attr_name_idx` on type `&Attribute`
+ let y = x.attr_name_idx; //~ no field `attr_name_idx` on type `Attribute`
+}