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

Allow blocks in constants #71

Merged
merged 1 commit into from
May 13, 2014
Merged

Conversation

Kimundi
Copy link
Member

@Kimundi Kimundi commented May 6, 2014

No description provided.

function definition and a value, and would be usable in a static with this.

Another example would be to expose a static reference to a fixed memory address by
dereferencing a raw pointer in a const expr, which is useful in
Copy link
Member

Choose a reason for hiding this comment

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

I don't think dereferencing pointers is legal in blocks (although I guess one could just regard this as an extension).

Copy link
Member Author

Choose a reason for hiding this comment

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

See rust-lang/rust#13973 - if that's a bug that gets fixed by not allowing dereferences in a static then the example indeed becomes invalid.

@emberian
Copy link
Member

+1

@alexcrichton
Copy link
Member

We discussed this in today's meeting and decided to merge it.

@alexcrichton alexcrichton merged commit 9da3eb8 into rust-lang:master May 13, 2014
withoutboats pushed a commit to withoutboats/rfcs that referenced this pull request Jan 15, 2017
@Centril Centril added A-syntax Syntax related proposals & ideas A-machine Proposals relating to Rust's abstract machine. A-static Proposals relating to static items. labels Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-machine Proposals relating to Rust's abstract machine. A-static Proposals relating to static items. A-syntax Syntax related proposals & ideas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants