@@ -250,7 +250,8 @@ pub struct Context<'a> {
250
250
impl < ' a > Context < ' a > {
251
251
/// Create a new `Context` from a [`&Waker`](Waker).
252
252
#[ stable( feature = "futures_api" , since = "1.36.0" ) ]
253
- #[ rustc_const_unstable( feature = "const_waker" , issue = "102012" ) ]
253
+ #[ rustc_const_stable( feature = "const_waker" , since = "CURRENT_RUSTC_VERSION" ) ]
254
+ #[ rustc_allow_const_fn_unstable( local_waker) ]
254
255
#[ must_use]
255
256
#[ inline]
256
257
pub const fn from_waker ( waker : & ' a Waker ) -> Self {
@@ -261,23 +262,23 @@ impl<'a> Context<'a> {
261
262
#[ inline]
262
263
#[ must_use]
263
264
#[ stable( feature = "futures_api" , since = "1.36.0" ) ]
264
- #[ rustc_const_unstable ( feature = "const_waker" , issue = "102012 " ) ]
265
+ #[ rustc_const_stable ( feature = "const_waker" , since = "CURRENT_RUSTC_VERSION " ) ]
265
266
pub const fn waker ( & self ) -> & ' a Waker {
266
267
& self . waker
267
268
}
268
269
269
270
/// Returns a reference to the [`LocalWaker`] for the current task.
270
271
#[ inline]
271
272
#[ unstable( feature = "local_waker" , issue = "118959" ) ]
272
- #[ rustc_const_unstable( feature = "const_waker " , issue = "102012 " ) ]
273
+ #[ rustc_const_unstable( feature = "local_waker " , issue = "118959 " ) ]
273
274
pub const fn local_waker ( & self ) -> & ' a LocalWaker {
274
275
& self . local_waker
275
276
}
276
277
277
278
/// Returns a reference to the extension data for the current task.
278
279
#[ inline]
279
280
#[ unstable( feature = "context_ext" , issue = "123392" ) ]
280
- #[ rustc_const_unstable( feature = "const_waker " , issue = "102012 " ) ]
281
+ #[ rustc_const_unstable( feature = "context_ext " , issue = "123392 " ) ]
281
282
pub const fn ext ( & mut self ) -> & mut dyn Any {
282
283
// FIXME: this field makes Context extra-weird about unwind safety
283
284
// can we justify AssertUnwindSafe if we stabilize this? do we care?
@@ -336,8 +337,8 @@ pub struct ContextBuilder<'a> {
336
337
impl < ' a > ContextBuilder < ' a > {
337
338
/// Create a ContextBuilder from a Waker.
338
339
#[ inline]
339
- #[ rustc_const_unstable( feature = "const_waker" , issue = "102012" ) ]
340
340
#[ unstable( feature = "local_waker" , issue = "118959" ) ]
341
+ #[ rustc_const_unstable( feature = "local_waker" , issue = "118959" ) ]
341
342
pub const fn from_waker ( waker : & ' a Waker ) -> Self {
342
343
// SAFETY: LocalWaker is just Waker without thread safety
343
344
let local_waker = unsafe { transmute ( waker) } ;
@@ -352,8 +353,8 @@ impl<'a> ContextBuilder<'a> {
352
353
353
354
/// Create a ContextBuilder from an existing Context.
354
355
#[ inline]
355
- #[ rustc_const_unstable( feature = "const_waker" , issue = "102012" ) ]
356
356
#[ unstable( feature = "context_ext" , issue = "123392" ) ]
357
+ #[ rustc_const_unstable( feature = "context_ext" , issue = "123392" ) ]
357
358
pub const fn from ( cx : & ' a mut Context < ' _ > ) -> Self {
358
359
let ext = match & mut cx. ext . 0 {
359
360
ExtData :: Some ( ext) => ExtData :: Some ( * ext) ,
@@ -371,31 +372,31 @@ impl<'a> ContextBuilder<'a> {
371
372
/// This method is used to set the value for the waker on `Context`.
372
373
#[ inline]
373
374
#[ unstable( feature = "context_ext" , issue = "123392" ) ]
374
- #[ rustc_const_unstable( feature = "const_waker " , issue = "102012 " ) ]
375
+ #[ rustc_const_unstable( feature = "context_ext " , issue = "123392 " ) ]
375
376
pub const fn waker ( self , waker : & ' a Waker ) -> Self {
376
377
Self { waker, ..self }
377
378
}
378
379
379
380
/// This method is used to set the value for the local waker on `Context`.
380
381
#[ inline]
381
382
#[ unstable( feature = "local_waker" , issue = "118959" ) ]
382
- #[ rustc_const_unstable( feature = "const_waker " , issue = "102012 " ) ]
383
+ #[ rustc_const_unstable( feature = "local_waker " , issue = "118959 " ) ]
383
384
pub const fn local_waker ( self , local_waker : & ' a LocalWaker ) -> Self {
384
385
Self { local_waker, ..self }
385
386
}
386
387
387
388
/// This method is used to set the value for the extension data on `Context`.
388
389
#[ inline]
389
390
#[ unstable( feature = "context_ext" , issue = "123392" ) ]
390
- #[ rustc_const_unstable( feature = "const_waker " , issue = "102012 " ) ]
391
+ #[ rustc_const_unstable( feature = "context_ext " , issue = "123392 " ) ]
391
392
pub const fn ext ( self , data : & ' a mut dyn Any ) -> Self {
392
393
Self { ext : ExtData :: Some ( data) , ..self }
393
394
}
394
395
395
396
/// Builds the `Context`.
396
397
#[ inline]
397
398
#[ unstable( feature = "local_waker" , issue = "118959" ) ]
398
- #[ rustc_const_unstable( feature = "const_waker " , issue = "102012 " ) ]
399
+ #[ rustc_const_unstable( feature = "local_waker " , issue = "118959 " ) ]
399
400
pub const fn build ( self ) -> Context < ' a > {
400
401
let ContextBuilder { waker, local_waker, ext, _marker, _marker2 } = self ;
401
402
Context { waker, local_waker, ext : AssertUnwindSafe ( ext) , _marker, _marker2 }
@@ -521,7 +522,7 @@ impl Waker {
521
522
#[ inline]
522
523
#[ must_use]
523
524
#[ stable( feature = "futures_api" , since = "1.36.0" ) ]
524
- #[ rustc_const_unstable ( feature = "const_waker" , issue = "102012 " ) ]
525
+ #[ rustc_const_stable ( feature = "const_waker" , since = "CURRENT_RUSTC_VERSION " ) ]
525
526
pub const unsafe fn from_raw ( waker : RawWaker ) -> Waker {
526
527
Waker { waker }
527
528
}
@@ -772,7 +773,7 @@ impl LocalWaker {
772
773
#[ inline]
773
774
#[ must_use]
774
775
#[ unstable( feature = "local_waker" , issue = "118959" ) ]
775
- #[ rustc_const_unstable( feature = "const_waker " , issue = "102012 " ) ]
776
+ #[ rustc_const_unstable( feature = "local_waker " , issue = "118959 " ) ]
776
777
pub const unsafe fn from_raw ( waker : RawWaker ) -> LocalWaker {
777
778
Self { waker }
778
779
}
0 commit comments