Check for disallowed include strings
error[cxxbridge]: #include relative to `.` or `..` is not supported in Cargo builds
┌─ src/main.rs:10:18
│
10 │ include!("../header.h");
│ ^^^^^^^^^^^^^ #include relative to `.` or `..` is not supported in Cargo builds
│
= note: use a path starting with the crate name
diff --git a/syntax/error.rs b/syntax/error.rs
index a60b7da..9597089 100644
--- a/syntax/error.rs
+++ b/syntax/error.rs
@@ -19,6 +19,7 @@
CXX_STRING_BY_VALUE,
CXX_TYPE_BY_VALUE,
DISCRIMINANT_OVERFLOW,
+ DOT_INCLUDE,
DOUBLE_UNDERSCORE,
RUST_TYPE_BY_VALUE,
USE_NOT_ALLOWED,
@@ -54,6 +55,12 @@
note: Some("note: explicitly set `= 0` if that is desired outcome"),
};
+pub static DOT_INCLUDE: Error = Error {
+ msg: "#include relative to `.` or `..` is not supported in Cargo builds",
+ label: Some("#include relative to `.` or `..` is not supported in Cargo builds"),
+ note: Some("note: use a path starting with the crate name"),
+};
+
pub static DOUBLE_UNDERSCORE: Error = Error {
msg: "identifiers containing double underscore are reserved in C++",
label: Some("reserved identifier"),