@@ -148,8 +148,8 @@ Your branch is up to date with 'origin/master'.
148148Changes not staged for commit:
149149 (use "git add <file>..." to update what will be committed)
150150 (use "git restore <file>..." to discard changes in working directory)
151+ modified: src/llvm-project (new commits)
151152 modified: src/tools/cargo (new commits)
152- modified: src/tools/miri (new commits)
153153
154154no changes added to commit (use "git add" and/or "git commit -a")
155155```
@@ -176,6 +176,8 @@ There is a workaround in [the issue][#77620-workaround].
176176[ #77620 ] : https://github.com/rust-lang/rust/issues/77620
177177[ #77620-workaround ] : https://github.com/rust-lang/rust/issues/77620#issuecomment-705228229
178178
179+ (Note that as of Sept 2022 ` miri ` is a subtree and not a submodule.)
180+
179181## Rebasing and Conflicts
180182
181183When you edit your code locally, you are making changes to the version of
@@ -391,41 +393,41 @@ you might want to get used to the main concepts of Git before reading this secti
391393
392394The ` rust-lang/rust ` repository uses [ Git submodules] as a way to use other
393395Rust projects from within the ` rust ` repo. Examples include Rust's fork of
394- ` llvm-project ` and many devtools such as ` cargo ` and ` miri ` .
396+ ` llvm-project ` , ` cargo ` and libraries like ` stdarch ` and ` backtrace ` .
395397
396398Those projects are developed and maintained in an separate Git (and GitHub)
397399repository, and they have their own Git history/commits, issue tracker and PRs.
398400Submodules allow us to create some sort of embedded sub-repository inside the
399401` rust ` repository and use them like they were directories in the ` rust ` repository.
400402
401- Take ` miri ` for example. ` miri ` is maintained in the [ ` rust-lang/miri ` ] repository,
402- but it is used in ` rust-lang/rust ` by the compiler for const evaluation. We bring it
403- in ` rust ` as a submodule, in the ` src/tools/miri ` folder.
403+ Take ` llvm-project ` for example. ` llvm-project ` is maintained in the [ ` rust-lang/llvm-project ` ]
404+ repository, but it is used in ` rust-lang/rust ` by the compiler for code generation and
405+ optimization. We bring it in ` rust ` as a submodule, in the ` src/llvm-project ` folder.
404406
405407The contents of submodules are ignored by Git: submodules are in some sense isolated
406- from the rest of the repository. However, if you try to ` cd src/tools/miri ` and then
408+ from the rest of the repository. However, if you try to ` cd src/llvm-project ` and then
407409run ` git status ` :
408410
409411```
410- HEAD detached at 3fafb835
412+ HEAD detached at 9567f08afc943
411413nothing to commit, working tree clean
412414```
413415
414- As far as git is concerned, you are no longer in the ` rust ` repo, but in the ` miri ` repo.
416+ As far as git is concerned, you are no longer in the ` rust ` repo, but in the ` llvm-project ` repo.
415417You will notice that we are in "detached HEAD" state, i.e. not on a branch but on a
416418particular commit.
417419
418420This is because, like any dependency, we want to be able to control which version to use.
419421Submodules allow us to do just that: every submodule is "pinned" to a certain
420422commit, which doesn't change unless modified manually. If you use ` git checkout <commit> `
421- in the ` miri ` directory and go back to the ` rust ` directory, you can stage this
422- change like any other, e.g. by running ` git add src/tools/miri ` . (Note that if
423+ in the ` llvm-project ` directory and go back to the ` rust ` directory, you can stage this
424+ change like any other, e.g. by running ` git add src/llvm-project ` . (Note that if
423425you * don't* stage the change to commit, then you run the risk that running
424426` x.py ` will just undo your change by switching back to the previous commit when
425427it automatically "updates" the submodules.)
426428
427429This version selection is usually done by the maintainers of the project, and
428- looks like [ this] [ miri -update] .
430+ looks like [ this] [ llvm -update] .
429431
430432Git submodules take some time to get used to, so don't worry if it isn't perfectly
431433clear yet. You will rarely have to use them directly and, again, you don't need
@@ -434,5 +436,5 @@ exist and that they correspond to some sort of embedded subrepository dependency
434436that Git can nicely and fairly conveniently handle for us.
435437
436438[ Git submodules ] : https://git-scm.com/book/en/v2/Git-Tools-Submodules
437- [ `rust-lang/miri ` ] : https://github.com/rust-lang/miri
438- [ miri -update] : https://github.com/rust-lang/rust/pull/77500 /files
439+ [ `rust-lang/llvm-project ` ] : https://github.com/rust-lang/llvm-project
440+ [ llvm -update] : https://github.com/rust-lang/rust/pull/99464 /files
0 commit comments