Skip to content

Commit 1d17069

Browse files
author
Anton Lofgren
committed
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 <[email protected]>
1 parent 6e3e0a8 commit 1d17069

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/lint/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ impl LintPass for CTypes {
358358
def::DefTy(def_id) => {
359359
if !adt::is_ffi_safe(cx.tcx, def_id) {
360360
cx.span_lint(CTYPES, ty.span,
361-
"found enum type without foreign-function-safe \
362-
representation annotation in foreign module");
363-
// hmm... this message could be more helpful
361+
"found enum type without foreign-function-safe
362+
representation annotation in foreign module, consider \
363+
adding a #[repr(...)] attribute to the enumeration");
364364
}
365365
}
366366
_ => ()

0 commit comments

Comments
 (0)