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

gccrs: Add base documentation for using the Rust frontend. #2966

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CohenArthur
Copy link
Member

@CohenArthur CohenArthur commented Apr 23, 2024

gcc/rust/ChangeLog:

* Make-lang.in: Add documentation targets.
* gccrs.texi: New file.

You can build the documentation yourself by running one of these commands:

pdf:

texi2pdf gcc/rust/gccrs.texi -I gcc/doc -I gcc/doc/include -I build/gcc/

html:

makeinfo --html gcc/rust/gccrs.texi -I gcc/doc -I gcc/doc/include -I build/gcc/ -o <output_dir>

for the HTML output look for an index.html file to open. as for the produced PDF, it should be called gccrs.pdf in your current working directory

@CohenArthur CohenArthur force-pushed the document-rust-more branch 4 times, most recently from d38ac92 to 58f3dcd Compare April 24, 2024 06:59
@CohenArthur
Copy link
Member Author

sorry, did not mean to force push here but I amended my commit by mistake 😬 the only change is me adding an index to the .texi file

Copy link
Member

@P-E-P P-E-P left a comment

Choose a reason for hiding this comment

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

There are some mentions to the go frontend we probably want to get rid of.

gcc/rust/gccrs.texi Outdated Show resolved Hide resolved
gcc/rust/gccrs.texi Outdated Show resolved Hide resolved
gcc/rust/gccrs.texi Outdated Show resolved Hide resolved
gcc/rust/gccrs.texi Show resolved Hide resolved
gcc/rust/ChangeLog:

	* Make-lang.in: Add documentation targets.
	* gccrs.texi: New file.
Copy link
Member

@dkm dkm left a comment

Choose a reason for hiding this comment

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

You may want to add rust.install-html target, so that the new urlification of terminal message can point to online doc generated from your new texinfo :)

@@ -0,0 +1,207 @@
\input texinfo @c -*-texinfo-*-
@setfilename gccrs.info
@settitle The GNU Rust Compiler
Copy link
Member

Choose a reason for hiding this comment

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

Just to be sure, is that the "blessed" name, wrt the Rust® ?

Copy link
Member Author

Choose a reason for hiding this comment

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

good question :) I think we can leave it like this for now, and be open to changing it

Christophe Lyon and others added 2 commits April 29, 2024 15:23
rust has the (empty) rust.dvi and rust.html rules, but lacks the
(empty) rust.install-dvi and rust.install-html ones.

2024-04-04  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/rust/
	* Make-lang.in (rust.install-dvi, rust.install-html): New rules.
gcc/rust/ChangeLog:

	* Make-lang.in: Add proper rust.install-html rule.
@CohenArthur
Copy link
Member Author

You may want to add rust.install-html target, so that the new urlification of terminal message can point to online doc generated from your new texinfo :)

good point! I added it in 66d644a, basing it off the patch from Christophe Lyon we had received a while ago to add these dummy rules. it's a straight copy from the Ada frontend, as it seems both the D and Go frontend have done this too.

@CohenArthur
Copy link
Member Author

I'll add another PR with more documentation for using the compiler and add some example code from #2957

Comment on lines +125 to +131
@cindex @option{-frust-mini-std}
@item -frust-mini-std
Add the @code{mini_std} module to the crate you are currently compiling. This miniature
standard library is experimental, and does not represent a strict subset of Rust's
standard library. It is there so that you can have access to basic Rust functionality,
such as common arithmetic operations on natural numbers or printing basic strings to
the standard output streams.
Copy link
Member

Choose a reason for hiding this comment

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

Should probably not be mentioned.

Suggested change
@cindex @option{-frust-mini-std}
@item -frust-mini-std
Add the @code{mini_std} module to the crate you are currently compiling. This miniature
standard library is experimental, and does not represent a strict subset of Rust's
standard library. It is there so that you can have access to basic Rust functionality,
such as common arithmetic operations on natural numbers or printing basic strings to
the standard output streams.

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.

None yet

3 participants