From 1d170695c62a402af662b940985e2ae78d84538a Mon Sep 17 00:00:00 2001 From: Anton Lofgren Date: Tue, 22 Jul 2014 08:33:03 +0200 Subject: [PATCH] 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 --- src/librustc/lint/builtin.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 3f4f512369971..1667f2b6d5f0a 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"); } } _ => ()