Skip to content

Commit 232dd36

Browse files
committed
silence warnings reported by newer rust versions
1 parent ceffdc9 commit 232dd36

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

examples/a-chat/server.rs

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ async fn connection_writer_loop(
9696
None => break,
9797
},
9898
void = shutdown.next().fuse() => match void {
99+
#[allow(unreachable_patterns)]
99100
Some(void) => match void {},
100101
None => break,
101102
}

src/future/future/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub use core::future::Future as Future;
2727
2828
[`Future`]: ../future/trait.Future.html
2929
"#]
30+
#[cfg(any(feature = "unstable", feature = "docs"))]
3031
pub trait FutureExt: Future {
3132
/// Returns a Future that delays execution for a specified time.
3233
///
@@ -284,5 +285,6 @@ pub trait FutureExt: Future {
284285
}
285286
}
286287

288+
#[cfg(any(feature = "unstable", feature = "docs"))]
287289
impl<T: Future + ?Sized> FutureExt for T {}
288290

src/io/buf_writer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pin_project! {
114114
/// # Ok(()) }) }
115115
///```
116116
#[derive(Debug)]
117-
pub struct IntoInnerError<W>(W, crate::io::Error);
117+
pub struct IntoInnerError<W>(W, #[allow(dead_code)] crate::io::Error);
118118

119119
impl<W: Write> BufWriter<W> {
120120
/// Creates a new `BufWriter` with a default buffer capacity. The default is currently 8 KB,

src/io/read/bytes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<T: Read + Unpin> Stream for Bytes<T> {
3232
}
3333
}
3434

35-
#[cfg(all(test, default))]
35+
#[cfg(all(test, feature = "default"))]
3636
mod tests {
3737
use crate::io;
3838
use crate::prelude::*;

src/io/read/chain.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<T: BufRead, U: BufRead> BufRead for Chain<T, U> {
165165
}
166166
}
167167

168-
#[cfg(all(test, default))]
168+
#[cfg(all(test, feature = "default"))]
169169
mod tests {
170170
use crate::io;
171171
use crate::prelude::*;

src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@
284284
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
285285
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]
286286

287-
extern crate alloc;
288-
289287
#[macro_use]
290288
mod utils;
291289

src/utils.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use alloc::string::String;
2-
31
/// Calls a function and aborts if it panics.
42
///
53
/// This is useful in unsafe code where we can't recover from panics.
@@ -55,8 +53,9 @@ pub fn random(n: u32) -> u32 {
5553
}
5654

5755
/// Add additional context to errors
56+
#[cfg(any(feature = "unstable", feature = "default"))]
5857
pub(crate) trait Context {
59-
fn context(self, message: impl Fn() -> String) -> Self;
58+
fn context(self, message: impl Fn() -> alloc::string::String) -> Self;
6059
}
6160

6261
#[cfg(all(

0 commit comments

Comments
 (0)