Note that I’m not the person with the most expertise in Rust contributions, but I’ve done my fair share of PRs, bug reports on the whole Rust compiler ecosystem. (261 at the time of writing)

The first thing you need to know is how to use git and Rust, you can start learning git by a myriad of ways, so I can’t comment there, but the official Rust learning material is great and interactive, check it out. You should absolutely take care of before trying to contribute to Rust, so as to not waste yours or the reviewer’s time.

Great! Now that you know your fair share of Rust, and assuming you have a GitHub account, you’re ready to delve into the compilers architecture.

Get to know what you’re looking for at contributing, rust handles the compiler, both as a library and a binary and is depended on by other tools. IF you’re looking to contribute to the fabric of token parsin, lexical analysis, typechecking, constant-time function evaluation and other cool concepts, start here.

Oh, my tip & guidelines collection just spilled!

# Pull from upstream
$ git pull upstream master --rebase
$ git push

Depending on the branch you’re doing, you will be able to just git push now, or you’ll need to do fixes. In the case that you have to fix some conflicts, fix them and use git rebase --continue.

pick cbe9b532ec0 Follow review comments (optimize the filtering)
pick efeb32fc98f Remove module passes filtering
pick 32a2b9d16b7 Unify syntax (all to @eval_always)
pick 433d47cc051 Apply review comments + use `shallow_lint_levels_on`

# Rebase a76353065c7..433d47cc051 onto a76353065c7 (4 commands)
# [Here's a guide on how to rebase]
# However, if you remove everything, the rebase will be aborted.
#

Just identify the commits you wanna squash (like review commits, formatting, or minor changes) and replace the pick with s or squash. The changes made in those commits will be moved into the first commit above them with a pick tag.

You can do a lot of things in this editor, not only squash and pick, you’ll have to inspect it more, but it generally isn’t necessary.

Conclusion

I think those are some good general guidelines. You will learn along the way most of the craft. Make sure to enjoy your way through open source and don’t try to maximise your contributions just for the sake of having more. Always treat people in the community like people and don’t fear throwing some emojis from time to time. It would not be my tenth time approving a PR with “Yeehaw 🤠❤️”.

If you’d like to hear more about me and what I do, checkout the bottom of the page, you’ll find useful links (like my Mastodon, @blyxyas@tech.lgbt)

Peace! ✌️ :3