Skip to content

Custom DST#2

Open
kennytm wants to merge 27 commits into
masterfrom
dyn-type-8
Open

Custom DST#2
kennytm wants to merge 27 commits into
masterfrom
dyn-type-8

Conversation

@kennytm

@kennytm kennytm commented Nov 11, 2018

Copy link
Copy Markdown
Owner

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.)

@Centril Centril left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md Outdated
Comment thread text/0000-dyn-type.md
```rust ,ignore
trait X: Aligned
where
const(align_of::<Self>() == 2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

;)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 25 commits November 12, 2018 16:02
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: kennytm <kennytm@gmail.com>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants