Skip to content

Commit 4c97eb8

Browse files
committed
ctest: Allow improper_ctypes
We have been getting warnings in CI about structs marked with `#[non_exhaustive]`. The lint is incorrect here, so all we can really do is silence it.
1 parent a97bea5 commit 4c97eb8

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

ctest/templates/test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
/// inside of a module.
1010
mod generated_tests {
1111
#![allow(non_snake_case)]
12+
// FIXME: rustc raises this lint on `#[non_exhaustive]` structs, even via a pointer. Once
13+
// this is fixed we should deny it.
14+
#![allow(improper_ctypes)]
1215
#![deny(improper_ctypes_definitions)]
1316
#[allow(unused_imports)]
1417
use std::ffi::{CStr, c_int, c_char, c_uint};

ctest/tests/input/hierarchy.out.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/// inside of a module.
66
mod generated_tests {
77
#![allow(non_snake_case)]
8+
// FIXME: rustc raises this lint on `#[non_exhaustive]` structs, even via a pointer. Once
9+
// this is fixed we should deny it.
10+
#![allow(improper_ctypes)]
811
#![deny(improper_ctypes_definitions)]
912
#[allow(unused_imports)]
1013
use std::ffi::{CStr, c_int, c_char, c_uint};

ctest/tests/input/macro.out.edition-2024.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/// inside of a module.
66
mod generated_tests {
77
#![allow(non_snake_case)]
8+
// FIXME: rustc raises this lint on `#[non_exhaustive]` structs, even via a pointer. Once
9+
// this is fixed we should deny it.
10+
#![allow(improper_ctypes)]
811
#![deny(improper_ctypes_definitions)]
912
#[allow(unused_imports)]
1013
use std::ffi::{CStr, c_int, c_char, c_uint};

ctest/tests/input/macro.out.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/// inside of a module.
66
mod generated_tests {
77
#![allow(non_snake_case)]
8+
// FIXME: rustc raises this lint on `#[non_exhaustive]` structs, even via a pointer. Once
9+
// this is fixed we should deny it.
10+
#![allow(improper_ctypes)]
811
#![deny(improper_ctypes_definitions)]
912
#[allow(unused_imports)]
1013
use std::ffi::{CStr, c_int, c_char, c_uint};

ctest/tests/input/simple.out.with-renames.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/// inside of a module.
66
mod generated_tests {
77
#![allow(non_snake_case)]
8+
// FIXME: rustc raises this lint on `#[non_exhaustive]` structs, even via a pointer. Once
9+
// this is fixed we should deny it.
10+
#![allow(improper_ctypes)]
811
#![deny(improper_ctypes_definitions)]
912
#[allow(unused_imports)]
1013
use std::ffi::{CStr, c_int, c_char, c_uint};

ctest/tests/input/simple.out.with-skips.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/// inside of a module.
66
mod generated_tests {
77
#![allow(non_snake_case)]
8+
// FIXME: rustc raises this lint on `#[non_exhaustive]` structs, even via a pointer. Once
9+
// this is fixed we should deny it.
10+
#![allow(improper_ctypes)]
811
#![deny(improper_ctypes_definitions)]
912
#[allow(unused_imports)]
1013
use std::ffi::{CStr, c_int, c_char, c_uint};

0 commit comments

Comments
 (0)