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

docs: begin a "low-level & unsafe code" guide. #12887

Merged
merged 1 commit into from
Mar 15, 2014

Conversation

huonw
Copy link
Member

@huonw huonw commented Mar 14, 2014

docs: begin a "low-level & unsafe code" guide.

This aims to cover the basics of writing safe unsafe code. At the moment
it is just designed to be a better place for the asm!() docs than the
detailed release notes wiki page, and I took the time to write up some
other things.

More examples are needed, especially of things that can subtly go wrong;
and vast areas of unsafe-ty aren't covered, e.g. static muts and
thread-safety in general.

@huonw
Copy link
Member Author

huonw commented Mar 14, 2014

}
c
}
# fn main() {}
Copy link
Member

Choose a reason for hiding this comment

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

Could this show some example usage with an assert! that it's correct?

@alexcrichton
Copy link
Member

This is pretty awesome, nice job!

Any use of `asm` is feature gated (requires `#[feature(asm)];` on the
crate to allow) and of course requires an `unsafe` block.

> **Note**: the examples here are given in x86/x86-64 assembly, but all
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: x86_64

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, hyphen is valid (and seems to be the conventional one too, ~3x more google results for x86-64 than x86_64): http://en.wikipedia.org/wiki/X86-64

@flaper87
Copy link
Contributor

Excellent work. Loving it so far!

@huonw
Copy link
Member Author

huonw commented Mar 15, 2014

Addressed the review (mostly).

@alexcrichton
Copy link
Member

r=me with my comment plus a squash

@liigo
Copy link
Contributor

liigo commented Mar 15, 2014

looks great to me

This aims to cover the basics of writing safe unsafe code. At the moment
it is just designed to be a better place for the `asm!()` docs than the
detailed release notes wiki page, and I took the time to write up some
other things.

More examples are needed, especially of things that can subtly go wrong;
and vast areas of `unsafe`-ty aren't covered, e.g. `static mut`s and
thread-safety in general.
bors added a commit that referenced this pull request Mar 15, 2014
docs: begin a "low-level & unsafe code" guide.

This aims to cover the basics of writing safe unsafe code. At the moment
it is just designed to be a better place for the `asm!()` docs than the
detailed release notes wiki page, and I took the time to write up some
other things.

More examples are needed, especially of things that can subtly go wrong;
and vast areas of `unsafe`-ty aren't covered, e.g. `static mut`s and
thread-safety in general.
@bors bors closed this Mar 15, 2014
@bors bors merged commit 3d6c28a into rust-lang:master Mar 15, 2014
@huonw huonw deleted the danger-guide branch December 4, 2014 02:03
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Aug 2, 2022
fix: Honor ref expressions for compute_ref_match completions

Fixes rust-lang/rust-analyzer#8357
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.

6 participants