Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion syntax/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
7 changes: 7 additions & 0 deletions syntax/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub static ERRORS: &[Error] = &[
DISCRIMINANT_OVERFLOW,
DOUBLE_UNDERSCORE,
RUST_TYPE_BY_VALUE,
UNSUPPORTED_TYPE,
USE_NOT_ALLOWED,
];

Expand Down Expand Up @@ -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"),
Expand Down