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");
}
}
_ => ()
}
fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
+ // if the expression was produced by a macro expansion,
+ if e.span.expn_info.is_some() { return }
+
let id = match e.node {
ast::ExprPath(..) | ast::ExprStruct(..) => {
match cx.tcx.def_map.borrow().find(&e.id) {
typeck::MethodStatic(def_id) => {
def_id
}
+ typeck::MethodStaticUnboxedClosure(def_id) => {
+ def_id
+ }
typeck::MethodParam(typeck::MethodParam {
trait_id: trait_id,
method_num: index,