stabilize const_waker · patricklam/verify-rust-std@d6b6e63 (original) (raw)

`@@ -250,7 +250,7 @@ pub struct Context<'a> {

`

250

250

`impl<'a> Context<'a> {

`

251

251

`` /// Create a new Context from a &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

254

`#[must_use]

`

255

255

`#[inline]

`

256

256

`pub const fn from_waker(waker: &'a Waker) -> Self {

`

`@@ -261,23 +261,23 @@ impl<'a> Context<'a> {

`

261

261

`#[inline]

`

262

262

`#[must_use]

`

263

263

`#[stable(feature = "futures_api", since = "1.36.0")]

`

264

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

264

`+

#[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")]

`

265

265

`pub const fn waker(&self) -> &'a Waker {

`

266

266

`&self.waker

`

267

267

`}

`

268

268

``

269

269

`` /// Returns a reference to the [LocalWaker] for the current task.

``

270

270

`#[inline]

`

271

271

`#[unstable(feature = "local_waker", issue = "118959")]

`

272

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

272

`+

#[rustc_const_unstable(feature = "local_waker", issue = "118959")]

`

273

273

`pub const fn local_waker(&self) -> &'a LocalWaker {

`

274

274

`&self.local_waker

`

275

275

`}

`

276

276

``

277

277

`/// Returns a reference to the extension data for the current task.

`

278

278

`#[inline]

`

279

279

`#[unstable(feature = "context_ext", issue = "123392")]

`

280

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

280

`+

#[rustc_const_unstable(feature = "context_ext", issue = "123392")]

`

281

281

`pub const fn ext(&mut self) -> &mut dyn Any {

`

282

282

`// FIXME: this field makes Context extra-weird about unwind safety

`

283

283

`// can we justify AssertUnwindSafe if we stabilize this? do we care?

`

`@@ -336,8 +336,8 @@ pub struct ContextBuilder<'a> {

`

336

336

`impl<'a> ContextBuilder<'a> {

`

337

337

`/// Create a ContextBuilder from a Waker.

`

338

338

`#[inline]

`

339

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

340

339

`#[unstable(feature = "local_waker", issue = "118959")]

`

``

340

`+

#[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")]

`

341

341

`pub const fn from_waker(waker: &'a Waker) -> Self {

`

342

342

`// SAFETY: LocalWaker is just Waker without thread safety

`

343

343

`let local_waker = unsafe { transmute(waker) };

`

`@@ -352,8 +352,8 @@ impl<'a> ContextBuilder<'a> {

`

352

352

``

353

353

`/// Create a ContextBuilder from an existing Context.

`

354

354

`#[inline]

`

355

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

356

355

`#[unstable(feature = "context_ext", issue = "123392")]

`

``

356

`+

#[rustc_const_unstable(feature = "context_ext", issue = "123392")]

`

357

357

`pub const fn from(cx: &'a mut Context<'_>) -> Self {

`

358

358

`let ext = match &mut cx.ext.0 {

`

359

359

`ExtData::Some(ext) => ExtData::Some(*ext),

`

`@@ -371,31 +371,31 @@ impl<'a> ContextBuilder<'a> {

`

371

371

`` /// This method is used to set the value for the waker on Context.

``

372

372

`#[inline]

`

373

373

`#[unstable(feature = "context_ext", issue = "123392")]

`

374

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

374

`+

#[rustc_const_unstable(feature = "context_ext", issue = "123392")]

`

375

375

`pub const fn waker(self, waker: &'a Waker) -> Self {

`

376

376

`Self { waker, ..self }

`

377

377

`}

`

378

378

``

379

379

`` /// This method is used to set the value for the local waker on Context.

``

380

380

`#[inline]

`

381

381

`#[unstable(feature = "local_waker", issue = "118959")]

`

382

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

382

`+

#[rustc_const_unstable(feature = "local_waker", issue = "118959")]

`

383

383

`pub const fn local_waker(self, local_waker: &'a LocalWaker) -> Self {

`

384

384

`Self { local_waker, ..self }

`

385

385

`}

`

386

386

``

387

387

`` /// This method is used to set the value for the extension data on Context.

``

388

388

`#[inline]

`

389

389

`#[unstable(feature = "context_ext", issue = "123392")]

`

390

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

390

`+

#[rustc_const_unstable(feature = "context_ext", issue = "123392")]

`

391

391

`pub const fn ext(self, data: &'a mut dyn Any) -> Self {

`

392

392

`Self { ext: ExtData::Some(data), ..self }

`

393

393

`}

`

394

394

``

395

395

`` /// Builds the Context.

``

396

396

`#[inline]

`

397

397

`#[unstable(feature = "local_waker", issue = "118959")]

`

398

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

398

`+

#[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")]

`

399

399

`pub const fn build(self) -> Context<'a> {

`

400

400

`let ContextBuilder { waker, local_waker, ext, _marker, _marker2 } = self;

`

401

401

`Context { waker, local_waker, ext: AssertUnwindSafe(ext), _marker, _marker2 }

`

`@@ -521,7 +521,7 @@ impl Waker {

`

521

521

`#[inline]

`

522

522

`#[must_use]

`

523

523

`#[stable(feature = "futures_api", since = "1.36.0")]

`

524

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

524

`+

#[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")]

`

525

525

`pub const unsafe fn from_raw(waker: RawWaker) -> Waker {

`

526

526

`Waker { waker }

`

527

527

`}

`

`@@ -772,7 +772,7 @@ impl LocalWaker {

`

772

772

`#[inline]

`

773

773

`#[must_use]

`

774

774

`#[unstable(feature = "local_waker", issue = "118959")]

`

775

``

`-

#[rustc_const_unstable(feature = "const_waker", issue = "102012")]

`

``

775

`+

#[rustc_const_unstable(feature = "local_waker", issue = "118959")]

`

776

776

`pub const unsafe fn from_raw(waker: RawWaker) -> LocalWaker {

`

777

777

`Self { waker }

`

778

778

`}

`