Skip to content

Commit 257e871

Browse files
committed
botched attribute macros earlier, fixed now
1 parent a21854f commit 257e871

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

library/core/src/task/wake.rs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![stable(feature = "futures_api", since = "1.36.0")]
1+
#![stable(feature = "futures_api", since = "1.36.0")]
22

33
use core::fmt;
44
use core::marker::{PhantomData, Unpin};
@@ -11,7 +11,7 @@ use core::marker::{PhantomData, Unpin};
1111
/// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable]
1212
/// that customizes the behavior of the `RawWaker`.
1313
#[derive(PartialEq, Debug)]
14-
[stable(feature = "futures_api", since = "1.36.0")]
14+
#[stable(feature = "futures_api", since = "1.36.0")]
1515
#[repr(C)]
1616
pub struct RawWaker {
1717
/// A data pointer, which can be used to store arbitrary data as required
@@ -37,9 +37,9 @@ impl RawWaker {
3737
/// from a `RawWaker`. For each operation on the `Waker`, the associated
3838
/// function in the `vtable` of the underlying `RawWaker` will be called.
3939
#[inline]
40-
[rustc_promotable]
41-
[stable(feature = "futures_api", since = "1.36.0")]
42-
[rustc_const_stable(feature = "futures_api", since = "1.36.0")]
40+
#[rustc_promotable]
41+
#[stable(feature = "futures_api", since = "1.36.0")]
42+
#[rustc_const_stable(feature = "futures_api", since = "1.36.0")]
4343
#[must_use]
4444
pub const fn new(data: *const (), vtable: &'static RawWakerVTable) -> RawWaker {
4545
RawWaker { data, vtable }
@@ -48,15 +48,15 @@ impl RawWaker {
4848
/// Get the `data` pointer used to create this `RawWaker`.
4949
#[inline]
5050
#[must_use]
51-
[unstable(feature = "waker_getters", issue = "87021")]
51+
#[unstable(feature = "waker_getters", issue = "87021")]
5252
pub fn data(&self) -> *const () {
5353
self.data
5454
}
5555

5656
/// Get the `vtable` pointer used to create this `RawWaker`.
5757
#[inline]
5858
#[must_use]
59-
[unstable(feature = "waker_getters", issue = "87021")]
59+
#[unstable(feature = "waker_getters", issue = "87021")]
6060
pub fn vtable(&self) -> &'static RawWakerVTable {
6161
self.vtable
6262
}
@@ -80,7 +80,7 @@ const RAW_WAKER_VTABLE_V1_PADDING: usize = 0;
8080
/// because [`Waker`] is <code>[Send] + [Sync]</code>, and thus wakers may be moved to
8181
/// arbitrary threads or invoked by `&` reference. For example, this means that if the
8282
/// `clone` and `drop` functions manage a reference count, they must do so atomically.
83-
[stable(feature = "futures_api", since = "1.36.0")]
83+
#[stable(feature = "futures_api", since = "1.36.0")]
8484
#[derive(PartialEq, Copy, Clone, Debug)]
8585
#[repr(C)]
8686
struct RawWakerVTableV1 {
@@ -192,7 +192,7 @@ impl RawWakerVTable {
192192
/// arbitrary threads or invoked by `&` reference. For example, this means that if the
193193
/// `clone` and `drop` functions manage a reference count, they must do so atomically.
194194
///
195-
/ `clone`
195+
/# `clone`
196196
///
197197
/// This function will be called when the [`RawWaker`] gets cloned, e.g. when
198198
/// the [`Waker`] in which the [`RawWaker`] is stored gets cloned.
@@ -202,7 +202,7 @@ impl RawWakerVTable {
202202
/// task. Calling `wake` on the resulting [`RawWaker`] should result in a wakeup
203203
/// of the same task that would have been awoken by the original [`RawWaker`].
204204
///
205-
/ `wake`
205+
/# `wake`
206206
///
207207
/// This function will be called when `wake` is called on the [`Waker`].
208208
/// It must wake up the task associated with this [`RawWaker`].
@@ -211,24 +211,24 @@ impl RawWakerVTable {
211211
/// resources that are associated with this instance of a [`RawWaker`] and
212212
/// associated task.
213213
///
214-
/ `wake_by_ref`
214+
/# `wake_by_ref`
215215
///
216216
/// This function will be called when `wake_by_ref` is called on the [`Waker`].
217217
/// It must wake up the task associated with this [`RawWaker`].
218218
///
219219
/// This function is similar to `wake`, but must not consume the provided data
220220
/// pointer.
221221
///
222-
/ `drop`
222+
/# `drop`
223223
///
224224
/// This function gets called when a [`Waker`] gets dropped.
225225
///
226226
/// The implementation of this function must make sure to release any
227227
/// resources that are associated with this instance of a [`RawWaker`] and
228228
/// associated task.
229-
[rustc_promotable]
230-
[stable(feature = "futures_api", since = "1.36.0")]
231-
[rustc_const_stable(feature = "futures_api", since = "1.36.0")]
229+
#[rustc_promotable]
230+
#[stable(feature = "futures_api", since = "1.36.0")]
231+
#[rustc_const_stable(feature = "futures_api", since = "1.36.0")]
232232
#[deprecated = "This constructor makes slower wakers, use new_with_c_abi instead"]
233233
pub const fn new(
234234
clone: unsafe fn(*const ()) -> RawWaker,
@@ -267,7 +267,7 @@ impl RawWakerVTable {
267267
/// arbitrary threads or invoked by `&` reference. For example, this means that if the
268268
/// `clone` and `drop` functions manage a reference count, they must do so atomically.
269269
///
270-
/ `clone`
270+
/# `clone`
271271
///
272272
/// This function will be called when the [`RawWaker`] gets cloned, e.g. when
273273
/// the [`Waker`] in which the [`RawWaker`] is stored gets cloned.
@@ -277,7 +277,7 @@ impl RawWakerVTable {
277277
/// task. Calling `wake` on the resulting [`RawWaker`] should result in a wakeup
278278
/// of the same task that would have been awoken by the original [`RawWaker`].
279279
///
280-
/ `wake`
280+
/# `wake`
281281
///
282282
/// This function will be called when `wake` is called on the [`Waker`].
283283
/// It must wake up the task associated with this [`RawWaker`].
@@ -286,22 +286,22 @@ impl RawWakerVTable {
286286
/// resources that are associated with this instance of a [`RawWaker`] and
287287
/// associated task.
288288
///
289-
/ `wake_by_ref`
289+
/# `wake_by_ref`
290290
///
291291
/// This function will be called when `wake_by_ref` is called on the [`Waker`].
292292
/// It must wake up the task associated with this [`RawWaker`].
293293
///
294294
/// This function is similar to `wake`, but must not consume the provided data
295295
/// pointer.
296296
///
297-
/ `drop`
297+
/# `drop`
298298
///
299299
/// This function gets called when a [`Waker`] gets dropped.
300300
///
301301
/// The implementation of this function must make sure to release any
302302
/// resources that are associated with this instance of a [`RawWaker`] and
303303
/// associated task.
304-
[rustc_promotable]
304+
#[rustc_promotable]
305305
pub const fn new_with_c_abi(
306306
clone: unsafe extern "C" fn(*const ()) -> RawWaker,
307307
wake: unsafe extern "C" fn(*const ()),
@@ -324,8 +324,8 @@ impl RawWakerVTable {
324324
///
325325
/// Currently, `Context` only serves to provide access to a [`&Waker`](Waker)
326326
/// which can be used to wake the current task.
327-
[stable(feature = "futures_api", since = "1.36.0")]
328-
[lang = "Context"]
327+
#[stable(feature = "futures_api", since = "1.36.0")]
328+
#[lang = "Context"]
329329
pub struct Context<'a> {
330330
waker: &'a Waker,
331331
// Ensure we future-proof against variance changes by forcing
@@ -340,8 +340,8 @@ pub struct Context<'a> {
340340

341341
impl<'a> Context<'a> {
342342
/// Create a new `Context` from a [`&Waker`](Waker).
343-
[stable(feature = "futures_api", since = "1.36.0")]
344-
[rustc_const_unstable(feature = "const_waker", issue = "102012")]
343+
#[stable(feature = "futures_api", since = "1.36.0")]
344+
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
345345
#[must_use]
346346
#[inline]
347347
pub const fn from_waker(waker: &'a Waker) -> Self {
@@ -353,16 +353,16 @@ impl<'a> Context<'a> {
353353
}
354354

355355
/// Returns a reference to the [`Waker`] for the current task.
356-
[stable(feature = "futures_api", since = "1.36.0")]
357-
[rustc_const_unstable(feature = "const_waker", issue = "102012")]
356+
#[stable(feature = "futures_api", since = "1.36.0")]
357+
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
358358
#[must_use]
359359
#[inline]
360360
pub const fn waker(&self) -> &'a Waker {
361361
self.waker
362362
}
363363
}
364364

365-
[stable(feature = "futures_api", since = "1.36.0")]
365+
#[stable(feature = "futures_api", since = "1.36.0")]
366366
impl fmt::Debug for Context<'_> {
367367
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
368368
f.debug_struct("Context")
@@ -390,16 +390,16 @@ impl fmt::Debug for Context<'_> {
390390
/// [`Future::poll()`]: core::future::Future::poll
391391
/// [`Poll::Pending`]: core::task::Poll::Pending
392392
#[repr(transparent)]
393-
[stable(feature = "futures_api", since = "1.36.0")]
393+
#[stable(feature = "futures_api", since = "1.36.0")]
394394
pub struct Waker {
395395
waker: RawWaker,
396396
}
397397

398-
[stable(feature = "futures_api", since = "1.36.0")]
398+
#[stable(feature = "futures_api", since = "1.36.0")]
399399
impl Unpin for Waker {}
400-
[stable(feature = "futures_api", since = "1.36.0")]
400+
#[stable(feature = "futures_api", since = "1.36.0")]
401401
unsafe impl Send for Waker {}
402-
[stable(feature = "futures_api", since = "1.36.0")]
402+
#[stable(feature = "futures_api", since = "1.36.0")]
403403
unsafe impl Sync for Waker {}
404404

405405
impl Waker {
@@ -421,7 +421,7 @@ impl Waker {
421421
///
422422
/// [`poll()`]: core::future::Future::poll
423423
#[inline]
424-
[stable(feature = "futures_api", since = "1.36.0")]
424+
#[stable(feature = "futures_api", since = "1.36.0")]
425425
pub fn wake(self) {
426426
// The actual wakeup call is delegated through a virtual function call
427427
// to the implementation which is defined by the executor.
@@ -457,7 +457,7 @@ impl Waker {
457457
/// the case where an owned `Waker` is available. This method should be preferred to
458458
/// calling `waker.clone().wake()`.
459459
#[inline]
460-
[stable(feature = "futures_api", since = "1.36.0")]
460+
#[stable(feature = "futures_api", since = "1.36.0")]
461461
pub fn wake_by_ref(&self) {
462462
// The actual wakeup call is delegated through a virtual function call
463463
// to the implementation which is defined by the executor.
@@ -490,7 +490,7 @@ impl Waker {
490490
/// This function is primarily used for optimization purposes.
491491
#[inline]
492492
#[must_use]
493-
[stable(feature = "futures_api", since = "1.36.0")]
493+
#[stable(feature = "futures_api", since = "1.36.0")]
494494
pub fn will_wake(&self, other: &Waker) -> bool {
495495
self.waker == other.waker
496496
}
@@ -502,22 +502,22 @@ impl Waker {
502502
/// Therefore this method is unsafe.
503503
#[inline]
504504
#[must_use]
505-
[stable(feature = "futures_api", since = "1.36.0")]
506-
[rustc_const_unstable(feature = "const_waker", issue = "102012")]
505+
#[stable(feature = "futures_api", since = "1.36.0")]
506+
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
507507
pub const unsafe fn from_raw(waker: RawWaker) -> Waker {
508508
Waker { waker }
509509
}
510510

511511
/// Get a reference to the underlying [`RawWaker`].
512512
#[inline]
513513
#[must_use]
514-
[unstable(feature = "waker_getters", issue = "87021")]
514+
#[unstable(feature = "waker_getters", issue = "87021")]
515515
pub fn as_raw(&self) -> &RawWaker {
516516
&self.waker
517517
}
518518
}
519519

520-
[stable(feature = "futures_api", since = "1.36.0")]
520+
#[stable(feature = "futures_api", since = "1.36.0")]
521521
impl Clone for Waker {
522522
#[inline]
523523
fn clone(&self) -> Self {
@@ -545,7 +545,7 @@ impl Clone for Waker {
545545
}
546546
}
547547

548-
[stable(feature = "futures_api", since = "1.36.0")]
548+
#[stable(feature = "futures_api", since = "1.36.0")]
549549
impl Drop for Waker {
550550
#[inline]
551551
fn drop(&mut self) {
@@ -571,7 +571,7 @@ impl Drop for Waker {
571571
}
572572
}
573573

574-
[stable(feature = "futures_api", since = "1.36.0")]
574+
#[stable(feature = "futures_api", since = "1.36.0")]
575575
impl fmt::Debug for Waker {
576576
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
577577
let vtable_ptr = self.waker.vtable as *const RawWakerVTable;

0 commit comments

Comments
 (0)