Skip to content

Latest commit

 

History

History
98 lines (73 loc) · 2.88 KB

CHANGELOG.md

File metadata and controls

98 lines (73 loc) · 2.88 KB

Changelog

v0.4.0

  • Breaking changes:

    • BoxScope::new now accepts a Scope object that is unsafe to construct directly. Safe use of nolife now requires using the scope!({}) macro. This is to fix a soundness issue that can occur when a FrozenFuture is polled directly, without giving back control to nolife's executor. The macros ensure that a frozen future is always immediately awaited. To update your usages, replace:
    let scope = BoxScope::new(|time_capsule| async { time_capsule.freeze_forever(&mut some_ref()).await });

    with:

    let scope = BoxScope::new(scope!({ freeze_forever!(&mut some_ref()) }));

    Check the documentation of the scope! macro for details.

    • The lifetime of the Family type passed to the closure in BoxScope::enter changed to fix a soundness issue.
    • Removed DynBoxScope, use BoxScope::new_dyn instead.
  • Improvement: dynamic scope no longer boxes the future, as it is already behind a level of indirection in a BoxScope.

Thanks to @steffahn for opening the above issues and helping fix them ❤️

v0.3.3

  • Fix documentation links
  • Add a beautifully handcrafted icon

v0.3.2

  • Add TimeCapsule::freeze_forever as a convenience method
  • Add DynBoxScope::pin as a convenience method.

v0.3.1

  • Add DynBoxScope type for common case of erased future

v0.3.0

  • Breaking changes:

    • Tightened BoxScope::enter signature so that the frozen reference cannot escape, fixing a soundness issue. Replace:
    let frozen_ref = scope.enter(identity);
    use_frozen_ref(frozen_ref, refs_from_environment);

    with:

    scope.enter(|frozen_ref| use_frozen_ref(frozen_ref, refs_from_environment));

    Note that BoxScope::enter signature was adjusted to allow passing references from the environment to its closure argument. If your code specifically relied on storing the escaped reference, it cannot be ported to the new version. However, it was likely unsound.

    • Removed StackScopes, hid Scope and SingleFamily.
    • Removed closed scopes again 🤡. Replace:
    let scope = WhateverScope::new();
    let mut scope = scope.open(producer);
    scope.enter(consumer);

    with:

    let mut scope = WhateverScope::new(producer);
    scope.enter(consumer);

v0.2.0

  • Breaking change: separated closed and opened scope. Replace:
let mut scope = WhateverScope::new(...);
scope.open(...);
scope.enter(...);

with:

let scope = WhateverScope::new(...); // removed the mut
let mut scope = scope.open(...); // re-assign the scope
scope.enter(...); // unchanged
  • Fix a panic that would occur when dropping an unopened scope.

v0.1.0

  • Initial version