Skip to content

Commit 1fc709b

Browse files
authored
Merge pull request #2723 from rust-lang/tshepang/sembr
sembt borrow_check/opaque-types-region-inference-restrictions
2 parents ac36f88 + dfb4960 commit 1fc709b

3 files changed

Lines changed: 45 additions & 32 deletions

File tree

ci/sembr/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static REGEX_SPLIT: LazyLock<Regex> =
2727
LazyLock::new(|| Regex::new(r"([^\.\d\-\*]\.|[^r]\?|!)\s").unwrap());
2828
// list elements, numbered (1.) or not (- and *)
2929
static REGEX_LIST_ENTRY: LazyLock<Regex> =
30-
LazyLock::new(|| Regex::new(r"^\s*(\d\.|\-|\*)\s+").unwrap());
30+
LazyLock::new(|| Regex::new(r"^\s*(\d\.|\-|\*|\d\))\s+").unwrap());
3131

3232
fn main() -> Result<()> {
3333
let cli = Cli::parse();
@@ -80,6 +80,7 @@ fn ignore(line: &str, in_code_block: bool) -> bool {
8080
in_code_block
8181
|| line.to_lowercase().contains("e.g.")
8282
|| line.to_lowercase().contains("n.b.")
83+
|| line.contains(" etc.")
8384
|| line.contains("i.e.")
8485
|| line.contains("et. al")
8586
|| line.contains('|')
@@ -189,9 +190,11 @@ must! be. split?
189190
ignore | tables
190191
ignore e.g. and
191192
ignore i.e. and
193+
ignore etc. and
192194
ignore E.g. too
193195
- list. entry
194196
* list. entry
197+
1) list. entry
195198
```
196199
some code. block
197200
```
@@ -212,11 +215,14 @@ split?
212215
ignore | tables
213216
ignore e.g. and
214217
ignore i.e. and
218+
ignore etc. and
215219
ignore E.g. too
216220
- list.
217221
entry
218222
* list.
219223
entry
224+
1) list.
225+
entry
220226
```
221227
some code. block
222228
```

src/external-repos.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ The following external projects are managed using some form of a `subtree`:
2929

3030
In contrast to `submodule` dependencies
3131
(see below for those), the `subtree` dependencies are just regular files and directories which can
32-
be updated in tree. However, if possible, enhancements, bug fixes, etc. specific
33-
to these tools should be filed against the tools directly in their respective
34-
upstream repositories. The exception is that when rustc changes are required to
32+
be updated in-tree. However, if possible, enhancements, bug fixes, etc. specific
33+
to these tools should be filed against the tools directly in their respective upstream repositories.
34+
The exception is that when rustc changes are required to
3535
implement a new tool feature or test, that should happen in one collective rustc PR.
3636

3737
`subtree` dependencies are currently managed by two distinct approaches:
@@ -51,7 +51,9 @@ implement a new tool feature or test, that should happen in one collective rustc
5151

5252
### Josh subtrees
5353

54-
The [josh] tool is an alternative to git subtrees, which manages git history in a different way and scales better to larger repositories. Specific tooling is required to work with josh. We provide a helper [`rustc-josh-sync`][josh-sync] tool to help with the synchronization, described [below](#synchronizing-a-josh-subtree).
54+
The [josh] tool is an alternative to git subtrees, which manages git history in a different way and scales better to larger repositories.
55+
Specific tooling is required to work with josh.
56+
We provide a helper [`rustc-josh-sync`][josh-sync] tool to help with the synchronization, described [below](#synchronizing-a-josh-subtree).
5557

5658
### Synchronizing a Josh subtree
5759

@@ -69,24 +71,24 @@ changes from the subtree to rust-lang/rust) are performed from the subtree repos
6971
switch to its repository checkout directory in your terminal).
7072

