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 {
354354 #[ must_use]
355355 #[ unstable( feature = "noop_waker" , issue = "98286" ) ]
356356 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.
357362 const VTABLE : RawWakerVTable = RawWakerVTable :: new (
358363 // Cloning just returns a new no-op raw waker
359364 |_| RAW ,
You can’t perform that action at this time.
0 commit comments