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
1 change: 0 additions & 1 deletion ctest-next/src/ast/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::BoxStr;
/// Represents a field in a struct or union defined in Rust.
#[derive(Debug, Clone)]
pub struct Field {
#[expect(unused)]
pub(crate) public: bool,
pub(crate) ident: BoxStr,
pub(crate) ty: syn::Type,
Expand Down
1 change: 0 additions & 1 deletion ctest-next/src/ast/structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::{BoxStr, Field};
pub struct Struct {
pub(crate) public: bool,
pub(crate) ident: BoxStr,
#[expect(unused)]
pub(crate) fields: Vec<Field>,
}

Expand Down
1 change: 0 additions & 1 deletion ctest-next/src/ast/union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pub struct Union {
#[expect(unused)]
pub(crate) public: bool,
pub(crate) ident: BoxStr,
#[expect(unused)]
pub(crate) fields: Vec<Field>,
}

Expand Down
7 changes: 3 additions & 4 deletions ctest-next/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ pub struct TestGenerator {
pub(crate) defines: Vec<(String, Option<String>)>,
cfg: Vec<(String, Option<String>)>,
mapped_names: Vec<MappedName>,
skips: Vec<Skip>,
pub(crate) skips: Vec<Skip>,
verbose_skip: bool,
volatile_items: Vec<VolatileItem>,
pub(crate) volatile_items: Vec<VolatileItem>,
array_arg: Option<ArrayArg>,
skip_private: bool,
skip_roundtrip: Option<SkipTest>,
Expand Down Expand Up @@ -872,7 +872,6 @@ impl TestGenerator {
let mut ffi_items = FfiItems::new();
ffi_items.visit_file(&ast);

// FIXME(ctest): Does not filter out tests for fields.
self.filter_ffi_items(&mut ffi_items);

let output_directory = self
Expand Down Expand Up @@ -945,7 +944,7 @@ impl TestGenerator {
}

/// Maps Rust identifiers or types to C counterparts, or defaults to the original name.
pub(crate) fn map<'a>(&self, item: impl Into<MapInput<'a>>) -> String {
pub(crate) fn rty_to_cty<'a>(&self, item: impl Into<MapInput<'a>>) -> String {
let item = item.into();
if let Some(mapped) = self.mapped_names.iter().find_map(|f| f(&item)) {
return mapped;
Expand Down
4 changes: 0 additions & 4 deletions ctest-next/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ pub(crate) enum MapInput<'a> {
Struct(&'a Struct),
Union(&'a Union),
Fn(&'a crate::Fn),
#[expect(unused)]
StructField(&'a Struct, &'a Field),
#[expect(unused)]
UnionField(&'a Union, &'a Field),
Alias(&'a Type),
Const(&'a Const),
Expand All @@ -67,9 +65,7 @@ pub(crate) enum MapInput<'a> {
/// This variant is used for renaming the struct type.
StructType(&'a str),
UnionType(&'a str),
#[expect(unused)]
StructFieldType(&'a Struct, &'a Field),
#[expect(unused)]
UnionFieldType(&'a Union, &'a Field),
}

Expand Down
Loading