Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

nrc
Copy link
Member

@nrc nrc commented Mar 16, 2015

Custom coercions allow smart pointers to fully participate in the DST system.
In particular, they allow practical use of Rc<T> and Arc<T> where T is unsized.

This RFC subsumes part of RFC 401 coercions.

Rendered

[edited to add rendered link]

@nrc nrc self-assigned this Mar 17, 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite know what "simple substitution of type parameters" means... but I think we want to check that both of them are applications of the same base type constructor. e.g. Foo<X> and Foo<Y> are ok, but not Foo<X> and Bar<Y>.

Copy link
Member Author

Choose a reason for hiding this comment

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

I meant that there exists some Ts (where Ts = a sequence of T) and some Xs such that Target = [Ts/Xs]Self and Self is not in Xs. Which I think subsumes your requirement, but also precludes some pathalogical cases such as Target = Foo<T1, T2>, Self = Foo<X, X>.

@nikomatsakis
Copy link
Contributor

I read over the revised version -- it seems pretty good to me, I left a few comments.

Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to be implementing CoerceUnsized<NonZero<U>>?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@nrc nrc added the T-lang Relevant to the language team, which will review and decide on the RFC. label May 15, 2015
@nikomatsakis
Copy link
Contributor

@nrc did you plan to incorporate @eddyb's feedback here?

@nrc
Copy link
Member Author

nrc commented May 21, 2015

I do, I had forgotten this was not merged yet.

@nikomatsakis
Copy link
Contributor

Hear ye, hear ye. This RFC is now in final comment period until June 2nd.

@nikomatsakis nikomatsakis added the final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. label May 26, 2015
@nikomatsakis
Copy link
Contributor

This RFC has been accepted. It is not yet merged to allow @nrc to incorporate final comments reflecting the current design. (It has been partially implemented in the meantime.)

-- Language design subteam

Nick Cameron added 5 commits June 3, 2015 15:44
Custom coercions allow smart pointers to fully participate in the DST system.
In particular, they allow practical use of `Rc<T>` and `Arc<T>` where `T` is unsized.

This RFC subsumes part of [RFC 401 coercions](https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md).
@nrc nrc force-pushed the dst-coercions branch from 433245c to 4b99006 Compare June 3, 2015 05:05
@nrc
Copy link
Member Author

nrc commented Jun 3, 2015

@nikomatsakis updated

@nikomatsakis nikomatsakis merged commit 4b99006 into rust-lang:master Jun 3, 2015
nikomatsakis added a commit that referenced this pull request Jun 3, 2015
@nikomatsakis
Copy link
Contributor

Merged. Tracking issue is rust-lang/rust#18598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-coercions Proposals relating to coercions. A-dst Proposals re. DSTs final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. T-lang Relevant to the language team, which will review and decide on the RFC.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.