about summary refs log tree commit diff
path: root/src/test/compile-fail/struct-fields-hints.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-22 12:09:02 +0000
committerbors <bors@rust-lang.org>2015-01-22 12:09:02 +0000
commitb7930d93d9b57beaeabfeb43cf78fc8161ecd46c (patch)
tree0c38770d7ced3d284b8c4d13909c4dd0526ca85b /src/test/compile-fail/struct-fields-hints.rs
parent5d2056a7e3e52b2aec41662cfd960e0eafe8494c (diff)
parent09d9924713a119692b8b195b81bd57ee7821cb71 (diff)
Auto merge of #21187 - oli-obk:feature/hint_struct_field_access, r=alexcrichton
rebase and fix of #19267
Diffstat (limited to 'src/test/compile-fail/struct-fields-hints.rs')
-rw-r--r--src/test/compile-fail/struct-fields-hints.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/compile-fail/struct-fields-hints.rs b/src/test/compile-fail/struct-fields-hints.rs
new file mode 100644
index 00000000000..37001f1e60a
--- /dev/null
+++ b/src/test/compile-fail/struct-fields-hints.rs
@@ -0,0 +1,23 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct A {
+    foo : i32,
+    car : i32,
+    barr : i32
+}
+
+fn main() {
+    let a = A {
+        foo : 5,
+        bar : 42,//~ ERROR structure `A` has no field named `bar`
+        //~^ HELP did you mean `car`?
+    };
+}