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

Broken link on https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html #1507

Closed
ChayimFriedman2 opened this issue Feb 22, 2022 · 1 comment · Fixed by #1508
Closed

Comments

@ChayimFriedman2
Copy link
Contributor

ChayimFriedman2 commented Feb 22, 2022

https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#inputs-and-outputs

This will write the value 5 into the u64 variable x. You can see that the string literal we use to specify instructions is actually a template string. It is governed by the same rules as Rust [format strings][format-syntax]. The arguments that are inserted into the template however look a bit different than you may be familiar with. First we need to specify if the variable is an input or an output of the inline assembly. In this case it is an output. We declared this by writing out. We also need to specify in what kind of register the assembly expects the variable. In this case we put it in an arbitrary general purpose register by specifying reg. The compiler will choose an appropriate register to insert into the template and will read the variable from there after the inline assembly finishes executing.

The text in bold was meant to be a link but is broken. I don't know what should be the link target.

CC @Amanieu (you wrote this in ebbc1ab).

@Amanieu
Copy link
Member

Amanieu commented Feb 23, 2022

It should point to https://doc.rust-lang.org/std/fmt/#syntax.

ChayimFriedman2 added a commit to ChayimFriedman2/rust-by-example that referenced this issue Feb 23, 2022
ChayimFriedman2 added a commit to ChayimFriedman2/rust-by-example that referenced this issue Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants