Auto merge of #133089 - eholk:stabilize-noop-waker, r=dtolnay

Stabilize noop_waker

Tracking Issue: #98286

This is a handy feature that's been used widely in tests and example async code and it'd be nice to make it available to users.

cc `@rust-lang/wg-async`
This commit is contained in:
bors 2024-12-06 18:34:16 +00:00
commit 8dc83770f7
46 changed files with 109 additions and 137 deletions

View File

@ -199,7 +199,6 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
///
/// ```rust
/// #![feature(local_waker)]
/// #![feature(noop_waker)]
/// use std::task::{LocalWake, ContextBuilder, LocalWaker, Waker};
/// use std::future::Future;
/// use std::pin::Pin;

View File

@ -60,7 +60,8 @@ impl RawWaker {
RawWaker { data, vtable }
}
#[unstable(feature = "noop_waker", issue = "98286")]
#[stable(feature = "noop_waker", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "noop_waker", since = "CURRENT_RUSTC_VERSION")]
const NOOP: RawWaker = {
const VTABLE: RawWakerVTable = RawWakerVTable::new(
// Cloning just returns a new no-op raw waker
@ -283,7 +284,6 @@ impl fmt::Debug for Context<'_> {
/// # Examples
/// ```
/// #![feature(local_waker)]
/// #![feature(noop_waker)]
/// use std::task::{ContextBuilder, LocalWaker, Waker, Poll};
/// use std::future::Future;
///
@ -555,8 +555,6 @@ impl Waker {
/// # Examples
///
/// ```
/// #![feature(noop_waker)]
///
/// use std::future::Future;
/// use std::task;
///
@ -567,7 +565,8 @@ impl Waker {
/// ```
#[inline]
#[must_use]
#[unstable(feature = "noop_waker", issue = "98286")]
#[stable(feature = "noop_waker", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "noop_waker", since = "CURRENT_RUSTC_VERSION")]
pub const fn noop() -> &'static Waker {
const WAKER: &Waker = &Waker { waker: RawWaker::NOOP };
WAKER
@ -850,8 +849,6 @@ impl LocalWaker {
///
/// ```
/// #![feature(local_waker)]
/// #![feature(noop_waker)]
///
/// use std::future::Future;
/// use std::task::{ContextBuilder, LocalWaker, Waker, Poll};
///
@ -864,7 +861,7 @@ impl LocalWaker {
/// ```
#[inline]
#[must_use]
#[unstable(feature = "noop_waker", issue = "98286")]
#[unstable(feature = "local_waker", issue = "118959")]
pub const fn noop() -> &'static LocalWaker {
const WAKER: &LocalWaker = &LocalWaker { waker: RawWaker::NOOP };
WAKER

View File

@ -61,7 +61,6 @@
#![feature(maybe_uninit_write_slice)]
#![feature(min_specialization)]
#![feature(never_type)]
#![feature(noop_waker)]
#![feature(num_midpoint_signed)]
#![feature(numfmt)]
#![feature(pattern)]

View File

@ -1,6 +1,6 @@
// Same as rustc's `tests/ui/async-await/async-closures/captures.rs`, keep in sync
#![feature(async_closure, noop_waker, async_trait_bounds)]
#![feature(async_closure, async_trait_bounds)]
use std::future::Future;
use std::pin::pin;

View File

@ -1,4 +1,4 @@
#![feature(async_closure, noop_waker, async_trait_bounds)]
#![feature(async_closure, async_trait_bounds)]
use std::future::Future;
use std::pin::pin;

View File

@ -1,4 +1,4 @@
#![feature(async_closure, noop_waker, async_fn_traits)]
#![feature(async_closure, async_fn_traits)]
#![allow(unused)]
use std::future::Future;

View File

@ -6,7 +6,7 @@
// please consider modifying rustc's async drop test at
// `tests/ui/async-await/async-drop.rs`.
#![feature(async_drop, impl_trait_in_assoc_type, noop_waker, async_closure)]
#![feature(async_drop, impl_trait_in_assoc_type, async_closure)]
#![allow(incomplete_features, dead_code)]
// FIXME(zetanumbers): consider AsyncDestruct::async_drop cleanup tests

View File

@ -1,5 +1,4 @@
#![feature(never_type)]
#![feature(noop_waker)]
use std::future::Future;

View File

@ -1,7 +1,6 @@
#![feature(dyn_star)]
#![allow(incomplete_features)]
#![feature(custom_inner_attributes)]
#![feature(noop_waker)]
// rustfmt destroys `dyn* Trait` syntax
#![rustfmt::skip]

View File

@ -1,6 +1,5 @@
//@revisions: stack tree
//@[tree]compile-flags: -Zmiri-tree-borrows
#![feature(noop_waker)]
use std::future::*;
use std::marker::PhantomPinned;

View File

@ -1,5 +1,3 @@
#![feature(noop_waker)]
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll, Waker};

View File

@ -1,4 +1,3 @@
#![feature(noop_waker)]
use std::future::Future;
use std::ptr;

View File

@ -1,20 +1,20 @@
Function name: async::c
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 01, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 01, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 25)
- Code(Counter(0)) at (prev + 11, 1) to (start + 0, 25)
Highest counter ID seen: c0
Function name: async::c::{closure#0}
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 0c, 19, 01, 0e, 05, 02, 09, 00, 0a, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02]
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 0b, 19, 01, 0e, 05, 02, 09, 00, 0a, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 1
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 12, 25) to (start + 1, 14)
- Code(Counter(0)) at (prev + 11, 25) to (start + 1, 14)
- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 10)
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10)
= (c0 - c1)
@ -22,93 +22,93 @@ Number of file 0 mappings: 4
Highest counter ID seen: c1
Function name: async::d
Raw bytes (9): 0x[01, 01, 00, 01, 01, 14, 01, 00, 14]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 01, 00, 14]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 20, 1) to (start + 0, 20)
- Code(Counter(0)) at (prev + 19, 1) to (start + 0, 20)
Highest counter ID seen: c0
Function name: async::d::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 14, 14, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 14, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 20, 20) to (start + 0, 25)
- Code(Counter(0)) at (prev + 19, 20) to (start + 0, 25)
Highest counter ID seen: c0
Function name: async::e (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 16, 01, 00, 14]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 15, 01, 00, 14]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 22, 1) to (start + 0, 20)
- Code(Zero) at (prev + 21, 1) to (start + 0, 20)
Highest counter ID seen: (none)
Function name: async::e::{closure#0} (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 16, 14, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 15, 14, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 22, 20) to (start + 0, 25)
- Code(Zero) at (prev + 21, 20) to (start + 0, 25)
Highest counter ID seen: (none)
Function name: async::f
Raw bytes (9): 0x[01, 01, 00, 01, 01, 18, 01, 00, 14]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 01, 00, 14]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 24, 1) to (start + 0, 20)
- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 20)
Highest counter ID seen: c0
Function name: async::f::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 18, 14, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 14, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 24, 20) to (start + 0, 25)
- Code(Counter(0)) at (prev + 23, 20) to (start + 0, 25)
Highest counter ID seen: c0
Function name: async::foo (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 1a, 01, 00, 1e]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 19, 01, 00, 1e]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 26, 1) to (start + 0, 30)
- Code(Zero) at (prev + 25, 1) to (start + 0, 30)
Highest counter ID seen: (none)
Function name: async::foo::{closure#0} (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 1a, 1e, 00, 2d]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 19, 1e, 00, 2d]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 26, 30) to (start + 0, 45)
- Code(Zero) at (prev + 25, 30) to (start + 0, 45)
Highest counter ID seen: (none)
Function name: async::g
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1c, 01, 00, 17]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1b, 01, 00, 17]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 28, 1) to (start + 0, 23)
- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 23)
Highest counter ID seen: c0
Function name: async::g::{closure#0} (unused)
Raw bytes (59): 0x[01, 01, 00, 0b, 00, 1c, 17, 01, 0c, 00, 02, 09, 00, 0a, 00, 00, 0e, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 09, 00, 0a, 00, 00, 0e, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Raw bytes (59): 0x[01, 01, 00, 0b, 00, 1b, 17, 01, 0c, 00, 02, 09, 00, 0a, 00, 00, 0e, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 09, 00, 0a, 00, 00, 0e, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 11
- Code(Zero) at (prev + 28, 23) to (start + 1, 12)
- Code(Zero) at (prev + 27, 23) to (start + 1, 12)
- Code(Zero) at (prev + 2, 9) to (start + 0, 10)
- Code(Zero) at (prev + 0, 14) to (start + 0, 23)
- Code(Zero) at (prev + 0, 27) to (start + 0, 28)
@ -122,21 +122,21 @@ Number of file 0 mappings: 11
Highest counter ID seen: (none)
Function name: async::h
Raw bytes (9): 0x[01, 01, 00, 01, 01, 24, 01, 00, 16]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 23, 01, 00, 16]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 36, 1) to (start + 0, 22)
- Code(Counter(0)) at (prev + 35, 1) to (start + 0, 22)
Highest counter ID seen: c0
Function name: async::h::{closure#0} (unused)
Raw bytes (39): 0x[01, 01, 00, 07, 00, 24, 16, 03, 0c, 00, 04, 09, 00, 0a, 00, 00, 0e, 00, 19, 00, 00, 1a, 00, 1b, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Raw bytes (39): 0x[01, 01, 00, 07, 00, 23, 16, 03, 0c, 00, 04, 09, 00, 0a, 00, 00, 0e, 00, 19, 00, 00, 1a, 00, 1b, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 7
- Code(Zero) at (prev + 36, 22) to (start + 3, 12)
- Code(Zero) at (prev + 35, 22) to (start + 3, 12)
- Code(Zero) at (prev + 4, 9) to (start + 0, 10)
- Code(Zero) at (prev + 0, 14) to (start + 0, 25)
- Code(Zero) at (prev + 0, 26) to (start + 0, 27)
@ -146,23 +146,23 @@ Number of file 0 mappings: 7
Highest counter ID seen: (none)
Function name: async::i
Raw bytes (9): 0x[01, 01, 00, 01, 01, 2d, 01, 00, 13]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 2c, 01, 00, 13]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 45, 1) to (start + 0, 19)
- Code(Counter(0)) at (prev + 44, 1) to (start + 0, 19)
Highest counter ID seen: c0
Function name: async::i::{closure#0}
Raw bytes (63): 0x[01, 01, 02, 07, 15, 0d, 11, 0b, 01, 2d, 13, 04, 0c, 09, 05, 09, 00, 0a, 01, 00, 0e, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 11, 01, 09, 00, 0a, 19, 00, 0e, 00, 17, 1d, 00, 1b, 00, 20, 11, 00, 24, 00, 26, 15, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
Raw bytes (63): 0x[01, 01, 02, 07, 15, 0d, 11, 0b, 01, 2c, 13, 04, 0c, 09, 05, 09, 00, 0a, 01, 00, 0e, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 11, 01, 09, 00, 0a, 19, 00, 0e, 00, 17, 1d, 00, 1b, 00, 20, 11, 00, 24, 00, 26, 15, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(5)
- expression 1 operands: lhs = Counter(3), rhs = Counter(4)
Number of file 0 mappings: 11
- Code(Counter(0)) at (prev + 45, 19) to (start + 4, 12)
- Code(Counter(0)) at (prev + 44, 19) to (start + 4, 12)
- Code(Counter(2)) at (prev + 5, 9) to (start + 0, 10)
- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 24)
- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 33)
@ -177,14 +177,14 @@ Number of file 0 mappings: 11
Highest counter ID seen: c7
Function name: async::j
Raw bytes (58): 0x[01, 01, 02, 07, 0d, 05, 09, 0a, 01, 38, 01, 00, 0d, 01, 0b, 0b, 00, 0c, 05, 01, 09, 00, 0a, 01, 00, 0e, 00, 1b, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 11, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 0d, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
Raw bytes (58): 0x[01, 01, 02, 07, 0d, 05, 09, 0a, 01, 37, 01, 00, 0d, 01, 0b, 0b, 00, 0c, 05, 01, 09, 00, 0a, 01, 00, 0e, 00, 1b, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 11, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 0d, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3)
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
Number of file 0 mappings: 10
- Code(Counter(0)) at (prev + 56, 1) to (start + 0, 13)
- Code(Counter(0)) at (prev + 55, 1) to (start + 0, 13)
- Code(Counter(0)) at (prev + 11, 11) to (start + 0, 12)
- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10)
- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 27)
@ -198,13 +198,13 @@ Number of file 0 mappings: 10
Highest counter ID seen: c4
Function name: async::j::c
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 3a, 05, 01, 12, 05, 02, 0d, 00, 0e, 02, 02, 0d, 00, 0e, 01, 02, 05, 00, 06]
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 39, 05, 01, 12, 05, 02, 0d, 00, 0e, 02, 02, 0d, 00, 0e, 01, 02, 05, 00, 06]
Number of files: 1
- file 0 => global file 1
Number of expressions: 1
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 58, 5) to (start + 1, 18)
- Code(Counter(0)) at (prev + 57, 5) to (start + 1, 18)
- Code(Counter(1)) at (prev + 2, 13) to (start + 0, 14)
- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 14)
= (c0 - c1)
@ -212,6 +212,15 @@ Number of file 0 mappings: 4
Highest counter ID seen: c1
Function name: async::j::d
Raw bytes (9): 0x[01, 01, 00, 01, 01, 40, 05, 00, 17]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 64, 5) to (start + 0, 23)
Highest counter ID seen: c0
Function name: async::j::f
Raw bytes (9): 0x[01, 01, 00, 01, 01, 41, 05, 00, 17]
Number of files: 1
- file 0 => global file 1
@ -220,22 +229,13 @@ Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 65, 5) to (start + 0, 23)
Highest counter ID seen: c0
Function name: async::j::f
Raw bytes (9): 0x[01, 01, 00, 01, 01, 42, 05, 00, 17]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 66, 5) to (start + 0, 23)
Highest counter ID seen: c0
Function name: async::k (unused)
Raw bytes (29): 0x[01, 01, 00, 05, 00, 4a, 01, 01, 0c, 00, 02, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Raw bytes (29): 0x[01, 01, 00, 05, 00, 49, 01, 01, 0c, 00, 02, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 5
- Code(Zero) at (prev + 74, 1) to (start + 1, 12)
- Code(Zero) at (prev + 73, 1) to (start + 1, 12)
- Code(Zero) at (prev + 2, 14) to (start + 0, 16)
- Code(Zero) at (prev + 1, 14) to (start + 0, 16)
- Code(Zero) at (prev + 1, 14) to (start + 0, 16)
@ -243,14 +243,14 @@ Number of file 0 mappings: 5
Highest counter ID seen: (none)
Function name: async::l
Raw bytes (33): 0x[01, 01, 02, 01, 07, 05, 09, 05, 01, 52, 01, 01, 0c, 02, 02, 0e, 00, 10, 09, 01, 0e, 00, 10, 05, 01, 0e, 00, 10, 01, 02, 01, 00, 02]
Raw bytes (33): 0x[01, 01, 02, 01, 07, 05, 09, 05, 01, 51, 01, 01, 0c, 02, 02, 0e, 00, 10, 09, 01, 0e, 00, 10, 05, 01, 0e, 00, 10, 01, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Expression(1, Add)
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
Number of file 0 mappings: 5
- Code(Counter(0)) at (prev + 82, 1) to (start + 1, 12)
- Code(Counter(0)) at (prev + 81, 1) to (start + 1, 12)
- Code(Expression(0, Sub)) at (prev + 2, 14) to (start + 0, 16)
= (c0 - (c1 + c2))
- Code(Counter(2)) at (prev + 1, 14) to (start + 0, 16)
@ -259,29 +259,29 @@ Number of file 0 mappings: 5
Highest counter ID seen: c2
Function name: async::m
Raw bytes (9): 0x[01, 01, 00, 01, 01, 5a, 01, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 59, 01, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 90, 1) to (start + 0, 25)
- Code(Counter(0)) at (prev + 89, 1) to (start + 0, 25)
Highest counter ID seen: c0
Function name: async::m::{closure#0} (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 5a, 19, 00, 22]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 59, 19, 00, 22]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 90, 25) to (start + 0, 34)
- Code(Zero) at (prev + 89, 25) to (start + 0, 34)
Highest counter ID seen: (none)
Function name: async::main
Raw bytes (9): 0x[01, 01, 00, 01, 01, 5c, 01, 08, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 5b, 01, 08, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 92, 1) to (start + 8, 2)
- Code(Counter(0)) at (prev + 91, 1) to (start + 8, 2)
Highest counter ID seen: c0

View File

@ -1,6 +1,5 @@
LL| |#![feature(coverage_attribute)]
LL| |#![feature(custom_inner_attributes)] // for #![rustfmt::skip]
LL| |#![feature(noop_waker)]
LL| |#![allow(unused_assignments, dead_code)]
LL| |#![rustfmt::skip]
LL| |//@ edition: 2018

View File

@ -1,6 +1,5 @@
#![feature(coverage_attribute)]
#![feature(custom_inner_attributes)] // for #![rustfmt::skip]
#![feature(noop_waker)]
#![allow(unused_assignments, dead_code)]
#![rustfmt::skip]
//@ edition: 2018

View File

@ -1,58 +1,58 @@
Function name: async2::async_func
Raw bytes (9): 0x[01, 01, 00, 01, 01, 10, 01, 00, 17]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0f, 01, 00, 17]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 16, 1) to (start + 0, 23)
- Code(Counter(0)) at (prev + 15, 1) to (start + 0, 23)
Highest counter ID seen: c0
Function name: async2::async_func::{closure#0}
Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 17, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
Raw bytes (24): 0x[01, 01, 00, 04, 01, 0f, 17, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 16, 23) to (start + 3, 9)
- Code(Counter(0)) at (prev + 15, 23) to (start + 3, 9)
- Code(Counter(1)) at (prev + 3, 10) to (start + 2, 6)
- Code(Zero) at (prev + 2, 5) to (start + 0, 6)
- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
Highest counter ID seen: c1
Function name: async2::async_func_just_println
Raw bytes (9): 0x[01, 01, 00, 01, 01, 18, 01, 00, 24]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 01, 00, 24]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 24, 1) to (start + 0, 36)
- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 36)
Highest counter ID seen: c0
Function name: async2::async_func_just_println::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 18, 24, 02, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 24, 02, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 24, 36) to (start + 2, 2)
- Code(Counter(0)) at (prev + 23, 36) to (start + 2, 2)
Highest counter ID seen: c0
Function name: async2::main
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1c, 01, 07, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1b, 01, 07, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 28, 1) to (start + 7, 2)
- Code(Counter(0)) at (prev + 27, 1) to (start + 7, 2)
Highest counter ID seen: c0
Function name: async2::non_async_func
Raw bytes (24): 0x[01, 01, 00, 04, 01, 08, 01, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
Raw bytes (24): 0x[01, 01, 00, 04, 01, 07, 01, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 8, 1) to (start + 3, 9)
- Code(Counter(0)) at (prev + 7, 1) to (start + 3, 9)
- Code(Counter(1)) at (prev + 3, 10) to (start + 2, 6)
- Code(Zero) at (prev + 2, 5) to (start + 0, 6)
- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)

