Skip to content

Commit 2feb1cf

Browse files
kchibisovelinorbgr
authored andcommitted
Fix coverage testing on the CI
The way coverage is enabled/disabled was changed upstream. Links: rust-lang/rust#114656
1 parent 1c2fd23 commit 2feb1cf

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub struct InsertError<T> {
6767
}
6868

6969
impl<T> Debug for InsertError<T> {
70-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
70+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
7171
fn fmt(&self, formatter: &mut Formatter) -> core::result::Result<(), fmt::Error> {
7272
write!(formatter, "{:?}", self.error)
7373
}
@@ -76,7 +76,7 @@ impl<T> Debug for InsertError<T> {
7676
impl<T> From<InsertError<T>> for crate::Error {
7777
/// Converts the [`InsertError`] into Calloop's error type, throwing away
7878
/// the contained source.
79-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
79+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
8080
fn from(e: InsertError<T>) -> crate::Error {
8181
e.error
8282
}

src/io.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub struct Async<'l, F: AsFd> {
4242
}
4343

4444
impl<'l, F: AsFd + std::fmt::Debug> std::fmt::Debug for Async<'l, F> {
45-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
45+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
4646
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4747
f.debug_struct("Async").field("fd", &self.fd).finish()
4848
}

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
#![warn(missing_docs, missing_debug_implementations)]
144144
#![allow(clippy::needless_doctest_main)]
145145
#![cfg_attr(docsrs, feature(doc_cfg))]
146-
#![cfg_attr(feature = "nightly_coverage", feature(no_coverage))]
146+
#![cfg_attr(feature = "nightly_coverage", feature(coverage_attribute))]
147147

148148
mod sys;
149149

src/loop_logic.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ pub struct LoopHandle<'l, Data> {
8383
}
8484

8585
impl<'l, Data> std::fmt::Debug for LoopHandle<'l, Data> {
86-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
86+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
8787
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8888
f.write_str("LoopHandle { ... }")
8989
}
9090
}
9191

9292
impl<'l, Data> Clone for LoopHandle<'l, Data> {
93-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
93+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
9494
fn clone(&self) -> Self {
9595
LoopHandle {
9696
inner: self.inner.clone(),
@@ -128,7 +128,7 @@ impl<'l, Data> LoopHandle<'l, Data> {
128128
/// Use this function if you need access to the event source after its insertion in the loop.
129129
///
130130
/// See also `insert_source`.
131-
#[cfg_attr(feature = "nightly_coverage", no_coverage)] // Contains a branch we can't hit w/o OOM
131+
#[cfg_attr(feature = "nightly_coverage", coverage(off))] // Contains a branch we can't hit w/o OOM
132132
pub fn register_dispatcher<S>(
133133
&self,
134134
dispatcher: Dispatcher<'l, S, Data>,
@@ -282,7 +282,7 @@ pub struct EventLoop<'l, Data> {
282282
}
283283

284284
impl<'l, Data> std::fmt::Debug for EventLoop<'l, Data> {
285-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
285+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
286286
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
287287
f.write_str("EventLoop { ... }")
288288
}
@@ -659,7 +659,7 @@ pub struct LoopSignal {
659659
}
660660

661661
impl std::fmt::Debug for LoopSignal {
662-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
662+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
663663
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
664664
f.write_str("LoopSignal { ... }")
665665
}

src/sources/channel.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Sender<T> {
3636
}
3737

3838
impl<T> Clone for Sender<T> {
39-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
39+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
4040
fn clone(&self) -> Sender<T> {
4141
Sender {
4242
sender: self.sender.clone(),
@@ -72,7 +72,7 @@ pub struct SyncSender<T> {
7272
}
7373

7474
impl<T> Clone for SyncSender<T> {
75-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
75+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
7676
fn clone(&self) -> SyncSender<T> {
7777
SyncSender {
7878
sender: self.sender.clone(),

src/sources/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ where
478478
pub struct Dispatcher<'a, S, Data>(Rc<dyn ErasedDispatcher<'a, S, Data> + 'a>);
479479

480480
impl<'a, S, Data> std::fmt::Debug for Dispatcher<'a, S, Data> {
481-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
481+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
482482
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
483483
f.write_str("Dispatcher { ... }")
484484
}
@@ -555,7 +555,7 @@ pub struct Idle<'i> {
555555
}
556556

557557
impl<'i> std::fmt::Debug for Idle<'i> {
558-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
558+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
559559
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
560560
f.write_str("Idle { ... }")
561561
}

src/sources/timer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl std::cmp::PartialOrd for TimeoutData {
280280
// This impl is required for PartialOrd but actually never used
281281
// and the type is private, so ignore its coverage
282282
impl std::cmp::PartialEq for TimeoutData {
283-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
283+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
284284
fn eq(&self, other: &Self) -> bool {
285285
self.deadline == other.deadline
286286
}
@@ -297,7 +297,7 @@ pub struct TimeoutFuture {
297297
}
298298

299299
impl std::fmt::Debug for TimeoutFuture {
300-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
300+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
301301
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
302302
f.debug_struct("TimeoutFuture")
303303
.field("deadline", &self.deadline)

src/sys.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub struct Poll {
200200
}
201201

202202
impl std::fmt::Debug for Poll {
203-
#[cfg_attr(feature = "nightly_coverage", no_coverage)]
203+
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
204204
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
205205
f.write_str("Poll { ... }")
206206
}

0 commit comments

Comments
 (0)