Skip to content

Statics may sometimes inline. #323

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

Merged
merged 1 commit into from
May 3, 2018
Merged

Statics may sometimes inline. #323

merged 1 commit into from
May 3, 2018

Conversation

Havvy
Copy link
Contributor

@Havvy Havvy commented May 1, 2018

Removed inlining guarantees as they are false e.g. in the case of using a non-mutable static integer. Added "Non-mut" to the statement about read-only memory. Removed the parenthesis about binding C statics. Added a link to destructors where it says "drop".

@Havvy Havvy requested a review from alercah May 1, 2018 00:22
Static items may be placed in read-only memory if the type is not [interior
mutable]. Static items do not call `drop` at the end of the program.
memory location in the program. All references to the static refer to the same
memory location. Static items have the `static` lifetime, which outlives all
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be 'static lifetime instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'static is the static lifetime. I think both could work there.

@@ -6,18 +6,17 @@
> `=` [_Expression_] `;`

A *static item* is similar to a [constant], except that it represents a precise
Copy link
Contributor

Choose a reason for hiding this comment

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

This paragraph is just a list of properties, which makes me feel like it does not flow very well. I'm not sure the best way to address that; perhaps splitting the things about lifetimes into a separate paragraph would help, or adding more connective prose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It definitely doesn't flow well. It reads almost like a list but without the bullet points. Should probably be addressed, but not as part of this issue.

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