View File

@ -1,5 +1,4 @@
LL| |#![feature(coverage_attribute)]
LL| |#![feature(noop_waker)]
LL| |//@ edition: 2018
LL| |
LL| |//@ aux-build: executor.rs

View File

@ -1,5 +1,4 @@
#![feature(coverage_attribute)]
#![feature(noop_waker)]
//@ edition: 2018
//@ aux-build: executor.rs

View File

@ -1,11 +1,11 @@
Function name: async_block::main
Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 08, 01, 00, 0b, 05, 01, 09, 00, 0a, 03, 00, 0e, 00, 13, 05, 00, 14, 01, 16, 05, 07, 0a, 02, 06, 01, 03, 01, 00, 02]
Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 07, 01, 00, 0b, 05, 01, 09, 00, 0a, 03, 00, 0e, 00, 13, 05, 00, 14, 01, 16, 05, 07, 0a, 02, 06, 01, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 1
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 6
- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 11)
- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 11)
- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10)
- Code(Expression(0, Add)) at (prev + 0, 14) to (start + 0, 19)
= (c0 + c1)
@ -15,13 +15,13 @@ Number of file 0 mappings: 6
Highest counter ID seen: c1
Function name: async_block::main::{closure#0}
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 0a, 1c, 01, 17, 05, 01, 18, 02, 0e, 02, 02, 14, 02, 0e, 01, 03, 09, 00, 0a]
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 09, 1c, 01, 17, 05, 01, 18, 02, 0e, 02, 02, 14, 02, 0e, 01, 03, 09, 00, 0a]
Number of files: 1
- file 0 => global file 1
Number of expressions: 1
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 10, 28) to (start + 1, 23)
- Code(Counter(0)) at (prev + 9, 28) to (start + 1, 23)
- Code(Counter(1)) at (prev + 1, 24) to (start + 2, 14)
- Code(Expression(0, Sub)) at (prev + 2, 20) to (start + 2, 14)
= (c0 - c1)

