File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,11 @@ impl Waker {
354
354
#[ must_use]
355
355
#[ unstable( feature = "noop_waker" , issue = "98286" ) ]
356
356
pub const fn noop ( ) -> & ' static Waker {
357
+ // Ideally all this data would be explicitly `static` because it is used by reference and
358
+ // only ever needs one copy. But `const fn`s (and `const` items) cannot refer to statics,
359
+ // even though their values can be promoted to static. (That might change; see #119618.)
360
+ // An alternative would be a `pub static NOOP: &Waker`, but associated static items are not
361
+ // currently allowed either, and making it non-associated would be unergonomic.
357
362
const VTABLE : RawWakerVTable = RawWakerVTable :: new (
358
363
// Cloning just returns a new no-op raw waker
359
364
|_| RAW ,
You can’t perform that action at this time.
0 commit comments