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

The reference is wrong about constants referencing statics since v1.83.0 #1690

Closed
HeCorr opened this issue Dec 1, 2024 · 2 comments · Fixed by #1610
Closed

The reference is wrong about constants referencing statics since v1.83.0 #1690

HeCorr opened this issue Dec 1, 2024 · 2 comments · Fixed by #1610

Comments

@HeCorr
Copy link

HeCorr commented Dec 1, 2024

Hello! I've noticed that the Rust 1.83.0 announcement mentions that it is now possible to reference static items in const contexts:

static S: i32 = 25;
const C: &i32 = &S;

But the Rust Reference still says it is not:

All access to a static is safe, but there are a number of restrictions on statics:

  • The type must have the Sync trait bound to allow thread-safe access.
  • Constants cannot refer to statics.

I am willing to write a PR for this but I am not sure what the best course of action is. Simply removing that bullet-point would mean having to rephrase the text above it, but I don't know what would sound best (also, a single bullet-point may look weird).

What should I do?

@chorman0773
Copy link
Contributor

chorman0773 commented Dec 1, 2024

#1610 already addresses it, but there are problems that are being fixed on it.

@HeCorr
Copy link
Author

HeCorr commented Dec 1, 2024

Oops, my bad. instead of searching for existing issues/PRs I merely checked the date of the most recent ones since the update announcement was published and found none. I should have looked further. I apologize.

You may close this if you want.

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 a pull request may close this issue.

2 participants