View File

@ -1,5 +1,4 @@
LL| |#![feature(coverage_attribute)]
LL| |#![feature(noop_waker)]
LL| |//@ edition: 2021
LL| |
LL| |//@ aux-build: executor.rs

View File

@ -1,5 +1,4 @@
#![feature(coverage_attribute)]
#![feature(noop_waker)]
//@ edition: 2021
//@ aux-build: executor.rs

View File

@ -1,4 +1,4 @@
#![feature(coverage_attribute, noop_waker)]
#![feature(coverage_attribute)]
//@ edition: 2021
use core::future::Future;

View File

@ -1,19 +1,19 @@
Function name: await_ready::await_ready
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0f, 01, 00, 1e]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0e, 01, 00, 1e]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 15, 1) to (start + 0, 30)
- Code(Counter(0)) at (prev + 14, 1) to (start + 0, 30)
Highest counter ID seen: c0
Function name: await_ready::await_ready::{closure#0}
Raw bytes (14): 0x[01, 01, 00, 02, 01, 0f, 1e, 03, 0f, 05, 04, 01, 00, 02]
Raw bytes (14): 0x[01, 01, 00, 02, 01, 0e, 1e, 03, 0f, 05, 04, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 2
- Code(Counter(0)) at (prev + 15, 30) to (start + 3, 15)
- Code(Counter(0)) at (prev + 14, 30) to (start + 3, 15)
- Code(Counter(1)) at (prev + 4, 1) to (start + 0, 2)
Highest counter ID seen: c1

View File

@ -1,5 +1,4 @@
LL| |#![feature(coverage_attribute)]
LL| |#![feature(noop_waker)]
LL| |#![coverage(off)]
LL| |//@ edition: 2021
LL| |

View File

@ -1,5 +1,4 @@
#![feature(coverage_attribute)]
#![feature(noop_waker)]
#![coverage(off)]
//@ edition: 2021

View File

@ -1,29 +1,29 @@
Function name: closure_macro_async::load_configuration_files
Raw bytes (9): 0x[01, 01, 00, 01, 01, 22, 01, 02, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 21, 01, 02, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 34, 1) to (start + 2, 2)
- Code(Counter(0)) at (prev + 33, 1) to (start + 2, 2)
Highest counter ID seen: c0
Function name: closure_macro_async::test
Raw bytes (9): 0x[01, 01, 00, 01, 01, 26, 01, 00, 2b]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 25, 01, 00, 2b]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 38, 1) to (start + 0, 43)
- Code(Counter(0)) at (prev + 37, 1) to (start + 0, 43)
Highest counter ID seen: c0
Function name: closure_macro_async::test::{closure#0}
Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 26, 2b, 01, 21, 02, 02, 09, 00, 0f, 01, 00, 12, 00, 54, 05, 00, 54, 00, 55, 02, 02, 09, 02, 0b, 01, 03, 01, 00, 02]
Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 25, 2b, 01, 21, 02, 02, 09, 00, 0f, 01, 00, 12, 00, 54, 05, 00, 54, 00, 55, 02, 02, 09, 02, 0b, 01, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 1
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 6
- Code(Counter(0)) at (prev + 38, 43) to (start + 1, 33)
- Code(Counter(0)) at (prev + 37, 43) to (start + 1, 33)
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 15)
= (c0 - c1)
- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 84)
@ -34,7 +34,7 @@ Number of file 0 mappings: 6
Highest counter ID seen: c1
Function name: closure_macro_async::test::{closure#0}::{closure#0}
Raw bytes (35): 0x[01, 01, 03, 01, 05, 0b, 0d, 05, 09, 05, 01, 15, 1c, 03, 21, 05, 04, 11, 01, 27, 02, 03, 11, 00, 16, 0d, 00, 17, 00, 1e, 07, 02, 09, 00, 0a]
Raw bytes (35): 0x[01, 01, 03, 01, 05, 0b, 0d, 05, 09, 05, 01, 14, 1c, 03, 21, 05, 04, 11, 01, 27, 02, 03, 11, 00, 16, 0d, 00, 17, 00, 1e, 07, 02, 09, 00, 0a]
Number of files: 1
- file 0 => global file 1
Number of expressions: 3
@ -42,7 +42,7 @@ Number of expressions: 3
- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(3)
- expression 2 operands: lhs = Counter(1), rhs = Counter(2)
Number of file 0 mappings: 5
- Code(Counter(0)) at (prev + 21, 28) to (start + 3, 33)
- Code(Counter(0)) at (prev + 20, 28) to (start + 3, 33)
- Code(Counter(1)) at (prev + 4, 17) to (start + 1, 39)
- Code(Expression(0, Sub)) at (prev + 3, 17) to (start + 0, 22)
= (c0 - c1)

View File

@ -1,5 +1,4 @@
LL| |#![feature(coverage_attribute)]
LL| |#![feature(noop_waker)]
LL| |//@ edition: 2018
LL| |
LL| |//@ aux-build: executor.rs

View File

@ -1,5 +1,4 @@
#![feature(coverage_attribute)]
#![feature(noop_waker)]
//@ edition: 2018
//@ aux-build: executor.rs

View File

@ -1,7 +1,7 @@
//@ known-bug: #124020
//@ compile-flags: -Zpolymorphize=on --edition=2018 --crate-type=lib
#![feature(async_closure, noop_waker, async_trait_bounds)]
#![feature(async_closure, async_trait_bounds)]
use std::future::Future;
use std::pin::pin;

View File

@ -1,7 +1,7 @@
//@ edition:2021
// skip-filecheck
#![feature(async_closure, noop_waker, async_fn_traits)]
#![feature(async_closure, async_fn_traits)]
#![allow(unused)]
use std::future::Future;

View File

@ -1,6 +1,6 @@
//@ edition: 2021
#![feature(async_closure, noop_waker)]
#![feature(async_closure)]
use std::future::Future;
use std::pin::pin;

View File

@ -6,7 +6,7 @@
// `mir_inliner_callees` for the synthetic by-move coroutine body since
// its def-id wasn't previously being considered.
#![feature(async_closure, noop_waker)]
#![feature(async_closure)]
use std::future::Future;
use std::pin::pin;

View File

@ -5,7 +5,7 @@
//@[v0] compile-flags: -Csymbol-mangling-version=v0
//@[legacy] compile-flags: -Csymbol-mangling-version=legacy -Zunstable-options
#![feature(async_closure, noop_waker)]
#![feature(async_closure)]
extern crate block_on;

View File

@ -5,7 +5,7 @@
// please consider modifying miri's async drop test at
// `src/tools/miri/tests/pass/async-drop.rs`.
#![feature(async_drop, impl_trait_in_assoc_type, noop_waker, async_closure)]
#![feature(async_drop, impl_trait_in_assoc_type, async_closure)]
#![allow(incomplete_features, dead_code)]
//@ edition: 2021

View File

@ -1,6 +1,6 @@
//@ edition: 2021
#![feature(async_closure, noop_waker)]
#![feature(async_closure)]
use std::future::Future;
use std::pin::pin;

View File

@ -1,5 +1,5 @@
//@ edition: 2021
#![feature(async_iterator, async_iter_from_iter, async_for_loop, noop_waker)]
#![feature(async_iterator, async_iter_from_iter, async_for_loop)]
use std::future::Future;

View File

@ -1,7 +1,6 @@
//@ run-pass
//@ edition: 2024
#![feature(async_iterator, async_iter_from_iter, async_for_loop, noop_waker,
gen_blocks)]
#![feature(async_iterator, async_iter_from_iter, async_for_loop, gen_blocks)]
async gen fn async_iter() -> i32 {
let iter = core::async_iter::from_iter(0..3);

View File

@ -1,6 +1,6 @@
//@ run-pass
//@ edition: 2021
#![feature(async_iterator, async_iter_from_iter, async_for_loop, noop_waker)]
#![feature(async_iterator, async_iter_from_iter, async_for_loop)]
use std::future::Future;

View File

@ -1,8 +1,6 @@
//@ run-pass
//@ edition:2021
#![feature(noop_waker)]
use std::future::Future;
trait AsyncTrait {

View File

@ -2,7 +2,6 @@
//@ known-bug: #108309
#![feature(min_specialization)]
#![feature(noop_waker)]
struct MyStruct;

View File

@ -1,11 +1,11 @@
error[E0053]: method `foo` has an incompatible type for trait
--> $DIR/dont-project-to-specializable-projection.rs:14:5
--> $DIR/dont-project-to-specializable-projection.rs:13:5
|
LL | default async fn foo(_: T) -> &'static str {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found future
|
note: type in trait
--> $DIR/dont-project-to-specializable-projection.rs:10:5
--> $DIR/dont-project-to-specializable-projection.rs:9:5
|
LL | async fn foo(_: T) -> &'static str;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ LL | async fn foo(_: T) -> &'static str;
found signature `fn(_) -> impl Future<Output = &'static str>`
error: async associated function in trait cannot be specialized
--> $DIR/dont-project-to-specializable-projection.rs:14:5
--> $DIR/dont-project-to-specializable-projection.rs:13:5
|
LL | default async fn foo(_: T) -> &'static str {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -21,7 +21,7 @@ LL | default async fn foo(_: T) -> &'static str {
= note: specialization behaves in inconsistent and surprising ways with async functions in traits, and for now is disallowed
error[E0599]: no method named `poll` found for struct `Pin<&mut impl Future<Output = ()>>` in the current scope
--> $DIR/dont-project-to-specializable-projection.rs:49:28
--> $DIR/dont-project-to-specializable-projection.rs:48:28
|
LL | match fut.as_mut().poll(ctx) {
| ^^^^ method not found in `Pin<&mut impl Future<Output = ()>>`

View File

@ -1,7 +1,7 @@
//@ compile-flags: --edition 2024
//@ check-pass
#![feature(async_iterator, gen_blocks, noop_waker)]
#![feature(async_iterator, gen_blocks)]
use std::{async_iter::AsyncIterator, pin::pin, task::{Context, Waker}};

View File

@ -2,7 +2,6 @@
//@ run-pass
#![feature(gen_blocks, async_iterator)]
#![feature(noop_waker)]
// make sure that a ridiculously simple async gen fn works as an iterator.

View File

@ -4,7 +4,6 @@
#![feature(dyn_star)]
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
#![feature(noop_waker)]
use std::future::Future;

View File

@ -1,7 +1,7 @@
//@ build-fail
//@ edition: 2021
#![feature(async_closure, noop_waker)]
#![feature(async_closure)]
use std::future::Future;
use std::pin::pin;

View File

@ -16,7 +16,6 @@
#![feature(coroutines, stmt_expr_attributes)]
#![feature(coroutine_trait)]
#![feature(noop_waker)]
#![feature(gen_blocks)]
#![feature(async_iterator)]