New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename symbols for increased clarity #815
Conversation
tryBuild failed: |
Main controversy is probably "Ownership" is a more common term than "thread access" and makes the concept of sharing On the other hand this term doesn't have "Thread" in the name, so thread-related ownership might not be the first association. There are also multiple options to deal with generic type parameters vs. policy name: // so far:
struct MyStruct<Access: ThreadAccess> {}
trait MyTrait { type RefKind: RefKind; } // reuse same name
// possible:
struct MyStruct<Ows: Ownership> {} // often-used type parameter short, makes some code more concise
trait MyTrait { type Mem: Memory } // or:
trait MyTrait { type Memory: Memory }
// or:
struct MyStruct<Ownership: OwnershipPolicy> {} // appears in docs as MyStruct<Ownership>
trait MyTrait { type Memory: MemoryPolicy } // or:
trait MyTrait { type Memory: Memory } Especially since pub fn try_from_base(owner: Ref<T::Base, Ows>) -> Result<Self, Ref<T::Base, Ows>>;
pub fn try_from_base(owner: Ref<T::Base, Ownership>) -> Result<Self, Ref<T::Base, Ownership>>; But I agree it first looks weird because |
tryBuild succeeded: |
I believe there is a convention in general to shorten type parameters, but keep the full trait name for associated types, so I'd prefer |
Also change Memory type-tags to enums (non-inhabitable types, no need for derive)
Thanks for the feedback! Changed:
I'll merge the current state of things to unblock other changes. The rest can be done in a separate PR. bors r+ |
Build succeeded: |
Addressing the first few of the pending renames in #773.
Changes are separated by commits.
bors try