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

Modify RFC #803 (type ascription) to make type ascription expressions lvalues #987

Merged
merged 3 commits into from
Jun 10, 2015

Conversation

nrc
Copy link
Member

@nrc nrc commented Mar 18, 2015

No description provided.

@nrc
Copy link
Member Author

nrc commented Mar 18, 2015

cc @eddyb @nikomatsakis

@huonw
Copy link
Member

huonw commented Mar 18, 2015

The history seems strange?

@nrc
Copy link
Member Author

nrc commented Mar 18, 2015

Yeah, I screwed the history up some how, I'll try to fix it at some point

@nrc nrc self-assigned this Mar 18, 2015
@nrc
Copy link
Member Author

nrc commented Mar 23, 2015

Fixed the history and addressed @pnkfelix's comment

@Ericson2314
Copy link
Contributor

+1 definitely an improvement. Would be nice if for the assignment case (<expr> = ...;), casting to a subtype was eventually supported.

@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

Hear ye, hear ye. This RFC is entering the final comment period.

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

huonw commented Jun 3, 2015

Just to clarify, this would allow writing the following?

let x;
x: i32 = 10;

The proposed solution is that type ascription expressions are lvalues. If the
type ascription expression is in reference context, then we require the ascribed
type to exactly match the type of the expression, i.e., neither subtyping nor
coercion is allowed. These reference contexts are as follows (where <expr> is a
Copy link
Contributor

Choose a reason for hiding this comment

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

This <expr> renders funny. You should add verbatim quotes.

@nrc
Copy link
Member Author

nrc commented Jun 10, 2015

@huonw yes.

@nrc
Copy link
Member Author

nrc commented Jun 10, 2015

@nikomatsakis updated the text

@nikomatsakis
Copy link
Contributor

It's official... the language subteam has decided to accept this RFC.

@nikomatsakis nikomatsakis merged commit d69cf92 into rust-lang:master Jun 10, 2015
@Centril Centril added A-expressions Term language related proposals & ideas A-ascription Type ascription related proposals & ideas A-machine Proposals relating to Rust's abstract machine. A-typesystem Type system related proposals & ideas labels Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ascription Type ascription related proposals & ideas A-expressions Term language related proposals & ideas A-machine Proposals relating to Rust's abstract machine. A-typesystem Type system related proposals & ideas 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.

5 participants