1
0
Fork 0
forked from wry/wry

all: use expect attribute where possible

This commit is contained in:
Julian Orth 2024-09-06 11:08:22 +02:00
parent c3b50dc653
commit e377470f3f
134 changed files with 241 additions and 296 deletions

View file

@ -165,7 +165,7 @@ impl Acceptor {
&self.socket.name
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn secure_path(&self) -> &Ustr {
self.socket.secure_path.as_ustr()
}

View file

@ -51,7 +51,7 @@ pub trait BufferObject {
pub trait MappedBuffer {
unsafe fn data(&self) -> &[u8];
#[cfg_attr(not(test), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
fn data_ptr(&self) -> *mut u8;
fn stride(&self) -> i32;
}

View file

@ -38,7 +38,7 @@ pub trait Backend {
fn clear(&self) {
// nothing
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
fn switch_to(&self, vtnr: u32) {
@ -430,7 +430,7 @@ pub enum InputEvent {
}
pub enum DrmEvent {
#[allow(dead_code)]
#[expect(dead_code)]
Removed,
GfxApiChanged,
}

View file

@ -944,7 +944,7 @@ impl XBackend {
if changed {
let images = self.create_images(output.window, width, height).await?;
for (new, old) in images.iter().zip(output.images.iter()) {
#[allow(clippy::let_underscore_future)]
#[expect(clippy::let_underscore_future)]
let _ = self.c.call(&FreePixmap {
pixmap: old.pixmap.get(),
});

View file

@ -69,7 +69,6 @@ impl ClientId {
self.0
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
pub fn from_raw(val: u64) -> Self {
Self(val)
}
@ -105,7 +104,7 @@ impl Clients {
ClientId(self.next_client_id.fetch_add(1))
}
#[allow(dead_code)]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn get(&self, id: ClientId) -> Result<Rc<Client>, ClientError> {
let clients = self.clients.borrow();
match clients.get(&id) {
@ -443,7 +442,6 @@ impl Client {
self.add_obj(obj, true)
}
#[allow(dead_code)]
pub fn add_server_obj<T: WaylandObject>(&self, obj: &Rc<T>) {
self.add_obj(obj, false).expect("add_server_obj failed")
}

View file

@ -324,7 +324,10 @@ async fn start_compositor3(state: Rc<State>, test_future: Option<TestFuture>) {
state.ring.stop();
}
fn load_config(state: &Rc<State>, #[allow(unused_variables)] for_test: bool) -> ConfigProxy {
fn load_config(
state: &Rc<State>,
#[allow(clippy::allow_attributes, unused_variables)] for_test: bool,
) -> ConfigProxy {
#[cfg(feature = "it")]
if for_test {
return ConfigProxy::for_test(state);
@ -365,7 +368,7 @@ fn start_global_event_handlers(
async fn create_backend(
state: &Rc<State>,
#[allow(unused_variables)] test_future: Option<TestFuture>,
#[allow(clippy::allow_attributes, unused_variables)] test_future: Option<TestFuture>,
) -> Option<Rc<dyn Backend>> {
#[cfg(feature = "it")]
if let Some(tf) = test_future {

View file

@ -265,7 +265,7 @@ impl CursorUser {
}
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn desired_known_cursor(&self) -> Option<KnownCursor> {
self.desired_known_cursor.get()
}

View file

@ -89,7 +89,6 @@ impl DamageVisualizer {
}
}
#[allow(dead_code)]
pub fn add(&self, rect: Rect) {
if !self.enabled.get() {
return;

View file

@ -274,23 +274,23 @@ const MSG_ERROR: u8 = 3;
const MSG_SIGNAL: u8 = 4;
const NO_REPLY_EXPECTED: u8 = 0x1;
#[allow(dead_code)]
#[expect(dead_code)]
const NO_AUTO_START: u8 = 0x2;
#[allow(dead_code)]
#[expect(dead_code)]
const ALLOW_INTERACTIVE_AUTHORIZATION: u8 = 0x4;
#[allow(dead_code)]
#[expect(dead_code)]
pub const DBUS_NAME_FLAG_ALLOW_REPLACEMENT: u32 = 0x1;
#[allow(dead_code)]
#[expect(dead_code)]
pub const DBUS_NAME_FLAG_REPLACE_EXISTING: u32 = 0x2;
pub const DBUS_NAME_FLAG_DO_NOT_QUEUE: u32 = 0x4;
pub const DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
pub const DBUS_REQUEST_NAME_REPLY_IN_QUEUE: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
pub const DBUS_REQUEST_NAME_REPLY_EXISTS: u32 = 3;
#[allow(dead_code)]
#[expect(dead_code)]
pub const DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER: u32 = 4;
pub const BUS_DEST: &str = "org.freedesktop.DBus";
@ -698,7 +698,7 @@ pub struct PendingReply<T> {
}
impl<T> PendingReply<T> {
#[allow(dead_code)]
#[expect(dead_code)]
pub fn reply_expected(&self) -> bool {
self.reply_expected
}
@ -720,7 +720,7 @@ where
}
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn complete<'a>(&self, res: Result<&T::Generic<'a>, &str>) {
match res {
Ok(m) => self.ok(m),

View file

@ -77,7 +77,7 @@ impl Incoming {
self.incoming
.fill_msg_buf(remaining as usize, msg_buf)
.await?;
#[allow(dropping_references)]
#[expect(dropping_references)]
drop(msg_buf);
let msg_buf = unsafe { msg_buf_data.get().deref().deref() };
let headers = &msg_buf[FIXED_HEADER_SIZE..FIXED_HEADER_SIZE + headers_len as usize];

View file

@ -102,7 +102,7 @@ impl DbusSocket {
}
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn get<T, F>(&self, destination: &str, path: &str, f: F)
where
T: Property,

View file

@ -354,7 +354,7 @@ unsafe impl<'a, K: DbusType<'a>, V: DbusType<'a>> DbusType<'a> for DictEntry<K,
macro_rules! tuple {
($($p:ident),*) => {
#[allow(non_snake_case)]
#[expect(non_snake_case)]
unsafe impl<'a, $($p: DbusType<'a>),*> DbusType<'a> for ($($p,)*) {
const ALIGNMENT: usize = 8;
const IS_POD: bool = false;

View file

@ -30,7 +30,7 @@ pub enum DigitalVideoInterfaceStandard {
HdmiB,
MDDI,
DisplayPort,
#[allow(dead_code)]
#[expect(dead_code)]
Unknown(u8),
}
@ -50,7 +50,7 @@ impl Debug for SignalLevelStandard {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub enum VideoInputDefinition {
Analog {
signal_level_standard: SignalLevelStandard,
@ -75,7 +75,7 @@ pub struct ScreenDimensions {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct ChromaticityCoordinates {
pub red_x: u16,
pub red_y: u16,
@ -88,7 +88,7 @@ pub struct ChromaticityCoordinates {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct EstablishedTimings {
pub s_720x400_70: bool,
pub s_720x400_88: bool,
@ -119,7 +119,7 @@ pub enum AspectRatio {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct StandardTiming {
pub x_resolution: u16,
pub aspect_ratio: AspectRatio,
@ -133,7 +133,7 @@ pub enum AnalogSyncType {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub enum SyncSignal {
Analog {
ty: AnalogSyncType,
@ -185,7 +185,7 @@ impl Debug for StereoViewingSupport {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct DisplayRangeLimitsAndAdditionalTiming {
pub vertical_field_rate_min: u16,
pub vertical_field_rate_max: u16,
@ -202,12 +202,12 @@ pub enum AspectRatioPreference {
A16_10,
A5_4,
A15_9,
#[allow(dead_code)]
#[expect(dead_code)]
Unknown(u8),
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub enum ExtendedTimingInformation {
DefaultGtf,
NoTimingInformation,
@ -241,7 +241,7 @@ pub enum ExtendedTimingInformation {
}
#[derive(Copy, Clone, Debug, Default)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct ColorPoint {
pub white_point_index: u8,
pub white_point_x: u16,
@ -250,7 +250,7 @@ pub struct ColorPoint {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct EstablishedTimings3 {
pub s640x350_85: bool,
pub s640x400_85: bool,
@ -299,7 +299,7 @@ pub struct EstablishedTimings3 {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct ColorManagementData {
pub red_a3: u16,
pub red_a2: u16,
@ -326,7 +326,7 @@ pub enum CvtPreferredVerticalRate {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct Cvt3ByteCode {
pub addressable_lines_per_field: u16,
pub aspect_ration: CvtAspectRatio,
@ -339,7 +339,7 @@ pub struct Cvt3ByteCode {
}
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct DetailedTimingDescriptor {
pub pixel_clock_khz: u32,
pub horizontal_addressable_pixels: u16,
@ -360,7 +360,7 @@ pub struct DetailedTimingDescriptor {
}
#[derive(Clone, Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub enum Descriptor {
Unknown(u8),
DetailedTimingDescriptor(DetailedTimingDescriptor),
@ -394,7 +394,7 @@ macro_rules! bail {
#[derive(Clone, Debug)]
pub enum EdidParseContext {
#[allow(dead_code)]
#[expect(dead_code)]
ReadingBytes(usize),
BaseBlock,
Descriptors,
@ -1031,7 +1031,7 @@ pub enum DisplayColorType {
}
#[derive(Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub enum FeatureSupport2 {
Analog {
display_color_type: DisplayColorType,
@ -1044,7 +1044,7 @@ pub enum FeatureSupport2 {
}
#[derive(Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct FeatureSupport {
pub standby_supported: bool,
pub suspend_supported: bool,
@ -1056,7 +1056,7 @@ pub struct FeatureSupport {
}
#[derive(Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct EdidBaseBlock {
pub id_manufacturer_name: BString,
pub id_product_code: u16,
@ -1083,7 +1083,7 @@ pub enum EdidExtension {
}
#[derive(Debug)]
#[allow(dead_code)]
#[expect(dead_code)]
pub struct EdidFile {
pub base_block: EdidBaseBlock,
pub extension_blocks: Vec<EdidExtension>,

View file

@ -26,7 +26,7 @@ use {
};
pub const EI_DEVICE_TYPE_VIRTUAL: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
pub const EI_DEVICE_TYPE_PHYSICAL: u32 = 2;
pub struct EiDevice {
@ -100,7 +100,7 @@ impl EiDevice {
});
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_paused(&self, serial: u32) {
self.client.event(Paused {
self_id: self.id,

View file

@ -14,7 +14,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
pub struct EiPingpong {
pub id: EiPingpongId,
pub client: Rc<EiClient>,

View file

@ -20,7 +20,7 @@ pub const EI_HANDSHAKE_ID: EiHandshakeId = EiHandshakeId::from_raw(0);
pub struct EiObjectId(u64);
impl EiObjectId {
#[allow(dead_code)]
#[expect(dead_code)]
pub const NONE: Self = EiObjectId(0);
pub fn from_raw(raw: u64) -> Self {

View file

@ -131,7 +131,7 @@ const fn fourcc_code(a: char, b: char, c: char, d: char) -> u32 {
(a as u32) | ((b as u32) << 8) | ((c as u32) << 16) | ((d as u32) << 24)
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn debug(fourcc: u32) -> impl Debug {
debug_fn(move |fmt| {
fmt.write_char(fourcc as u8 as char)?;

View file

@ -5,12 +5,12 @@ macro_rules! egl_transparent {
pub struct $name(pub *mut u8);
impl $name {
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
pub const fn none() -> Self {
Self(std::ptr::null_mut())
}
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
pub fn is_none(self) -> bool {
self.0.is_null()
}
@ -26,7 +26,7 @@ macro_rules! dynload {
)*
}
) => {
#[allow(non_snake_case)]
#[expect(non_snake_case)]
#[derive(Debug)]
pub struct $container {
_lib: libloading::Library,
@ -45,7 +45,7 @@ macro_rules! dynload {
}
};
$(
#[allow(non_snake_case)]
#[expect(non_snake_case)]
let $fun: $ty =
match lib.get(stringify!($fun).as_bytes()) {
Ok(s) => *s,

View file

@ -3,7 +3,6 @@ use {crate::gfx_apis::gl::sys::GLenum, uapi::c};
pub type EGLint = i32;
pub type EGLenum = c::c_uint;
pub type EGLBoolean = c::c_uint;
#[allow(dead_code)]
pub type EGLuint64KHR = u64;
pub type EGLAttrib = isize;
pub type EGLSyncKHR = *mut u8;

View file

@ -7,7 +7,7 @@ pub type GLenum = c::c_uint;
pub type GLfloat = f32;
pub type GLint = c::c_int;
pub type GLsizei = c::c_int;
#[allow(dead_code)]
#[expect(dead_code)]
pub type GLubyte = u8;
pub type GLuint = c::c_uint;
@ -32,7 +32,7 @@ pub const GL_RENDERBUFFER: GLenum = 0x8D41;
pub const GL_TEXTURE0: GLenum = 0x84C0;
pub const GL_TEXTURE_2D: GLenum = 0x0DE1;
pub const GL_TEXTURE_EXTERNAL_OES: GLenum = 0x8D65;
#[allow(dead_code)]
#[expect(dead_code)]
pub const GL_TEXTURE_MAG_FILTER: GLenum = 0x2800;
pub const GL_TEXTURE_MIN_FILTER: GLenum = 0x2801;
pub const GL_TEXTURE_WRAP_S: GLenum = 0x2802;

View file

@ -70,7 +70,7 @@ impl VulkanDevice {
.offset(push_constant_offset)
.size(frag_push_size),
);
#[allow(unused_assignments)]
#[expect(unused_assignments)]
{
push_constant_offset += frag_push_size;
}

View file

@ -321,7 +321,7 @@ impl Globals {
}
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn get_output(&self, output: GlobalName) -> Result<Rc<WlOutputGlobal>, GlobalsError> {
match self.outputs.get(&output) {
Some(o) => Ok(o),

View file

@ -19,7 +19,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const ROLE: u32 = 0;
pub struct WlDataDevice {

View file

@ -12,11 +12,11 @@ use {
};
pub(super) const DND_NONE: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
pub(super) const DND_COPY: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
pub(super) const DND_MOVE: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
pub(super) const DND_ASK: u32 = 4;
pub(super) const DND_ALL: u32 = 7;

View file

@ -21,13 +21,13 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_FINISH: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_ACTION_MASK: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_ACTION: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_OFFER: u32 = 3;
pub struct WlDataOffer {

View file

@ -27,9 +27,9 @@ use {
uapi::OwnedFd,
};
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_ACTION_MASK: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_SOURCE: u32 = 1;
pub struct WlDataSource {

View file

@ -9,9 +9,9 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const NONE: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const CLIENT: u32 = 1;
const SERVER: u32 = 2;

View file

@ -13,9 +13,9 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const NONE: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const CLIENT: u32 = 1;
const SERVER: u32 = 2;

View file

@ -52,7 +52,6 @@ impl WlBuffer {
self.destroyed.get()
}
#[allow(clippy::too_many_arguments)]
pub fn new_dmabuf(
id: WlBufferId,
client: &Rc<Client>,
@ -82,7 +81,7 @@ impl WlBuffer {
}
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new_shm(
id: WlBufferId,
client: &Rc<Client>,

View file

@ -12,7 +12,7 @@ use {
const INVALID_OBJECT: u32 = 0;
const INVALID_METHOD: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const NO_MEMORY: u32 = 2;
const IMPLEMENTATION: u32 = 3;

View file

@ -26,15 +26,15 @@ use {
};
const SP_UNKNOWN: i32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_NONE: i32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_HORIZONTAL_RGB: i32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_HORIZONTAL_BGR: i32 = 3;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_VERTICAL_RGB: i32 = 4;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_VERTICAL_BGR: i32 = 5;
pub const TF_NORMAL: i32 = 0;
@ -47,7 +47,7 @@ pub const TF_FLIPPED_180: i32 = 6;
pub const TF_FLIPPED_270: i32 = 7;
const MODE_CURRENT: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const MODE_PREFERRED: u32 = 2;
pub struct WlOutputGlobal {

View file

@ -109,7 +109,7 @@ pub const POINTER: u32 = 1;
const KEYBOARD: u32 = 2;
const TOUCH: u32 = 4;
#[allow(dead_code)]
#[expect(dead_code)]
const MISSING_CAPABILITY: u32 = 0;
pub const BTN_LEFT: u32 = 0x110;

View file

@ -714,7 +714,7 @@ trait NodeSelectorUsecase: Sized + 'static {
fn node_focus(self: &Rc<Self>, seat: &Rc<WlSeatGlobal>, node: &Rc<dyn Node>);
}
impl<U: NodeSelectorUsecase + ?Sized> SimplePointerOwnerUsecase for Rc<U> {
impl<U: NodeSelectorUsecase> SimplePointerOwnerUsecase for Rc<U> {
const FIND_TREE_USECASE: FindTreeUsecase = <U as NodeSelectorUsecase>::FIND_TREE_USECASE;
const IS_DEFAULT: bool = false;

View file

@ -127,7 +127,7 @@ pub enum TabletToolType {
Brush,
Pencil,
Airbrush,
#[allow(dead_code)]
#[expect(dead_code)]
Finger,
Mouse,
Lens,

View file

@ -14,7 +14,7 @@ use {
pub const REPEAT_INFO_SINCE: Version = Version(4);
#[allow(dead_code)]
#[expect(dead_code)]
const NO_KEYMAP: u32 = 0;
pub const XKB_V1: u32 = 1;

View file

@ -12,7 +12,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const ROLE: u32 = 0;
pub(super) const RELEASED: u32 = 0;
@ -24,7 +24,6 @@ pub const HORIZONTAL_SCROLL: u32 = 1;
pub const WHEEL: u32 = 0;
pub const FINGER: u32 = 1;
pub const CONTINUOUS: u32 = 2;
#[allow(dead_code)]
pub const WHEEL_TILT: u32 = 3;
pub const IDENTICAL: u32 = 0;

View file

@ -11,9 +11,9 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
pub const SHAPE_SINCE_VERSION: Version = Version(6);
#[allow(dead_code)]
#[expect(dead_code)]
pub const ORIENTATION_DIRECTION_SINCE_VERSION: Version = Version(6);
pub struct WlTouch {
@ -78,7 +78,7 @@ impl WlTouch {
self.seat.client.event(Cancel { self_id: self.id })
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_shape(&self, id: i32, major: Fixed, minor: Fixed) {
self.seat.client.event(Shape {
self_id: self.id,
@ -88,7 +88,7 @@ impl WlTouch {
})
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_orientation(&self, id: i32, orientation: Fixed) {
self.seat.client.event(Orientation {
self_id: self.id,

View file

@ -11,7 +11,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const BAD_SURFACE: u32 = 0;
pub struct WlSubcompositorGlobal {

View file

@ -96,11 +96,11 @@ use {
zwp_idle_inhibitor_v1::ZwpIdleInhibitorV1,
};
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_SCALE: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_TRANSFORM: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_SIZE: u32 = 2;
const OFFSET_SINCE: Version = Version(5);
@ -634,7 +634,7 @@ impl WlSurface {
Ok(ext.into_xsurface().unwrap())
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn get_output(&self) -> Rc<OutputNode> {
self.output.get()
}

View file

@ -24,7 +24,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const BAD_SURFACE: u32 = 0;
const MAX_SUBSURFACE_DEPTH: u32 = 100;

View file

@ -37,10 +37,10 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const NOT_CONSTRUCTED: u32 = 1;
const ALREADY_CONSTRUCTED: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const UNCONFIGURED_BUFFER: u32 = 3;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]

View file

@ -30,7 +30,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_GRAB: u32 = 1;
tree_id!(PopupId);

View file

@ -56,10 +56,10 @@ pub enum ResizeEdge {
BottomRight = 10,
}
#[allow(dead_code)]
#[expect(dead_code)]
const STATE_MAXIMIZED: u32 = 1;
const STATE_FULLSCREEN: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const STATE_RESIZING: u32 = 3;
const STATE_ACTIVATED: u32 = 4;
const STATE_TILED_LEFT: u32 = 5;
@ -68,12 +68,12 @@ const STATE_TILED_TOP: u32 = 7;
const STATE_TILED_BOTTOM: u32 = 8;
pub const STATE_SUSPENDED: u32 = 9;
#[allow(dead_code)]
#[expect(dead_code)]
const CAP_WINDOW_MENU: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const CAP_MAXIMIZE: u32 = 2;
const CAP_FULLSCREEN: u32 = 3;
#[allow(dead_code)]
#[expect(dead_code)]
const CAP_MINIMIZE: u32 = 4;
pub const WM_CAPABILITIES_SINCE: Version = Version(5);
@ -81,7 +81,7 @@ pub const SUSPENDED_SINCE: Version = Version(6);
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Decoration {
#[allow(dead_code)]
#[expect(dead_code)]
Client,
Server,
}

View file

@ -37,7 +37,6 @@ use {
};
const KI_NONE: u32 = 0;
#[allow(dead_code)]
const KI_EXCLUSIVE: u32 = 1;
const KI_ON_DEMAND: u32 = 2;

View file

@ -127,7 +127,7 @@ impl ZwpInputPopupSurfaceV2 {
Ok(())
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_text_input_rectangle(&self, rect: Rect) {
self.client.event(TextInputRectangle {
self_id: self.id,

View file

@ -34,7 +34,7 @@ impl WpDrmLeaseConnectorV1 {
});
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_description(&self, description: &str) {
self.client.event(Description {
self_id: self.id,

View file

@ -19,10 +19,10 @@ pub struct WpPresentationFeedback {
}
pub const KIND_VSYNC: u32 = 0x1;
#[allow(dead_code)]
#[expect(dead_code)]
pub const KIND_HW_CLOCK: u32 = 0x2;
pub const KIND_HW_COMPLETION: u32 = 0x4;
#[allow(dead_code)]
#[expect(dead_code)]
pub const KIND_ZERO_COPY: u32 = 0x8;
impl WpPresentationFeedback {

View file

@ -15,16 +15,16 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const ROLE: u32 = 0;
const DEFUNCT_SURFACES: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const NOT_THE_TOPMOST_POPUP: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_POPUP_PARENT: u32 = 3;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_SURFACE_STATE: u32 = 4;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_POSITIONER: u32 = 5;
pub struct XdgWmBaseGlobal {

View file

@ -15,7 +15,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
pub const FLAGS_Y_INVERT: u32 = 1;
pub struct ZwlrScreencopyFrameV1 {
@ -81,7 +81,7 @@ impl ZwlrScreencopyFrameV1 {
self.client.event(BufferDone { self_id: self.id })
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_flags(&self, flags: u32) {
self.client.event(Flags {
self_id: self.id,

View file

@ -17,11 +17,11 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const Y_INVERT: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const INTERLACED: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const BOTTOM_FIRST: u32 = 4;
const MAX_PLANE: u32 = MAX_PLANES as u32 - 1;

View file

@ -12,7 +12,6 @@ use {
uapi::{c, OwnedFd},
};
#[allow(dead_code)]
pub const SCANOUT: u32 = 1;
pub struct ZwpLinuxDmabufFeedbackV1 {

View file

@ -11,7 +11,7 @@ use {
};
pub const NAME_SINCE: Version = Version(2);
#[allow(dead_code)]
#[expect(dead_code)]
pub const DESCRIPTION_SINCE: Version = Version(2);
pub const NO_DONE_SINCE: Version = Version(3);
@ -51,7 +51,7 @@ impl ZxdgOutputV1 {
});
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_description(&self, description: &str) {
self.client.event(Description {
self_id: self.id,

View file

@ -32,7 +32,7 @@ impl IoUring {
self.poll(fd, c::POLLIN).await.merge()
}
#[allow(dead_code)]
#[expect(dead_code)]
pub async fn writable(&self, fd: &Rc<OwnedFd>) -> Result<c::c_short, IoUringError> {
self.poll(fd, c::POLLOUT).await.merge()
}

View file

@ -7,7 +7,6 @@ use {
uapi::c,
};
#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Default)]
pub(super) struct timespec64 {

View file

@ -47,7 +47,7 @@ pub struct DefaultSeat {
}
impl TestClient {
#[allow(dead_code)]
#[expect(dead_code)]
pub fn error(&self, msg: &str) {
self.tran.error(msg)
}
@ -97,7 +97,7 @@ impl TestClient {
Ok(qoi)
}
#[allow(dead_code)]
#[expect(dead_code)]
pub async fn save_screenshot(&self, name: &str, include_cursor: bool) -> Result<(), TestError> {
let qoi = self.take_screenshot(include_cursor).await?;
let path = format!("{}/screenshot_{}.qoi", self.run.out_dir, name);

View file

@ -13,7 +13,7 @@ pub struct TestCursorShapeDevice {
}
impl TestCursorShapeDevice {
#[allow(dead_code)]
#[expect(dead_code)]
pub fn destroy(&self) -> TestResult {
if !self.destroyed.replace(true) {
self.tran.send(Destroy { self_id: self.id })?;

View file

@ -28,7 +28,7 @@ impl TestCursorShapeManager {
}
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn destroy(&self) -> TestResult {
if !self.destroyed.replace(true) {
self.tran.send(Destroy { self_id: self.id })?;

View file

@ -29,7 +29,7 @@ pub struct TestDataControlDevice {
}
impl TestDataControlDevice {
#[allow(dead_code)]
#[expect(dead_code)]
pub fn destroy(&self) -> TestResult {
if !self.destroyed.replace(true) {
self.tran.send(Destroy { self_id: self.id })?;
@ -45,7 +45,7 @@ impl TestDataControlDevice {
Ok(())
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn set_primary_selection(&self, source: &TestDataControlSource) -> TestResult {
self.tran.send(SetPrimarySelection {
self_id: self.id,

View file

@ -47,7 +47,6 @@ impl TestDataDevice {
Ok(())
}
#[allow(dead_code)]
pub fn set_selection(&self, source: &TestDataSource, serial: u32) -> TestResult {
self.tran.send(SetSelection {
self_id: self.id,

View file

@ -26,7 +26,6 @@ impl TestDataSource {
Ok(())
}
#[allow(dead_code)]
pub fn offer(&self, mime_type: &str) -> TestResult {
self.tran.send(Offer {
self_id: self.id,
@ -35,7 +34,6 @@ impl TestDataSource {
Ok(())
}
#[allow(dead_code)]
pub fn set_actions(&self, actions: u32) -> TestResult {
self.tran.send(SetActions {
self_id: self.id,

View file

@ -33,7 +33,7 @@ impl TestDmabuf {
Ok(())
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn get_default_feedback(&self) -> TestResult<Rc<TestDmabufFeedback>> {
let obj = Rc::new(TestDmabufFeedback::new(&self.tran));
self.tran.add_obj(obj.clone())?;

View file

@ -33,7 +33,7 @@ impl TestExtForeignToplevelList {
}
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn stop(&self) -> TestResult {
self.tran.send(Stop { self_id: self.id })?;
Ok(())

View file

@ -41,7 +41,7 @@ impl TestInputMethod {
})
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn grab(&self) -> TestResult<Rc<TestInputMethodKeyboardGrab>> {
let obj = Rc::new(TestInputMethodKeyboardGrab {
id: self.tran.id(),

View file

@ -39,7 +39,6 @@ impl TestShm {
&self.formats
}
#[allow(dead_code)]
pub fn create_pool(&self, size: usize) -> Result<Rc<TestShmPool>, TestError> {
let mem = TestMem::new(size)?;
let pool = Rc::new(TestShmPool {
@ -58,7 +57,6 @@ impl TestShm {
Ok(pool)
}
#[allow(dead_code)]
pub fn create_buffer(&self, width: i32, height: i32) -> TestResult<Rc<TestShmBuffer>> {
let pool = self.create_pool((width * height * 4) as _)?;
pool.create_buffer(0, width, height, width * 4, ARGB8888)

View file

@ -18,7 +18,6 @@ pub struct TestShmBuffer {
}
impl TestShmBuffer {
#[allow(dead_code)]
pub fn fill(&self, color: Color) {
let [cr, cg, cb, ca] = color.to_rgba_premultiplied();
for [b, g, r, a] in self.deref().array_chunks_ext::<4>() {

View file

@ -22,7 +22,6 @@ pub struct TestShmPool {
}
impl TestShmPool {
#[allow(dead_code)]
pub fn create_buffer(
&self,
offset: i32,
@ -61,7 +60,7 @@ impl TestShmPool {
Ok(buffer)
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn resize(&self, size: usize) -> Result<(), TestError> {
let mem = self.mem.get().grow(size)?;
self.mem.set(mem);

View file

@ -44,12 +44,11 @@ impl TestSubsurface {
})
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn set_sync(&self) -> Result<(), TestError> {
self.tran.send(SetSync { self_id: self.id })
}
#[allow(dead_code)]
pub fn set_desync(&self) -> Result<(), TestError> {
self.tran.send(SetDesync { self_id: self.id })
}

View file

@ -13,7 +13,6 @@ pub struct TestMem {
}
impl TestMem {
#[allow(dead_code)]
pub fn new(size: usize) -> Result<Rc<Self>, TestError> {
let fd = uapi::memfd_create("test_pool", c::MFD_CLOEXEC | c::MFD_ALLOW_SEALING)?;
uapi::fcntl_add_seals(fd.raw(), c::F_SEAL_SHRINK)?;
@ -25,7 +24,6 @@ impl TestMem {
}))
}
#[allow(dead_code)]
pub fn grow(&self, size: usize) -> Result<Rc<Self>, TestError> {
let cur_len = uapi::fstat(self.fd.raw())?;
if size > cur_len.st_size as _ {
@ -47,7 +45,6 @@ impl Deref for TestMem {
}
}
#[allow(dead_code)]
fn map(fd: c::c_int, size: usize) -> Result<*const [Cell<u8>], TestError> {
if size == 0 {
return Ok(&[]);

View file

@ -14,7 +14,7 @@ macro_rules! test_object {
self.id.into()
}
#[allow(unused_variables, unreachable_code)]
#[allow(clippy::allow_attributes, unused_variables, unreachable_code)]
fn handle_request(
self: std::rc::Rc<Self>,
request: u32,

View file

@ -17,7 +17,6 @@ impl<T> TestExpectedEvent<T> {
}
}
#[allow(dead_code)]
pub fn last(&self) -> TestResult<T> {
match self.data.events.borrow_mut().pop_back() {
Some(t) => Ok(t),

View file

@ -38,7 +38,6 @@ impl TestSurfaceExt {
Ok(())
}
#[allow(dead_code)]
pub fn set_color(&self, r: u8, g: u8, b: u8, a: u8) {
self.color.set(Color::from_rgba_straight(r, g, b, a));
}

View file

@ -169,7 +169,6 @@ impl<'a> LibInputDevice<'a> {
}
}
#[allow(dead_code)]
pub fn drag_enabled(&self) -> bool {
let enabled =
unsafe { ConfigDragState(libinput_device_config_tap_get_drag_enabled(self.dev)) };
@ -189,7 +188,6 @@ impl<'a> LibInputDevice<'a> {
}
}
#[allow(dead_code)]
pub fn drag_lock_enabled(&self) -> bool {
let enabled = unsafe {
ConfigDragLockState(libinput_device_config_tap_get_drag_lock_enabled(self.dev))

View file

@ -178,7 +178,6 @@ impl<'a> LibInputEventKeyboard<'a> {
unsafe { KeyState(libinput_event_keyboard_get_key_state(self.event)) }
}
#[allow(dead_code)]
pub fn time_usec(&self) -> u64 {
unsafe { libinput_event_keyboard_get_time_usec(self.event) }
}

View file

@ -109,7 +109,7 @@ macro_rules! id {
#[derive(Debug, Copy, Clone, Hash, Ord, PartialOrd, Eq, PartialEq)]
pub struct $name(u32);
#[allow(dead_code)]
#[expect(dead_code)]
impl $name {
pub const NONE: Self = $name(0);
@ -159,12 +159,12 @@ macro_rules! shared_ids {
pub struct $id($ty);
impl $id {
#[allow(dead_code)]
#[expect(dead_code)]
pub fn raw(&self) -> $ty {
self.0
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn from_raw(id: $ty) -> Self {
Self(id)
}
@ -211,12 +211,12 @@ macro_rules! linear_ids {
pub struct $id($ty);
impl $id {
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
pub fn raw(&self) -> $ty {
self.0
}
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
pub fn from_raw(id: $ty) -> Self {
Self(id)
}
@ -277,12 +277,12 @@ macro_rules! tree_id {
pub struct $id(u32);
impl $id {
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
pub fn raw(&self) -> u32 {
self.0
}
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
pub fn none() -> Self {
Self(0)
}
@ -382,7 +382,7 @@ macro_rules! assert_size_eq {
}};
}
#[allow(unused_macros)]
#[expect(unused_macros)]
macro_rules! assert_size_le {
($t:ty, $u:ty) => {{
struct AssertLeSize<T, U>(std::marker::PhantomData<T>, std::marker::PhantomData<U>);
@ -418,7 +418,7 @@ macro_rules! atoms {
$name:ident;
$($field_name:ident,)*
} => {
#[allow(non_snake_case, dead_code)]
#[expect(non_snake_case, dead_code)]
#[derive(Debug, Clone, Copy)]
struct $name {
$(
@ -471,11 +471,11 @@ macro_rules! bitflags {
pub struct $name(pub $rep);
$(
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
pub const $var: $name = $name($val);
)*
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
impl $name {
pub fn none() -> Self {
Self(0)
@ -549,7 +549,7 @@ macro_rules! bitflags {
}
impl std::fmt::Debug for $name {
#[allow(clippy::bad_bit_mask)]
#[allow(clippy::allow_attributes, clippy::bad_bit_mask)]
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut any = false;
let mut v = self.0;
@ -578,14 +578,13 @@ macro_rules! bitflags {
macro_rules! pw_opcodes {
($name:ident; $($var:ident = $val:expr,)*) => {
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
pub enum $name {
$(
$var,
)*
}
#[allow(dead_code)]
#[allow(clippy::allow_attributes, dead_code)]
impl $name {
pub fn from_id(id: u8) -> Option<Self> {
let v = match id {
@ -661,7 +660,7 @@ macro_rules! ei_id {
#[derive(Debug, Copy, Clone, Hash, Ord, PartialOrd, Eq, PartialEq)]
pub struct $name(u64);
#[allow(dead_code)]
#[expect(dead_code)]
impl $name {
pub const NONE: Self = $name(0);

View file

@ -37,6 +37,7 @@
clippy::unnecessary_cast,
clippy::manual_flatten
)]
#![warn(clippy::allow_attributes)]
#[macro_use]
mod macros;

View file

@ -18,7 +18,7 @@ pub const WL_DISPLAY_ID: WlDisplayId = WlDisplayId::from_raw(1);
pub struct ObjectId(u32);
impl ObjectId {
#[allow(dead_code)]
#[expect(dead_code)]
pub const NONE: Self = ObjectId(0);
pub fn from_raw(raw: u32) -> Self {
@ -39,7 +39,7 @@ impl Display for ObjectId {
pub trait ObjectBase {
fn id(&self) -> ObjectId;
fn version(&self) -> Version;
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
fn handle_request(
self: Rc<Self>,

View file

@ -201,7 +201,7 @@ impl PwCon {
});
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn sync<P: PwObject>(&self, p: &P) {
let seq = p.data().sync_id.fetch_add(1) + 1;
self.send2(0, "core", PwCoreMethods::Sync, |f| {
@ -218,7 +218,7 @@ impl PwCon {
});
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn get_registry(self: &Rc<Self>) -> Rc<PwRegistry> {
let registry = Rc::new(PwRegistry {
data: self.proxy_data(),

View file

@ -92,7 +92,7 @@ impl<'a> PwFormatter<'a> {
self.first = false;
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn write_float(&mut self, float: f32) {
if !self.array || self.first {
self.data.extend_from_slice(uapi::as_bytes(&4u32));
@ -106,7 +106,7 @@ impl<'a> PwFormatter<'a> {
self.first = false;
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn write_double(&mut self, double: f64) {
if !self.array || self.first {
self.data.extend_from_slice(uapi::as_bytes(&8u32));
@ -127,7 +127,7 @@ impl<'a> PwFormatter<'a> {
self.pad();
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn write_bytes(&mut self, s: &[u8]) {
self.data
.extend_from_slice(uapi::as_bytes(&(s.len() as u32)));
@ -148,7 +148,7 @@ impl<'a> PwFormatter<'a> {
self.first = false;
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn write_fraction(&mut self, num: i32, denom: i32) {
if !self.array || self.first {
self.data.extend_from_slice(uapi::as_bytes(&8u32));
@ -168,7 +168,7 @@ impl<'a> PwFormatter<'a> {
self.first = false;
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn write_bitmap(&mut self, s: &[u8]) {
self.data
.extend_from_slice(uapi::as_bytes(&(s.len() as u32)));
@ -178,7 +178,6 @@ impl<'a> PwFormatter<'a> {
self.pad();
}
#[allow(dead_code)]
pub fn write_fd(&mut self, fd: &Rc<OwnedFd>) {
let pos = self.fds.len() as u64;
self.fds.push(fd.clone());
@ -205,7 +204,7 @@ impl<'a> PwFormatter<'a> {
});
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn write_array<F>(&mut self, f: F)
where
F: FnOnce(&mut PwFormatter),

View file

@ -202,12 +202,12 @@ pub const PW_CLIENT_NODE_FACTORY: &str = "client-node";
pub const PW_CLIENT_NODE_INTERFACE: &str = "PipeWire:Interface:ClientNode";
pub const PW_CLIENT_NODE_VERSION: i32 = 4;
#[allow(dead_code)]
#[expect(dead_code)]
const PW_CLIENT_NODE_UPDATE_PARAMS: u32 = 1 << 0;
const PW_CLIENT_NODE_UPDATE_INFO: u32 = 1 << 1;
const SPA_NODE_CHANGE_MASK_FLAGS: u64 = 1 << 0;
#[allow(dead_code)]
#[expect(dead_code)]
const SPA_NODE_CHANGE_MASK_PROPS: u64 = 1 << 1;
const SPA_NODE_CHANGE_MASK_PARAMS: u64 = 1 << 2;
@ -216,7 +216,7 @@ const PW_CLIENT_NODE_PORT_UPDATE_INFO: u32 = 1 << 1;
const SPA_PORT_CHANGE_MASK_FLAGS: u64 = 1 << 0;
const SPA_PORT_CHANGE_MASK_RATE: u64 = 1 << 1;
#[allow(dead_code)]
#[expect(dead_code)]
const SPA_PORT_CHANGE_MASK_PROPS: u64 = 1 << 2;
const SPA_PORT_CHANGE_MASK_PARAMS: u64 = 1 << 3;

View file

@ -41,7 +41,7 @@ pub struct PwMemTyped<T> {
_phantom: PhantomData<T>,
}
#[allow(dead_code)]
#[expect(dead_code)]
pub struct PwMemSlice {
mem: Rc<PwMemMap>,
range: Range<usize>,
@ -85,19 +85,19 @@ impl PwMem {
}
impl PwMemMap {
#[allow(dead_code)]
#[expect(dead_code)]
pub unsafe fn read<T: Pod>(&self) -> &T {
self.check::<T>(0);
(self.map.ptr.cast::<u8>().add(self.range.start) as *const T).deref()
}
#[allow(dead_code)]
#[expect(dead_code)]
pub unsafe fn write<T: Pod>(&self) -> &mut T {
self.check::<T>(0);
(self.map.ptr.cast::<u8>().add(self.range.start) as *mut T).deref_mut()
}
#[allow(dead_code)]
#[expect(dead_code)]
pub unsafe fn bytes_mut(&self) -> &mut [u8] {
std::slice::from_raw_parts_mut(
self.map.ptr.cast::<u8>().add(self.range.start) as _,
@ -135,7 +135,6 @@ impl PwMemMap {
}
impl<T: Pod> PwMemTyped<T> {
#[allow(dead_code)]
pub unsafe fn read(&self) -> &T {
(self.mem.map.ptr.cast::<u8>().add(self.offset) as *const T).deref()
}

View file

@ -50,9 +50,9 @@ use {
};
const PORTAL_SUCCESS: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const PORTAL_CANCELLED: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const PORTAL_ENDED: u32 = 2;
pub fn run_freestanding(global: GlobalArgs) {

View file

@ -342,11 +342,11 @@ impl GuiElement for Label {
#[derive(Copy, Clone, Eq, PartialEq, Default)]
pub enum Align {
#[allow(dead_code)]
#[expect(dead_code)]
Left,
#[default]
Center,
#[allow(dead_code)]
#[expect(dead_code)]
Right,
}
@ -354,7 +354,6 @@ pub enum Align {
pub enum Orientation {
#[default]
Horizontal,
#[allow(dead_code)]
Vertical,
}

View file

@ -51,7 +51,6 @@ impl RectOverflow {
}
impl Rect {
#[allow(dead_code)]
pub fn new_empty(x: i32, y: i32) -> Self {
Self {
raw: RectRaw {
@ -72,7 +71,7 @@ impl Rect {
})
}
#[allow(dead_code)]
#[expect(dead_code)]
fn new_unchecked(x1: i32, y1: i32, x2: i32, y2: i32) -> Self {
Self {
raw: RectRaw { x1, y1, x2, y2 },
@ -139,7 +138,7 @@ impl Rect {
dx * dx + dy * dy
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn contains_rect(&self, rect: &Self) -> bool {
self.raw.x1 <= rect.raw.x1
&& self.raw.y1 <= rect.raw.x1
@ -160,7 +159,7 @@ impl Rect {
self.raw.x1 == self.raw.x2 || self.raw.y1 == self.raw.y2
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn to_origin(&self) -> Self {
Self {
raw: RectRaw {

View file

@ -73,7 +73,7 @@ impl Region {
})
}
#[allow(dead_code)]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn extents(&self) -> Rect {
self.extents
}
@ -148,7 +148,7 @@ impl RegionBuilder {
self.base.clone()
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn clear(&mut self) {
self.pending.clear();
self.base = Region::empty();

View file

@ -1112,7 +1112,6 @@ impl State {
self.eng.now().usec()
}
#[allow(dead_code)]
pub fn now_msec(&self) -> u64 {
self.eng.now().msec()
}

View file

@ -59,7 +59,6 @@ impl DrvDevHandler {
}
self.log_gfx_api();
'outer: loop {
#[allow(clippy::never_loop)]
while let Some(event) = self.data.dev.event() {
match event {
DrmEvent::Removed => break 'outer,

View file

@ -47,7 +47,6 @@ fn to_f32(c: u8) -> f32 {
c as f32 / 255f32
}
#[allow(dead_code)]
fn to_u8(c: f32) -> u8 {
(c * 255f32).round() as u8
}
@ -80,7 +79,7 @@ impl Color {
}
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn from_rgba_premultiplied(r: u8, g: u8, b: u8, a: u8) -> Self {
Self {
r: to_f32(r),
@ -112,7 +111,7 @@ impl Color {
}
}
#[allow(dead_code)]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn to_rgba_premultiplied(self) -> [u8; 4] {
[to_u8(self.r), to_u8(self.g), to_u8(self.b), to_u8(self.a)]
}
@ -121,7 +120,7 @@ impl Color {
[self.r, self.g, self.b, self.a]
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn to_array_linear(self) -> [f32; 4] {
fn to_linear(srgb: f32) -> f32 {
if srgb <= 0.04045 {
@ -138,7 +137,7 @@ impl Color {
]
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn and_then(self, other: &Color) -> Color {
Color {
r: self.r * (1.0 - other.a) + other.r,
@ -218,7 +217,7 @@ macro_rules! sizes {
}
#[derive(Copy, Clone, Debug)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum ThemeSized {
$(
$name,

View file

@ -373,7 +373,7 @@ pub trait Handle: RequestParser<'static> {
R: 'static,
H: for<'a> Fn(&R, Self::Generic<'a>) + 'static;
#[allow(dead_code)]
#[expect(dead_code)]
fn handle2<R, F, H>(tl: &Rc<ToolClient>, id: impl Into<ObjectId>, r: R, h: H)
where
R: 'static,

View file

@ -84,7 +84,7 @@ impl NodeIds {
pub struct NodeId(pub u32);
impl NodeId {
#[allow(dead_code)]
#[expect(dead_code)]
pub fn raw(&self) -> u32 {
self.0
}
@ -508,7 +508,7 @@ pub trait Node: 'static {
// TYPE CONVERTERS
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
fn node_into_float(self: Rc<Self>) -> Option<Rc<FloatNode>> {
None
}

View file

@ -44,7 +44,6 @@ use {
},
};
#[allow(dead_code)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum ContainerSplit {
Horizontal,
@ -69,7 +68,7 @@ impl Into<Axis> for ContainerSplit {
}
}
#[allow(dead_code)]
#[expect(dead_code)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum ContainerFocus {
None,

View file

@ -45,7 +45,7 @@ extern "C" {
fn udev_list_entry_get_next(list_entry: *mut udev_list_entry) -> *mut udev_list_entry;
fn udev_list_entry_get_name(list_entry: *mut udev_list_entry) -> *const c::c_char;
#[allow(dead_code)]
#[expect(dead_code)]
fn udev_list_entry_get_value(list_entry: *mut udev_list_entry) -> *const c::c_char;
fn udev_device_new_from_syspath(udev: *mut udev, syspath: *const c::c_char)
@ -56,7 +56,7 @@ extern "C" {
fn udev_device_get_is_initialized(udev_device: *mut udev_device) -> c::c_int;
fn udev_device_get_devnode(udev_device: *mut udev_device) -> *const c::c_char;
fn udev_device_get_syspath(udev_device: *mut udev_device) -> *const c::c_char;
fn udev_device_get_devtype(udev_device: *mut udev_device) -> *const c::c_char;
// fn udev_device_get_devtype(udev_device: *mut udev_device) -> *const c::c_char;
fn udev_device_get_devnum(udev_device: *mut udev_device) -> c::dev_t;
fn udev_device_get_action(udev_device: *mut udev_device) -> *const c::c_char;
fn udev_device_get_subsystem(udev_device: *mut udev_device) -> *const c::c_char;
@ -124,7 +124,7 @@ pub struct UdevDevice {
pub enum UdevDeviceType {
Character,
#[allow(dead_code)]
#[expect(dead_code)]
Block,
}
@ -332,7 +332,6 @@ impl<'a> UdevListEntry<'a> {
macro_rules! strfn {
($f:ident, $raw:ident) => {
#[allow(dead_code)]
pub fn $f(&self) -> Option<&CStr> {
let res = unsafe { $raw(self.device) };
if res.is_null() {
@ -348,7 +347,7 @@ impl UdevDevice {
strfn!(sysname, udev_device_get_sysname);
strfn!(syspath, udev_device_get_syspath);
strfn!(devnode, udev_device_get_devnode);
strfn!(devtype, udev_device_get_devtype);
// strfn!(devtype, udev_device_get_devtype);
strfn!(action, udev_device_get_action);
strfn!(subsystem, udev_device_get_subsystem);
@ -370,7 +369,6 @@ impl UdevDevice {
})
}
#[allow(dead_code)]
pub fn is_initialized(&self) -> bool {
unsafe { udev_device_get_is_initialized(self.device) != 0 }
}

View file

@ -259,7 +259,6 @@ impl From<UdmabufError> for AllocatorError {
}
}
#[allow(non_camel_case_types)]
#[repr(C)]
struct udmabuf_create {
memfd: u32,

View file

@ -42,7 +42,7 @@ impl<'a> EiMsgFormatter<'a> {
self
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn long(&mut self, int: i64) -> &mut Self {
self.write(uapi::as_bytes(&int));
self

View file

@ -79,7 +79,7 @@ impl<'a> MsgFormatter<'a> {
self.object(obj).uint(event)
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn array<F: FnOnce(&mut MsgFormatter<'_>)>(&mut self, f: F) -> &mut Self {
let pos = self.meta.write_pos;
self.uint(0);

View file

@ -59,12 +59,11 @@ impl<'a, 'b> MsgParser<'a, 'b> {
self.int().map(|i| ObjectId::from_raw(i as u32).into())
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn global(&mut self) -> Result<GlobalName, MsgParserError> {
self.int().map(|i| GlobalName::from_raw(i as u32))
}
#[allow(dead_code)]
pub fn fixed(&mut self) -> Result<Fixed, MsgParserError> {
self.int().map(Fixed)
}

View file

@ -5,7 +5,7 @@ use {
};
#[derive(Default, Copy, Clone)]
#[allow(non_camel_case_types, dead_code)]
#[expect(non_camel_case_types, dead_code)]
struct clone_args {
flags: u64,
pidfd: u64,

View file

@ -66,7 +66,6 @@ impl<T> CloneCell<Option<T>> {
}
#[inline(always)]
#[allow(dead_code)]
pub fn is_none(&self) -> bool {
unsafe { self.data.get().deref().is_none() }
}

View file

@ -74,7 +74,6 @@ impl<T> LinkedList<T> {
unsafe { self.endpoint(self.root.data.as_ref().prev.get()) }
}
#[allow(dead_code)]
pub fn first(&self) -> Option<NodeRef<T>> {
unsafe { self.endpoint(self.root.data.as_ref().next.get()) }
}
@ -91,7 +90,7 @@ impl<T> LinkedList<T> {
self.root.prepend_existing(t)
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn add_first_existing(&self, t: &NodeRef<T>) {
self.root.append_existing(t)
}

View file

@ -4,7 +4,7 @@ use {
uapi::{c, Errno},
};
#[allow(dead_code)]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn num_cpus() -> Result<u32, OsError> {
let mut buf: SmallVec<[usize; 32]> = smallvec_inline![0; 32];
loop {

View file

@ -205,7 +205,7 @@ impl Display for OsError {
}
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub trait OsErrorExt {
type Container;

Some files were not shown because too many files have changed in this diff Show more