about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAnton Lofgren <alofgren@op5.com>2014-07-22 08:33:03 +0200
committerAlex Crichton <alex@alexcrichton.com>2014-07-29 15:43:21 -0700
commitef7d3e13e258258ec427889d3b047f0b7fda33c7 (patch)
tree777ba94df1cff07ec2b8b514c1c99d93ac3d773d /src
parentc2ac7fde0b4715ff87467be91d57d5afd49978a2 (diff)
downloadrust-ef7d3e13e258258ec427889d3b047f0b7fda33c7.tar.gz
rust-ef7d3e13e258258ec427889d3b047f0b7fda33c7.zip
lint: Improve ffi-unsafe enum lint warning
I think this is an improvement of the previous warning message, which
- like the comment that I removed implies - is in need of some
improvement.
I've opted to point the user in the right direction w.r.t how to fix the
problem, which I think is good form.

Not being familiar with the repr(...) attribute, I personally had to
check the lint rules myself to figure out what was wrong. Hopefully,
this will save he next person some time and headache.

Signed-off-by: Anton Lofgren <alofgren@op5.com>
Diffstat (limited to 'src')
-rw-r--r--src/librustc/lint/builtin.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs
index 3f4f5123699..1667f2b6d5f 100644
--- a/src/librustc/lint/builtin.rs
+++ b/src/librustc/lint/builtin.rs
@@ -358,9 +358,9 @@ impl LintPass for CTypes {
                         def::DefTy(def_id) => {
                             if !adt::is_ffi_safe(cx.tcx, def_id) {
                                 cx.span_lint(CTYPES, ty.span,
-                                             "found enum type without foreign-function-safe \
-                                              representation annotation in foreign module");
-                                // hmm... this message could be more helpful
+                                             "found enum type without foreign-function-safe
+                                             representation annotation in foreign module, consider \
+                                             adding a #[repr(...)] attribute to the enumeration");
                             }
                         }
                         _ => ()