Skip to content

Commit 5a7ad8e

Browse files
committed
Auto merge of rust-lang#150324 - matthiaskrgr:rollup-cl7wrqn, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#149800 (Fix ICE in normalization during closure capture analysis (rust-lang#149746)) - rust-lang#150182 (Don't export upstream monomorphizations from compiler-builtins) - rust-lang#150216 (Tidying up tests/ui/issues 15 tests [6/N]) - rust-lang#150308 (Update bors configuration) - rust-lang#150314 (rustc-dev-guide subtree update) - rust-lang#150319 (use new term in description of --target) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8796b3b + 2237db5 commit 5a7ad8e

File tree

69 files changed

+534
-452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+534
-452
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- try
1616
- try-perf
1717
- automation/bors/try
18+
- automation/bors/auto
1819
pull_request:
1920
branches:
2021
- "**"
@@ -56,7 +57,7 @@ jobs:
5657
- name: Test citool
5758
# Only test citool on the auto branch, to reduce latency of the calculate matrix job
5859
# on PR/try builds.
59-
if: ${{ github.ref == 'refs/heads/auto' }}
60+
if: ${{ github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto' }}
6061
run: |
6162
cd src/ci/citool
6263
CARGO_INCREMENTAL=0 cargo test
@@ -79,7 +80,7 @@ jobs:
7980
# access the environment.
8081
#
8182
# We only enable the environment for the rust-lang/rust repository, so that CI works on forks.
82-
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto')) && 'bors') || '' }}
83+
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
8384
env:
8485
CI_JOB_NAME: ${{ matrix.name }}
8586
CI_JOB_DOC_URL: ${{ matrix.doc_url }}
@@ -313,7 +314,7 @@ jobs:
313314
needs: [ calculate_matrix, job ]
314315
# !cancelled() executes the job regardless of whether the previous jobs passed or failed
315316
if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
316-
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto')) && 'bors') || '' }}
317+
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
317318
steps:
318319
- name: checkout the source code
319320
uses: actions/checkout@v5

compiler/rustc_middle/src/ty/context.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,6 +2273,12 @@ impl<'tcx> TyCtxt<'tcx> {
22732273

22742274
#[inline]
22752275
pub fn local_crate_exports_generics(self) -> bool {
2276+
// compiler-builtins has some special treatment in codegen, which can result in confusing
2277+
// behavior if another crate ends up calling into its monomorphizations.
2278+
// https://github.com/rust-lang/rust/issues/150173
2279+
if self.is_compiler_builtins(LOCAL_CRATE) {
2280+
return false;
2281+
}
22762282
self.crate_types().iter().any(|crate_type| {
22772283
match crate_type {
22782284
CrateType::Executable

compiler/rustc_middle/src/ty/util.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,10 @@ impl<'tcx> Ty<'tcx> {
13941394

13951395
// This doesn't depend on regions, so try to minimize distinct
13961396
// query keys used.
1397-
let erased = tcx.normalize_erasing_regions(typing_env, query_ty);
1398-
tcx.has_significant_drop_raw(typing_env.as_query_input(erased))
1397+
// FIX: Use try_normalize to avoid crashing. If it fails, return true.
1398+
tcx.try_normalize_erasing_regions(typing_env, query_ty)
1399+
.map(|erased| tcx.has_significant_drop_raw(typing_env.as_query_input(erased)))
1400+
.unwrap_or(true)
13991401
}
14001402
}
14011403
}

compiler/rustc_session/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
17981798
"<OPT>",
17991799
),
18001800
opt(Stable, Flag, "", "test", "Build a test harness", ""),
1801-
opt(Stable, Opt, "", "target", "Target triple for which the code is compiled", "<TARGET>"),
1801+
opt(Stable, Opt, "", "target", "Target tuple for which the code is compiled", "<TARGET>"),
18021802
opt(Stable, Multi, "A", "allow", "Set lint allowed", "<LINT>"),
18031803
opt(Stable, Multi, "W", "warn", "Set lint warnings", "<LINT>"),
18041804
opt(Stable, Multi, "", "force-warn", "Set lint force-warn", "<LINT>"),

rust-bors.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,42 @@ labels_blocking_approval = [
2525
"S-waiting-on-t-rustdoc-frontend",
2626
"S-waiting-on-t-clippy"
2727
]
28+
29+
# If CI runs quicker than this duration, consider it to be a failure
30+
min_ci_time = 600
31+
32+
[labels]
33+
approved = [
34+
"+S-waiting-on-bors",
35+
"-S-blocked",
36+
"-S-waiting-on-author",
37+
"-S-waiting-on-crater",
38+
"-S-waiting-on-review",
39+
"-S-waiting-on-team"
40+
]
41+
unapproved = [
42+
"+S-waiting-on-author",
43+
"-S-blocked",
44+
"-S-waiting-on-bors",
45+
"-S-waiting-on-crater",
46+
"-S-waiting-on-review",
47+
"-S-waiting-on-team"
48+
]
49+
try_failed = [
50+
"+S-waiting-on-author",
51+
"-S-waiting-on-review",
52+
"-S-waiting-on-crater"
53+
]
54+
auto_build_succeeded = ["+merged-by-bors"]
55+
auto_build_failed = [
56+
"+S-waiting-on-review",
57+
"-S-blocked",
58+
"-S-waiting-on-bors",
59+
"-S-waiting-on-author",
60+
"-S-waiting-on-crater",
61+
"-S-waiting-on-team"
62+
]
63+
64+
# Flip this two once new bors is used for actual merges on this repository
65+
merge_queue_enabled = false
66+
report_merge_conflicts = true

src/ci/citool/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ impl GitHubContext {
4646
let patterns = if !patterns.is_empty() { Some(patterns) } else { None };
4747
Some(RunType::TryJob { job_patterns: patterns })
4848
}
49-
("push", "refs/heads/auto") => Some(RunType::AutoJob),
49+
("push", "refs/heads/auto" | "refs/heads/automation/bors/auto") => {
50+
Some(RunType::AutoJob)
51+
}
5052
("push", "refs/heads/main") => Some(RunType::MainJob),
5153
_ => None,
5254
}

src/doc/man/rustc.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ Provide a detailed explanation of an error message.
7979
Build a test harness.
8080
.TP
8181
\fB\-\-target\fR \fITARGET\fR
82-
Target triple for which the code is compiled. This option defaults to the host’s target
83-
triple. The target triple has the general format <arch><sub>\-<vendor>\-<sys>\-<abi>, where:
82+
Target tuple for which the code is compiled. This option defaults to the host’s target
83+
tuple. The target tuple has the general format <arch><sub>\-<vendor>\-<sys>\-<abi>, where:
8484
.RS
8585
.TP
8686
.B <arch>

src/doc/rustc-dev-guide/ci/sembr/Cargo.lock

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@ version = "0.8.21"
148148
source = "registry+https://github.com/rust-lang/crates.io-index"
149149
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
150150

151-
[[package]]
152-
name = "foldhash"
153-
version = "0.1.5"
154-
source = "registry+https://github.com/rust-lang/crates.io-index"
155-
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
156-
157151
[[package]]
158152
name = "globset"
159153
version = "0.4.18"
@@ -167,15 +161,6 @@ dependencies = [
167161
"regex-syntax",
168162
]
169163

170-
[[package]]
171-
name = "hashbrown"
172-
version = "0.15.5"
173-
source = "registry+https://github.com/rust-lang/crates.io-index"
174-
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
175-
dependencies = [
176-
"foldhash",
177-
]
178-
179164
[[package]]
180165
name = "heck"
181166
version = "0.5.0"
@@ -198,16 +183,6 @@ dependencies = [
198183
"winapi-util",
199184
]
200185

201-
[[package]]
202-
name = "imara-diff"
203-
version = "0.2.0"
204-
source = "registry+https://github.com/rust-lang/crates.io-index"
205-
checksum = "2f01d462f766df78ab820dd06f5eb700233c51f0f4c2e846520eaf4ba6aa5c5c"
206-
dependencies = [
207-
"hashbrown",
208-
"memchr",
209-
]
210-
211186
[[package]]
212187
name = "is_terminal_polyfill"
213188
version = "1.70.2"
@@ -295,7 +270,6 @@ dependencies = [
295270
"anyhow",
296271
"clap",
297272
"ignore",
298-
"imara-diff",
299273
"regex",
300274
]
301275

src/doc/rustc-dev-guide/ci/sembr/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ edition = "2024"
55
[dependencies]
66
anyhow = "1"
77
ignore = "0.4"
8-
imara-diff = "0.2"
98

109
[dependencies.regex]
1110
version = "1"

src/doc/rustc-dev-guide/ci/sembr/src/main.rs

Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::{fs, process};
55
use anyhow::Result;
66
use clap::Parser;
77
use ignore::Walk;
8-
use imara_diff::{Algorithm, BasicLineDiffPrinter, Diff, InternedInput, UnifiedDiffConfig};
98
use regex::Regex;
109

1110
#[derive(Parser)]
@@ -18,8 +17,6 @@ struct Cli {
1817
/// Applies to lines that are to be split
1918
#[arg(long, default_value_t = 100)]
2019
line_length_limit: usize,
21-
#[arg(long)]
22-
show_diff: bool,
2320
}
2421

2522
static REGEX_IGNORE_END: LazyLock<Regex> =
@@ -54,10 +51,6 @@ fn main() -> Result<()> {
5451
} else if cli.overwrite {
5552
fs::write(&path, new)?;
5653
made_compliant.push(path.clone());
57-
} else if cli.show_diff {
58-
println!("{}:", path.display());
59-
show_diff(&old, &new);
60-
println!("---");
6154
} else {
6255
not_compliant.push(path.clone());
6356
}
@@ -76,16 +69,6 @@ fn main() -> Result<()> {
7669
Ok(())
7770
}
7871

79-
fn show_diff(old: &str, new: &str) {
80-
let input = InternedInput::new(old, new);
81-
let mut diff = Diff::compute(Algorithm::Histogram, &input);
82-
diff.postprocess_lines(&input);
83-
let diff = diff
84-
.unified_diff(&BasicLineDiffPrinter(&input.interner), UnifiedDiffConfig::default(), &input)
85-
.to_string();
86-
print!("{diff}");
87-
}
88-
8972
fn display(header: &str, paths: &[PathBuf]) {
9073
println!("{header}:");
9174
for element in paths {
@@ -96,7 +79,9 @@ fn display(header: &str, paths: &[PathBuf]) {
9679
fn ignore(line: &str, in_code_block: bool) -> bool {
9780
in_code_block
9881
|| line.to_lowercase().contains("e.g.")
82+
|| line.to_lowercase().contains("n.b.")
9983
|| line.contains("i.e.")
84+
|| line.contains("et. al")
10085
|| line.contains('|')
10186
|| line.trim_start().starts_with('>')
10287
|| line.starts_with('#')
@@ -213,6 +198,9 @@ some code. block
213198
sentence with *italics* should not be ignored. truly.
214199
git log main.. compiler
215200
foo. bar. baz
201+
o? whatever
202+
r? @reviewer
203+
r? @reviewer
216204
";
217205
let expected = "
218206
# some. heading
@@ -238,12 +226,16 @@ git log main.. compiler
238226
foo.
239227
bar.
240228
baz
229+
o?
230+
whatever
231+
r? @reviewer
232+
r? @reviewer
241233
";
242234
assert_eq!(expected, comply(original));
243235
}
244236

245237
#[test]
246-
fn test_prettify() {
238+
fn test_lengthen_lines() {
247239
let original = "\
248240
do not split
249241
short sentences
@@ -264,6 +256,12 @@ do not mess with code block chars
264256
leave the
265257
text alone
266258
```
259+
260+
handle the
261+
indented well
262+
263+
[a target]: https://example.com
264+
[another target]: https://example.com
267265
";
268266
let expected = "\
269267
do not split short sentences
@@ -284,43 +282,11 @@ do not mess with code block chars
284282
leave the
285283
text alone
286284
```
287-
";
288-
assert_eq!(expected, lengthen_lines(original, 50));
289-
}
290285
291-
#[test]
292-
fn test_prettify_prefix_spaces() {
293-
let original = "\
294-
do not split
295-
short sentences
296-
";
297-
let expected = "\
298-
do not split short sentences
299-
";
300-
assert_eq!(expected, lengthen_lines(original, 50));
301-
}
286+
handle the indented well
302287
303-
#[test]
304-
fn test_prettify_ignore_link_targets() {
305-
let original = "\
306288
[a target]: https://example.com
307289
[another target]: https://example.com
308290
";
309-
assert_eq!(original, lengthen_lines(original, 100));
310-
}
311-
312-
#[test]
313-
fn test_sembr_question_mark() {
314-
let original = "
315-
o? whatever
316-
r? @reviewer
317-
r? @reviewer
318-
";
319-
let expected = "
320-
o?
321-
whatever
322-
r? @reviewer
323-
r? @reviewer
324-
";
325-
assert_eq!(expected, comply(original));
291+
assert_eq!(expected, lengthen_lines(original, 50));
326292
}

0 commit comments

Comments
 (0)