Skip to content
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

Custom DST #2

Open
wants to merge 27 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@kennytm
Copy link
Owner

kennytm commented Nov 11, 2018

Rendered


(This is a completed and trimmed down version of https://github.com/kennytm/rfcs/tree/dyn-type/text/0000-dyn-type excluding stuff already handled by rust-lang#2580 and rust-lang#2310, and removing all placement-new stuff.)

@kennytm kennytm force-pushed the dyn-type-8 branch from 274b1aa to 2e9c454 Nov 11, 2018

@kennytm kennytm force-pushed the dyn-type-8 branch from 2e9c454 to 99e4b29 Nov 11, 2018

@Centril
Copy link

Centril left a comment

Some typos mostly; (there are plenty left I think so you'll want to proof read this...)

Comments were made as I read them so you might have addressed some bits in later parts of the RFC, for example re. const fn.

Show resolved Hide resolved text/0000-dyn-type.md Outdated
Show resolved Hide resolved text/0000-dyn-type.md Outdated
Show resolved Hide resolved text/0000-dyn-type.md Outdated
Show resolved Hide resolved text/0000-dyn-type.md Outdated
Show resolved Hide resolved text/0000-dyn-type.md Outdated
Show resolved Hide resolved text/0000-dyn-type.md Outdated
Show resolved Hide resolved text/0000-dyn-type.md Outdated
Show resolved Hide resolved text/0000-dyn-type.md Outdated
Show resolved Hide resolved text/0000-dyn-type.md Outdated
The problem of generalizing `Metadata` is that it will plague every API it touches, e.g.

```rust
fn metadata<T: ?Sized, P: PointerFamily>(dst: P::Pointer<T>) -> T::Metadata<P>;

This comment has been minimized.

@Centril

Centril Nov 12, 2018

trait T<U: Align<2>> {
    type V: PartialEq<U> + Align<2>,
}

;)

This comment has been minimized.

@kennytm

kennytm Nov 12, 2018

Author Owner

🤔 having Align<2> could imply a type can simultaneously implement Align<1> + Align<2> + Align<4> + ...

This comment has been minimized.

@Centril

Centril Nov 12, 2018

Oooooops!

trait T<U: Align<Val = 2>> {
    type V: PartialEq<U> + Align<Val = 2>,
}

We already have associated consts so we can probably do it today.

Centril and others added some commits Nov 12, 2018

Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/media/dyn-type/mat-ref-repr.svg
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Update text/0000-dyn-type.md
Co-Authored-By: kennytm <kennytm@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.