diff options
| author | Anton Lofgren <alofgren@op5.com> | 2014-07-22 08:33:03 +0200 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-07-29 15:43:21 -0700 |
| commit | ef7d3e13e258258ec427889d3b047f0b7fda33c7 (patch) | |
| tree | 777ba94df1cff07ec2b8b514c1c99d93ac3d773d /src | |
| parent | c2ac7fde0b4715ff87467be91d57d5afd49978a2 (diff) | |
| download | rust-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.rs | 6 |
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"); } } _ => () |