7173
#### Performing pull
72-
1) Checkout a new branch that will be used to create a PR into the subtree
73-
2) Run the pull command
74+
1. Checkout a new branch that will be used to create a PR into the subtree
75+
2. Run the pull command
7476
```
7577
rustc-josh-sync pull
7678
```
77-
3) Push the branch to your fork and create a PR into the subtree repository
79+
3. Push the branch to your fork and create a PR into the subtree repository
7880
- If you have `gh` CLI installed, `rustc-josh-sync` can create the PR for you.
7981
8082
#### Performing push
8183
8284
> NOTE:
8385
> Before you proceed, look at some guidance related to Git [on josh-sync README].
8486
85-
1) Run the push command to create a branch named `<branch-name>` in a `rustc` fork under the `<gh-username>` account
87+
1. Run the push command to create a branch named `<branch-name>` in a `rustc` fork under the `<gh-username>` account
8688
```
8789
rustc-josh-sync push <branch-name> <gh-username>
8890
```
89-
2) Create a PR from `<branch-name>` into `rust-lang/rust`
91+
2. Create a PR from `<branch-name>` into `rust-lang/rust`
9092
9193
### Creating a new Josh subtree dependency
9294
@@ -97,7 +99,8 @@ If you want to migrate a repository dependency from `git subtree` or `git submod
9799
Periodically the changes made to subtree based dependencies need to be synchronized between this
98100
repository and the upstream tool repositories.
99101
100-
Subtree synchronizations are typically handled by the respective tool maintainers. Other users
102+
Subtree synchronizations are typically handled by the respective tool maintainers.
103+
Other users
101104
are welcome to submit synchronization PRs, however, in order to do so you will need to modify
102105
your local git installation and follow a very precise set of instructions.
103106
These instructions are documented, along with several useful tips and tricks, in the
@@ -108,8 +111,8 @@ use the correct corresponding subtree directory and remote repository.
108111
The synchronization process goes in two directions: `subtree push` and `subtree pull`.
109112
110113
A `subtree push` takes all the changes that happened to the copy in this repo and creates commits
111-
on the remote repo that match the local changes. Every local
112-
commit that touched the subtree causes a commit on the remote repo, but
114+
on the remote repo that match the local changes.
115+
Every local commit that touched the subtree causes a commit on the remote repo, but
113116
is modified to move the files from the specified directory to the tool repo root.
114117
115118
A `subtree pull` takes all changes since the last `subtree pull`
@@ -119,14 +122,17 @@ the tool changes into the specified directory in the Rust repository.
119122
It is recommended that you always do a push first and get that merged to the default branch of the tool.
120123
Then, when you do a pull, the merge works without conflicts.
121124
While it's definitely possible to resolve conflicts during a pull, you may have to redo the conflict
122-
resolution if your PR doesn't get merged fast enough and there are new conflicts. Do not try to
123-
rebase the result of a `git subtree pull`, rebasing merge commits is a bad idea in general.
125+
resolution if your PR doesn't get merged fast enough and there are new conflicts.
126+
Do not try to
127+
rebase the result of a `git subtree pull`; rebasing merge commits is a bad idea in general.
124128
125129
You always need to specify the `-P` prefix to the subtree directory and the corresponding remote
126-
repository. If you specify the wrong directory or repository
130+
repository.
131+
If you specify the wrong directory or repository
127132
you'll get very fun merges that try to push the wrong directory to the wrong remote repository.
128133
Luckily you can just abort this without any consequences by throwing away either the pulled commits
129-
in rustc or the pushed branch on the remote and try again. It is usually fairly obvious
134+
in rustc or the pushed branch on the remote and try again.
135+
It is usually fairly obvious
130136
that this is happening because you suddenly get thousands of commits that want to be synchronized.
131137
132138
[clippy-sync-docs]: https://doc.rust-lang.org/nightly/clippy/development/infrastructure/sync.html
@@ -140,33 +146,34 @@ repository's root directory!)
140146
git subtree add -P src/tools/clippy https://github.com/rust-lang/rust-clippy.git master
141147
```
142148
143-
This will create a new commit, which you may not rebase under any circumstances! Delete the commit
144-
and redo the operation if you need to rebase.
149+
This will create a new commit, which you may not rebase under any circumstances!
150+
Delete the commit and redo the operation if you need to rebase.
145151
146152
Now you're done, the `src/tools/clippy` directory behaves as if Clippy were
147153
part of the rustc monorepo, so no one but you (or others that synchronize
148154
subtrees) actually needs to use `git subtree`.
149155
150156
## External Dependencies (submodules)
151157
152-
Building Rust will also use external git repositories tracked using [git
153-
submodules]. The complete list may be found in the [`.gitmodules`] file. Some
154-
of these projects are required (like `stdarch` for the standard library) and
158+
Building Rust will also use external git repositories tracked using [git submodules].
159+
The complete list may be found in the [`.gitmodules`] file.
160+
Some of these projects are required (like `stdarch` for the standard library) and
155161
some of them are optional (like `src/doc/book`).
156162
157163
Usage of submodules is discussed more in the [Using Git chapter](git.md#git-submodules).
158164
159165
Some of the submodules are allowed to be in a "broken" state where they
160166
either don't build or their tests don't pass, e.g. the documentation books
161-
like [The Rust Reference]. Maintainers of these projects will be notified
162-
when the project is in a broken state, and they should fix them as soon
163-
as possible. The current status is tracked on the [toolstate website].
167+
like [The Rust Reference].
168+
Maintainers of these projects will be notified
169+
when the project is in a broken state, and they should fix them as soon as possible.
170+
The current status is tracked on the [toolstate website].
164171
More information may be found on the Forge [Toolstate chapter].
165172
In practice, it is very rare for documentation to have broken toolstate.
166173
167174
Breakage is not allowed in the beta and stable channels, and must be addressed
168-
before the PR is merged. They are also not allowed to be broken on `main` in
169-
the week leading up to the beta cut.
175+
before the PR is merged.
176+
They are also not allowed to be broken on `main` in the week leading up to the beta cut.
170177
171178
[git submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
172179
[`.gitmodules`]: https://github.com/rust-lang/rust/blob/HEAD/.gitmodules

src/tests/directives.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ means the test won't be compiled or run.
130130
main test files but that `compiletest` should not try to build the file itself.
131131
Please backlink to which main test is actually using the auxiliary file.
132132
* `ignore-test` always ignores the test. This can be used to temporarily disable
133-
a test if it is currently not working, but you want to keep it in tree to
133+
a test if it is currently not working, but you want to keep it in-tree to
134134
re-enable it later.
135135

136136
Some examples of `X` in `ignore-X` or `only-X`:
@@ -211,7 +211,7 @@ settings:
211211
- `needs-target-std` — ignores if target platform does not have std support.
212212
- `ignore-backends` — ignores the listed backends, separated by whitespace characters. Please note
213213
that this directive can be overriden with the `--bypass-ignore-backends=[BACKEND]` command line
214-
flag.
214+
flag.
215215
- `needs-backends` — only runs the test if current codegen backend is listed.
216216
- `needs-offload` — ignores if our LLVM backend was not built with offload support.
217217
- `needs-enzyme` — ignores if our Enzyme submodule was not built.
@@ -290,9 +290,9 @@ You can also force `./x test` to use a specific edition by passing the `-- --edi
290290
However, tests with the `//@ edition` directive will clamp the value passed to the argument.
291291
For example, if we run `./x test -- --edition=2015`:
292292

293-
- A test with the `//@ edition: 2018` will run with the 2018 edition.
294-
- A test with the `//@ edition: 2015..2021` will be run with the 2015 edition.
295-
- A test with the `//@ edition: 2018..` will run with the 2018 edition.
293+
- A test with the `//@ edition: 2018` will run with the 2018 edition.
294+
- A test with the `//@ edition: 2015..2021` will be run with the 2015 edition.
295+
- A test with the `//@ edition: 2018..` will run with the 2018 edition.
296296

297297
### Rustdoc
298298

0 commit comments

Comments
 (0)