Skip to content

Commit a2b103a

Browse files
committed
Replaced some allow attributes with conditional expect
1 parent 6f2d669 commit a2b103a

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

isoprenoid-unsend/src/runtime.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl Debug for LSRSymbol {
393393
mod global_callback_table_types {
394394
use super::ACallbackTableTypes;
395395

396-
#[allow(unreachable_pub)]
396+
#[cfg_attr(not(feature = "local_signals_runtime"), expect(unreachable_pub))]
397397
#[repr(transparent)]
398398
pub struct GlobalCallbackTableTypes(ACallbackTableTypes);
399399
}
@@ -547,7 +547,10 @@ impl<T: ?Sized, CTT: ?Sized + CallbackTableTypes> Clone for CallbackTable<T, CTT
547547
}
548548

549549
impl<T: ?Sized, CTT: ?Sized + CallbackTableTypes> PartialEq for CallbackTable<T, CTT> {
550-
#[expect(unpredictable_function_pointer_comparisons)] // Used only for interning.
550+
#[expect(
551+
unpredictable_function_pointer_comparisons,
552+
reason = "Used only for interning."
553+
)]
551554
fn eq(&self, other: &Self) -> bool {
552555
self.update == other.update && self.on_subscribed_change == other.on_subscribed_change
553556
}
@@ -562,7 +565,10 @@ impl<T: ?Sized, CTT: ?Sized + CallbackTableTypes> PartialOrd for CallbackTable<T
562565
}
563566

564567
impl<T: ?Sized, CTT: ?Sized + CallbackTableTypes> Ord for CallbackTable<T, CTT> {
565-
#[expect(unpredictable_function_pointer_comparisons)] // Used only for interning.
568+
#[expect(
569+
unpredictable_function_pointer_comparisons,
570+
reason = "Used only for interning."
571+
)]
566572
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
567573
match self.update.cmp(&other.update) {
568574
core::cmp::Ordering::Equal => {}
@@ -629,7 +635,7 @@ mod private {
629635

630636
use futures_lite::FutureExt;
631637

632-
#[allow(unreachable_pub)] // Used with "local_signals_runtime".
638+
#[cfg_attr(not(feature = "local_signals_runtime"), expect(unreachable_pub))]
633639
pub struct DetachedFuture<'f, Output: 'f>(
634640
pub(super) Pin<Box<dyn 'f + Future<Output = Output>>>,
635641
);

isoprenoid/src/runtime.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ impl Debug for GSRSymbol {
401401
mod global_callback_table_types {
402402
use super::ACallbackTableTypes;
403403

404-
#[allow(unreachable_pub)]
404+
#[cfg_attr(not(feature = "global_signals_runtime"), expect(unreachable_pub))]
405405
#[repr(transparent)]
406406
pub struct GlobalCallbackTableTypes(ACallbackTableTypes);
407407
}
@@ -557,7 +557,10 @@ impl<T: ?Sized, CTT: ?Sized + CallbackTableTypes> Clone for CallbackTable<T, CTT
557557
}
558558

559559
impl<T: ?Sized, CTT: ?Sized + CallbackTableTypes> PartialEq for CallbackTable<T, CTT> {
560-
#[expect(unpredictable_function_pointer_comparisons)] // Used only for interning.
560+
#[expect(
561+
unpredictable_function_pointer_comparisons,
562+
reason = "Used only for interning."
563+
)]
561564
fn eq(&self, other: &Self) -> bool {
562565
self.update == other.update && self.on_subscribed_change == other.on_subscribed_change
563566
}
@@ -572,7 +575,10 @@ impl<T: ?Sized, CTT: ?Sized + CallbackTableTypes> PartialOrd for CallbackTable<T
572575
}
573576

574577
impl<T: ?Sized, CTT: ?Sized + CallbackTableTypes> Ord for CallbackTable<T, CTT> {
575-
#[expect(unpredictable_function_pointer_comparisons)] // Used only for interning.
578+
#[expect(
579+
unpredictable_function_pointer_comparisons,
580+
reason = "Used only for interning."
581+
)]
576582
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
577583
match self.update.cmp(&other.update) {
578584
core::cmp::Ordering::Equal => {}
@@ -639,7 +645,7 @@ mod private {
639645

640646
use futures_lite::FutureExt;
641647

642-
#[allow(unreachable_pub)] // Used with "global_signals_runtime".
648+
#[cfg_attr(not(feature = "global_signals_runtime"), expect(unreachable_pub))]
643649
pub struct DetachedFuture<'f, Output: 'f>(
644650
pub(super) Pin<Box<dyn 'f + Send + Future<Output = Output>>>,
645651
);

0 commit comments

Comments
 (0)