Skip to content

Commit ed42b29

Browse files
authored
Merge pull request #2618 from rust-lang/tshepang/corner-case
sembr tool: handle a corner case
2 parents bb86648 + 51fb088 commit ed42b29

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

ci/sembr/src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ struct Cli {
1919
show_diff: bool,
2020
}
2121

22-
static REGEX_IGNORE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(\d\.|\-|\*)\s+").unwrap());
22+
static REGEX_IGNORE: LazyLock<Regex> =
23+
LazyLock::new(|| Regex::new(r"^\s*(\d\.|\-|\*)\s+").unwrap());
2324
static REGEX_IGNORE_END: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(\.|\?|;|!)$").unwrap());
2425
static REGEX_SPLIT: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(\.|\?|;|!)\s+").unwrap());
2526

@@ -173,7 +174,7 @@ ignore e.g. and i.e.
173174
```
174175
some code. block
175176
```
176-
some more text.
177+
sentence with *italics* should not be ignored. truly.
177178
";
178179
let expected = "\
179180
# some. heading
@@ -190,7 +191,8 @@ ignore e.g. and i.e.
190191
```
191192
some code. block
192193
```
193-
some more text.
194+
sentence with *italics* should not be ignored.
195+
truly.
194196
";
195197
assert_eq!(expected, comply(original));
196198
}

src/tests/codegen-backend-tests/cg_gcc.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ you can use the following command to run UI tests locally using the GCC backend,
2121

2222
If a different test suite has failed on CI, you will have to modify the `tests/ui` part.
2323

24-
To reproduce the whole CI job locally, you can run `cargo run --manifest-path src/ci/citool/Cargo.toml run-local x86_64-gnu-gcc`. See [Testing with Docker](../docker.md) for more information.
24+
To reproduce the whole CI job locally, you can run `cargo run --manifest-path src/ci/citool/Cargo.toml run-local x86_64-gnu-gcc`.
25+
See [Testing with Docker](../docker.md) for more information.
2526

2627
### What to do in case of a GCC job failure?
2728

@@ -32,23 +33,26 @@ If fixing a compiler test that fails with the GCC backend is non-trivial, you ca
3233
## Choosing which codegen backends are built
3334

3435
The `rust.codegen-backends = [...]` bootstrap option affects which codegen backends will be built and
35-
included in the sysroot of the produced `rustc`. To use the GCC codegen backend, `"gcc"` has to
36-
be included in this array in `bootstrap.toml`:
36+
included in the sysroot of the produced `rustc`.
37+
To use the GCC codegen backend, `"gcc"` has to be included in this array in `bootstrap.toml`:
3738

3839
```toml
3940
rust.codegen-backends = ["llvm", "gcc"]
4041
```
4142

4243
If you don't want to change your `bootstrap.toml` file, you can alternatively run your `x`
43-
commands with `--set 'rust.codegen-backends=["llvm", "gcc"]'`. For example:
44+
commands with `--set 'rust.codegen-backends=["llvm", "gcc"]'`.
45+
For example:
4446

4547
```bash
4648
./x build --set 'rust.codegen-backends=["llvm", "gcc"]'
4749
```
4850

4951
The first backend in the `codegen-backends` array will determine which backend will be used as the
50-
*default backend* of the built `rustc`. This also determines which backend will be used to compile the
51-
stage 1 standard library (or anything built in stage 2+). To produce `rustc` that uses the GCC backend
52+
*default backend* of the built `rustc`.
53+
This also determines which backend will be used to compile the
54+
stage 1 standard library (or anything built in stage 2+).
55+
To produce `rustc` that uses the GCC backend
5256
by default, you can thus put `"gcc"` as the first element of this array:
5357

5458
```bash
@@ -69,7 +73,8 @@ Note that in order for this to work, the tested compiler must have the GCC codeg
6973
## Downloading GCC from CI
7074

7175
The `gcc.download-ci-gcc` bootstrap option controls if GCC (which is a dependency of the GCC codegen backend)
72-
will be downloaded from CI or built locally. The default value is `true`, which will download GCC from CI
76+
will be downloaded from CI or built locally.
77+
The default value is `true`, which will download GCC from CI
7378
if there are no local changes to the GCC sources and the given host target is available on CI.
7479

7580
## Running tests of the backend itself

0 commit comments

Comments
 (0)