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

Include details about reading extern static mut in the FFI tutorial. #9980

Closed
nejucomo opened this issue Oct 20, 2013 · 3 comments · Fixed by #22295
Closed

Include details about reading extern static mut in the FFI tutorial. #9980

nejucomo opened this issue Oct 20, 2013 · 3 comments · Fixed by #22295

Comments

@nejucomo
Copy link

The FFI tutorial section 8 Accessing foreign globals describes writing an extern static mut, but it would be helpful to mention that reading is also unsafe.

The code example has two writes and no reads, so perhaps if the example is also updated with a read it may save some readers some trouble.

@pnkfelix
Copy link
Member

part of #11755

@steveklabnik
Copy link
Member

Is static mut even a thing anymore?

@alexcrichton
Copy link
Member

It is indeed. You can interface with foreign globals in C via a static mut.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 13, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 14, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 15, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue Feb 15, 2015
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 1, 2022
Don't lint `unnecessary_cast` in mixed macro context

fixes rust-lang#9960

Time to start making a dent in this onslaught.

changelog: `unnecessary_cast`: Don't lint when the identifiers context differs from its binding's context for locals
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.

4 participants