{"id":13667505,"url":"https://github.com/rust-lang/rustc-dev-guide","last_synced_at":"2025-05-14T01:07:27.598Z","repository":{"id":37040090,"uuid":"117744230","full_name":"rust-lang/rustc-dev-guide","owner":"rust-lang","description":"A guide to how rustc works and how to contribute to it.","archived":false,"fork":false,"pushed_at":"2025-04-07T05:45:32.000Z","size":11548,"stargazers_count":1713,"open_issues_count":163,"forks_count":541,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-09T09:50:05.553Z","etag":null,"topics":["compiler","contributing","rust","rustc"],"latest_commit_sha":null,"homepage":"https://rustc-dev-guide.rust-lang.org","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-16T21:26:54.000Z","updated_at":"2025-04-08T02:19:31.000Z","dependencies_parsed_at":"2022-07-13T17:20:35.032Z","dependency_job_id":"7016ecb0-f841-4f37-a54d-ee9637c435f1","html_url":"https://github.com/rust-lang/rustc-dev-guide","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Frustc-dev-guide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Frustc-dev-guide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Frustc-dev-guide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Frustc-dev-guide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-lang","download_url":"https://codeload.github.com/rust-lang/rustc-dev-guide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328662,"owners_count":21085365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","contributing","rust","rustc"],"created_at":"2024-08-02T07:00:39.028Z","updated_at":"2025-05-14T01:07:27.588Z","avatar_url":"https://github.com/rust-lang.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"[![CI](https://github.com/rust-lang/rustc-dev-guide/actions/workflows/ci.yml/badge.svg)](https://github.com/rust-lang/rustc-dev-guide/actions/workflows/ci.yml)\n\n\nThis is a collaborative effort to build a guide that explains how rustc\nworks. The aim of the guide is to help new contributors get oriented\nto rustc, as well as to help more experienced folks in figuring out\nsome new part of the compiler that they haven't worked on before.\n\n[You can read the latest version of the guide here.](https://rustc-dev-guide.rust-lang.org/)\n\nYou may also find the rustdocs [for the compiler itself][rustdocs] useful.\nNote that these are not intended as a guide; it's recommended that you search\nfor the docs you're looking for instead of reading them top to bottom.\n\n[rustdocs]: https://doc.rust-lang.org/nightly/nightly-rustc\n\nFor documentation on developing the standard library, see\n[`std-dev-guide`](https://std-dev-guide.rust-lang.org/).\n\n### Contributing to the guide\n\nThe guide is useful today, but it has a lot of work still to go.\n\nIf you'd like to help improve the guide, we'd love to have you! You can find\nplenty of issues on the [issue\ntracker](https://github.com/rust-lang/rustc-dev-guide/issues). Just post a\ncomment on the issue you would like to work on to make sure that we don't\naccidentally duplicate work. If you think something is missing, please open an\nissue about it!\n\n**In general, if you don't know how the compiler works, that is not a\nproblem!** In that case, what we will do is to schedule a bit of time\nfor you to talk with someone who **does** know the code, or who wants\nto pair with you and figure it out.  Then you can work on writing up\nwhat you learned.\n\nIn general, when writing about a particular part of the compiler's code, we\nrecommend that you link to the relevant parts of the [rustc\nrustdocs][rustdocs].\n\n### Build Instructions\n\nTo build a local static HTML site, install [`mdbook`](https://github.com/rust-lang/mdBook) with:\n\n```\ncargo install mdbook mdbook-linkcheck2 mdbook-toc mdbook-mermaid\n```\n\nand execute the following command in the root of the repository:\n\n```\nmdbook build --open\n```\n\nThe build files are found in the `book/html` directory.\n\n### Link Validations\n\nWe use `mdbook-linkcheck2` to validate URLs included in our documentation. Link\nchecking is **not** run by default locally, though it is in CI. To enable it\nlocally, set the environment variable `ENABLE_LINKCHECK=1` like in the\nfollowing example.\n\n```\nENABLE_LINKCHECK=1 mdbook serve\n```\n\n### Table of Contents\n\nWe use `mdbook-toc` to auto-generate TOCs for long sections. You can invoke the preprocessor by\nincluding the `\u003c!-- toc --\u003e` marker at the place where you want the TOC.\n\n## Synchronizing josh subtree with rustc\n\nThis repository is linked to `rust-lang/rust` as a [josh](https://josh-project.github.io/josh/intro.html) subtree. You can use the following commands to synchronize the subtree in both directions.\n\nYou'll need to install `josh-proxy` locally via\n\n```\ncargo install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04\n```\nOlder versions of `josh-proxy` may not round trip commits losslessly so it is important to install this exact version.\n\n### Pull changes from `rust-lang/rust` into this repository\n\n1) Checkout a new branch that will be used to create a PR into `rust-lang/rustc-dev-guide`\n2) Run the pull command\n    ```\n    cargo run --manifest-path josh-sync/Cargo.toml rustc-pull\n    ```\n3) Push the branch to your fork and create a PR into `rustc-dev-guide`\n\n### Push changes from this repository into `rust-lang/rust`\n\nNOTE: If you use Git protocol to push to your fork of `rust-lang/rust`,\nensure that you have this entry in your Git config,\nelse the 2 steps that follow would prompt for a username and password:\n\n```\n[url \"git@github.com:\"]\ninsteadOf = \"https://github.com/\"\n```\n\n1) Run the push command to create a branch named `\u003cbranch-name\u003e` in a `rustc` fork under the `\u003cgh-username\u003e` account\n    ```\n    cargo run --manifest-path josh-sync/Cargo.toml rustc-push \u003cbranch-name\u003e \u003cgh-username\u003e\n    ```\n2) Create a PR from `\u003cbranch-name\u003e` into `rust-lang/rust`\n\n#### Minimal git config\n\nFor simplicity (ease of implementation purposes), the josh-sync script simply calls out to system git. This means that the git invocation may be influenced by global (or local) git configuration.\n\nYou may observe \"Nothing to pull\" even if you *know* rustc-pull has something to pull if your global git config sets `fetch.prunetags = true` (and possibly other configurations may cause unexpected outcomes).\n\nTo minimize the likelihood of this happening, you may wish to keep a separate *minimal* git config that *only* has `[user]` entries from global git config, then repoint system git to use the minimal git config instead. E.g.\n\n```\nGIT_CONFIG_GLOBAL=/path/to/minimal/gitconfig GIT_CONFIG_SYSTEM='' cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-lang%2Frustc-dev-guide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-lang%2Frustc-dev-guide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-lang%2Frustc-dev-guide/lists"}