@@ -54,7 +54,7 @@ use syn::{parse_quote, Error, Result};
5454/// There are certain restrictions that apply to memoized functions. Most of
5555/// these are checked by comemo, but some are your responsibility:
5656/// - They must be **pure**, that is, **free of observable side effects**. This
57- /// is **your reponsibility ** as comemo can't check it.
57+ /// is **your responsibility ** as comemo can't check it.
5858/// - They must have an explicit return type.
5959/// - They cannot have mutable parameters (conflicts with purity).
6060/// - They cannot use destructuring patterns in their arguments.
@@ -68,7 +68,7 @@ pub fn memoize(_: BoundaryStream, stream: BoundaryStream) -> BoundaryStream {
6868
6969/// Make a type trackable.
7070///
71- /// Adding this to an impl block of a type `T`, implements the `Track` trait for
71+ /// Adding this to an impl block of a type `T` implements the `Track` trait for
7272/// `T`. This lets you call `.track()` on that type, producing a `Tracked<T>`.
7373/// When such a tracked type is used an argument to a memoized function it
7474/// enjoys fine-grained access tracking instead of being bluntly hashed.
@@ -102,8 +102,11 @@ pub fn memoize(_: BoundaryStream, stream: BoundaryStream) -> BoundaryStream {
102102/// methods. Just like with memoized functions, certain restrictions apply to
103103/// tracked methods:
104104/// - They must be **pure**, that is, **free of observable side effects**. This
105- /// is **your reponsibility ** as comemo can't check it. You can use interior
105+ /// is **your responsibility ** as comemo can't check it. You can use interior
106106/// mutability as long as the method stays idempotent.
107+ /// - Their **return values must implement `Hash`** and **must feed all the
108+ /// information they expose to the hasher**. Otherwise, memoized results might
109+ /// get reused invalidly.
107110/// - They cannot be generic.
108111/// - They can only be private or public not `pub(...)`.
109112/// - They cannot be `unsafe`, `async` or `const`.
0 commit comments