diff --git a/syntax/check.rs b/syntax/check.rs index 2f3c33483..25183c990 100644 --- a/syntax/check.rs +++ b/syntax/check.rs @@ -67,7 +67,8 @@ fn check_type_ident(cx: &mut Check, ident: &Ident) { && !cx.types.cxx.contains(ident) && !cx.types.rust.contains(ident) { - cx.error(ident, "unsupported type"); + let msg = format!("unsupported type: {}", ident); + cx.error(ident, &msg); } } diff --git a/syntax/error.rs b/syntax/error.rs index a60b7da51..274927724 100644 --- a/syntax/error.rs +++ b/syntax/error.rs @@ -21,6 +21,7 @@ pub static ERRORS: &[Error] = &[ DISCRIMINANT_OVERFLOW, DOUBLE_UNDERSCORE, RUST_TYPE_BY_VALUE, + UNSUPPORTED_TYPE, USE_NOT_ALLOWED, ]; @@ -66,6 +67,12 @@ pub static RUST_TYPE_BY_VALUE: Error = Error { note: Some("hint: wrap it in a Box<>"), }; +pub static UNSUPPORTED_TYPE: Error = Error { + msg: "unsupported type: ", + label: Some("unsupported type"), + note: None, +}; + pub static USE_NOT_ALLOWED: Error = Error { msg: "`use` items are not allowed within cxx bridge", label: Some("not allowed"),