Skip to content

Commit

Permalink
Ignore PhantomPinned
Browse files Browse the repository at this point in the history
cbindgen already ignores `PhantomData`.  It should ignore
`PhantomPinned` for the same reasons.

Closes #695
Fixes #694
  • Loading branch information
kkoning authored and emilio committed Jun 19, 2021
1 parent 2d20c4b commit 4e39449
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ cbindgen contains the following hardcoded mappings (again completely ignoring na
* f64 => double
* VaList => va_list
* PhantomData => *evaporates*, can only appear as the field of a type
* PhantomPinned => *evaporates*, can only appear as the field of a type
* () => *evaporates*, can only appear as the field of a type


Expand Down
2 changes: 1 addition & 1 deletion src/bindgen/ir/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ impl Type {
syn::Type::Path(ref path) => {
let generic_path = GenericPath::load(&path.path)?;

if generic_path.name() == "PhantomData" {
if generic_path.name() == "PhantomData" || generic_path.name() == "PhantomPinned" {
return Ok(None);
}

Expand Down
1 change: 1 addition & 0 deletions tests/rust/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct NormalWithZST {
y: f32,
z: (),
w: PhantomData<i32>,
v: PhantomPinned,
}

/// cbindgen:rename-all=GeckoCase
Expand Down

0 comments on commit 4e39449

Please sign in to comment.