Skip to content

Commit f688ba6

Browse files
committed
Auto merge of #61075 - Centril:rollup-1ugmcqu, r=Centril
Rollup of 7 pull requests Successful merges: - #60981 (Bump compiler-builtins to 0.1.15) - #61014 (Make -Zemit-artifact-notifications also emit the artifact type) - #61043 (Disable LLVM/debug assertions in gnu-full-bootstrap) - #61046 (Fix ICE with inconsistent macro matchers) - #61055 (Solaris CI: Build with dilos2 stable) - #61057 (Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators.") - #61073 (librustc_errors: Remove unused annotation style `OldSchoolNoteText`) Failed merges: r? @ghost
2 parents 85334c5 + a89c62c commit f688ba6

File tree

35 files changed

+130
-207
lines changed

35 files changed

+130
-207
lines changed

Cargo.lock

+17-17
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
name = "alloc"
2626
version = "0.0.0"
2727
dependencies = [
28-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
28+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
2929
"core 0.0.0",
3030
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
3131
"rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -123,7 +123,7 @@ version = "0.1.27"
123123
source = "registry+https://github.com/rust-lang/crates.io-index"
124124
dependencies = [
125125
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
126-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
126+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
127127
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
128128
"rustc-std-workspace-core 1.0.0",
129129
]
@@ -462,7 +462,7 @@ dependencies = [
462462

463463
[[package]]
464464
name = "compiler_builtins"
465-
version = "0.1.14"
465+
version = "0.1.15"
466466
source = "registry+https://github.com/rust-lang/crates.io-index"
467467
dependencies = [
468468
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -744,7 +744,7 @@ name = "dlmalloc"
744744
version = "0.1.3"
745745
source = "registry+https://github.com/rust-lang/crates.io-index"
746746
dependencies = [
747-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
747+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
748748
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
749749
"rustc-std-workspace-core 1.0.0",
750750
]
@@ -910,7 +910,7 @@ name = "fortanix-sgx-abi"
910910
version = "0.3.2"
911911
source = "registry+https://github.com/rust-lang/crates.io-index"
912912
dependencies = [
913-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
913+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
914914
"rustc-std-workspace-core 1.0.0",
915915
]
916916

@@ -1071,7 +1071,7 @@ name = "hashbrown"
10711071
version = "0.3.0"
10721072
source = "registry+https://github.com/rust-lang/crates.io-index"
10731073
dependencies = [
1074-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
1074+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
10751075
"rustc-std-workspace-alloc 1.0.0",
10761076
"rustc-std-workspace-core 1.0.0",
10771077
]
@@ -1772,7 +1772,7 @@ dependencies = [
17721772
name = "panic_abort"
17731773
version = "0.0.0"
17741774
dependencies = [
1775-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
1775+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
17761776
"core 0.0.0",
17771777
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
17781778
]
@@ -1782,7 +1782,7 @@ name = "panic_unwind"
17821782
version = "0.0.0"
17831783
dependencies = [
17841784
"alloc 0.0.0",
1785-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
1785+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
17861786
"core 0.0.0",
17871787
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
17881788
"unwind 0.0.0",
@@ -1967,7 +1967,7 @@ name = "profiler_builtins"
19671967
version = "0.0.0"
19681968
dependencies = [
19691969
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
1970-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
1970+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
19711971
"core 0.0.0",
19721972
]
19731973

@@ -2492,7 +2492,7 @@ name = "rustc-demangle"
24922492
version = "0.1.10"
24932493
source = "registry+https://github.com/rust-lang/crates.io-index"
24942494
dependencies = [
2495-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
2495+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
24962496
"rustc-std-workspace-core 1.0.0",
24972497
]
24982498

@@ -2620,7 +2620,7 @@ dependencies = [
26202620
"alloc 0.0.0",
26212621
"build_helper 0.1.0",
26222622
"cmake 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
2623-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
2623+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
26242624
"core 0.0.0",
26252625
]
26262626

@@ -2850,7 +2850,7 @@ dependencies = [
28502850
"alloc 0.0.0",
28512851
"build_helper 0.1.0",
28522852
"cmake 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
2853-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
2853+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
28542854
"core 0.0.0",
28552855
]
28562856

@@ -2912,7 +2912,7 @@ dependencies = [
29122912
"alloc 0.0.0",
29132913
"build_helper 0.1.0",
29142914
"cmake 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
2915-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
2915+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
29162916
"core 0.0.0",
29172917
]
29182918

@@ -3029,7 +3029,7 @@ dependencies = [
30293029
"alloc 0.0.0",
30303030
"build_helper 0.1.0",
30313031
"cmake 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
3032-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
3032+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
30333033
"core 0.0.0",
30343034
]
30353035

@@ -3298,7 +3298,7 @@ dependencies = [
32983298
"alloc 0.0.0",
32993299
"backtrace-sys 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)",
33003300
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
3301-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
3301+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
33023302
"core 0.0.0",
33033303
"dlmalloc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
33043304
"fortanix-sgx-abi 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3889,7 +3889,7 @@ name = "unwind"
38893889
version = "0.0.0"
38903890
dependencies = [
38913891
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
3892-
"compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
3892+
"compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
38933893
"core 0.0.0",
38943894
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
38953895
]
@@ -4087,7 +4087,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
40874087
"checksum colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0aa3473e85a3161b59845d6096b289bb577874cafeaf75ea1b1beaa6572c7fc"
40884088
"checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007"
40894089
"checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2"
4090-
"checksum compiler_builtins 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "e3f235c329e5cb9fa3d2ca2cc36256ba9a7f23fa76e0f4db6f68c23b73b2ac69"
4090+
"checksum compiler_builtins 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "e899b947d7e71c3d35c0b6194d64025b84946640510e215090c815b20828964e"
40914091
"checksum compiletest_rs 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "f40ecc9332b68270998995c00f8051ee856121764a0d3230e64c9efd059d27b6"
40924092
"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
40934093
"checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887"

src/bootstrap/compile.rs

+28-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,33 @@ pub fn std_cargo(builder: &Builder<'_>,
161161
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
162162
}
163163

164+
// Determine if we're going to compile in optimized C intrinsics to
165+
// the `compiler-builtins` crate. These intrinsics live in LLVM's
166+
// `compiler-rt` repository, but our `src/llvm-project` submodule isn't
167+
// always checked out, so we need to conditionally look for this. (e.g. if
168+
// an external LLVM is used we skip the LLVM submodule checkout).
169+
//
170+
// Note that this shouldn't affect the correctness of `compiler-builtins`,
171+
// but only its speed. Some intrinsics in C haven't been translated to Rust
172+
// yet but that's pretty rare. Other intrinsics have optimized
173+
// implementations in C which have only had slower versions ported to Rust,
174+
// so we favor the C version where we can, but it's not critical.
175+
//
176+
// If `compiler-rt` is available ensure that the `c` feature of the
177+
// `compiler-builtins` crate is enabled and it's configured to learn where
178+
// `compiler-rt` is located.
179+
let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt");
180+
let compiler_builtins_c_feature = if compiler_builtins_root.exists() {
181+
cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
182+
" compiler-builtins-c".to_string()
183+
} else {
184+
String::new()
185+
};
186+
164187
if builder.no_std(target) == Some(true) {
188+
let mut features = "compiler-builtins-mem".to_string();
189+
features.push_str(&compiler_builtins_c_feature);
190+
165191
// for no-std targets we only compile a few no_std crates
166192
cargo
167193
.args(&["-p", "alloc"])
@@ -170,7 +196,8 @@ pub fn std_cargo(builder: &Builder<'_>,
170196
.arg("--features")
171197
.arg("compiler-builtins-mem compiler-builtins-c");
172198
} else {
173-
let features = builder.std_features();
199+
let mut features = builder.std_features();
200+
features.push_str(&compiler_builtins_c_feature);
174201

175202
if compiler.stage != 0 && builder.config.sanitizers {
176203
// This variable is used by the sanitizer runtime crates, e.g.

src/build_helper/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,9 @@ pub fn sanitizer_lib_boilerplate(sanitizer_name: &str)
288288
} else {
289289
format!("static={}", link_name)
290290
};
291-
// The source for `compiler-rt` comes from the `compiler-builtins` crate, so
292-
// load our env var set by cargo to find the source code.
293-
let dir = env::var_os("DEP_COMPILER_RT_COMPILER_RT").unwrap();
291+
// This env var is provided by rustbuild to tell us where `compiler-rt`
292+
// lives.
293+
let dir = env::var_os("RUST_COMPILER_RT_ROOT").unwrap();
294294
let lib = native_lib_boilerplate(
295295
dir.as_ref(),
296296
sanitizer_name,

src/ci/docker/dist-various-2/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN apt-get update && apt-get build-dep -y clang llvm && apt-get install -y --no
2424
gpg-agent
2525

2626
RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7924C5513486
27-
RUN add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2-testing main'
27+
RUN add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2 main'
2828

2929
WORKDIR /tmp
3030
COPY dist-various-2/shared.sh /tmp/

src/ci/docker/x86_64-gnu-full-bootstrap/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ ENV RUST_CONFIGURE_ARGS \
2020
--build=x86_64-unknown-linux-gnu \
2121
--enable-full-bootstrap
2222
ENV SCRIPT python2.7 ../x.py build
23+
24+
# In general this just slows down the build and we're just a smoke test that
25+
# a full bootstrap works in general, so there's not much need to take this
26+
# penalty in build times.
27+
ENV NO_LLVM_ASSERTIONS 1
28+
ENV NO_DEBUG_ASSERTIONS 1

src/liballoc/collections/binary_heap.rs

-15
Original file line numberDiff line numberDiff line change
@@ -1035,11 +1035,6 @@ impl<'a, T> Iterator for Iter<'a, T> {
10351035
fn size_hint(&self) -> (usize, Option<usize>) {
10361036
self.iter.size_hint()
10371037
}
1038-
1039-
#[inline]
1040-
fn last(mut self) -> Option<&'a T> {
1041-
self.next_back()
1042-
}
10431038
}
10441039

10451040
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1095,11 +1090,6 @@ impl<T> Iterator for IntoIter<T> {
10951090
fn size_hint(&self) -> (usize, Option<usize>) {
10961091
self.iter.size_hint()
10971092
}
1098-
1099-
#[inline]
1100-
fn last(mut self) -> Option<T> {
1101-
self.next_back()
1102-
}
11031093
}
11041094

11051095
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1146,11 +1136,6 @@ impl<T> Iterator for Drain<'_, T> {
11461136
fn size_hint(&self) -> (usize, Option<usize>) {
11471137
self.iter.size_hint()
11481138
}
1149-
1150-
#[inline]
1151-
fn last(mut self) -> Option<T> {
1152-
self.next_back()
1153-
}
11541139
}
11551140

11561141
#[stable(feature = "drain", since = "1.6.0")]

src/liballoc/collections/btree/map.rs

-40
Original file line numberDiff line numberDiff line change
@@ -1193,11 +1193,6 @@ impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> {
11931193
fn size_hint(&self) -> (usize, Option<usize>) {
11941194
(self.length, Some(self.length))
11951195
}
1196-
1197-
#[inline]
1198-
fn last(mut self) -> Option<(&'a K, &'a V)> {
1199-
self.next_back()
1200-
}
12011196
}
12021197

12031198
#[stable(feature = "fused", since = "1.26.0")]
@@ -1258,11 +1253,6 @@ impl<'a, K: 'a, V: 'a> Iterator for IterMut<'a, K, V> {
12581253
fn size_hint(&self) -> (usize, Option<usize>) {
12591254
(self.length, Some(self.length))
12601255
}
1261-
1262-
#[inline]
1263-
fn last(mut self) -> Option<(&'a K, &'a mut V)> {
1264-
self.next_back()
1265-
}
12661256
}
12671257

12681258
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1369,11 +1359,6 @@ impl<K, V> Iterator for IntoIter<K, V> {
13691359
fn size_hint(&self) -> (usize, Option<usize>) {
13701360
(self.length, Some(self.length))
13711361
}
1372-
1373-
#[inline]
1374-
fn last(mut self) -> Option<(K, V)> {
1375-
self.next_back()
1376-
}
13771362
}
13781363

13791364
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1436,11 +1421,6 @@ impl<'a, K, V> Iterator for Keys<'a, K, V> {
14361421
fn size_hint(&self) -> (usize, Option<usize>) {
14371422
self.inner.size_hint()
14381423
}
1439-
1440-
#[inline]
1441-
fn last(mut self) -> Option<&'a K> {
1442-
self.next_back()
1443-
}
14441424
}
14451425

14461426
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1478,11 +1458,6 @@ impl<'a, K, V> Iterator for Values<'a, K, V> {
14781458
fn size_hint(&self) -> (usize, Option<usize>) {
14791459
self.inner.size_hint()
14801460
}
1481-
1482-
#[inline]
1483-
fn last(mut self) -> Option<&'a V> {
1484-
self.next_back()
1485-
}
14861461
}
14871462

14881463
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1520,11 +1495,6 @@ impl<'a, K, V> Iterator for Range<'a, K, V> {
15201495
unsafe { Some(self.next_unchecked()) }
15211496
}
15221497
}
1523-
1524-
#[inline]
1525-
fn last(mut self) -> Option<(&'a K, &'a V)> {
1526-
self.next_back()
1527-
}
15281498
}
15291499

15301500
#[stable(feature = "map_values_mut", since = "1.10.0")]
@@ -1538,11 +1508,6 @@ impl<'a, K, V> Iterator for ValuesMut<'a, K, V> {
15381508
fn size_hint(&self) -> (usize, Option<usize>) {
15391509
self.inner.size_hint()
15401510
}
1541-
1542-
#[inline]
1543-
fn last(mut self) -> Option<&'a mut V> {
1544-
self.next_back()
1545-
}
15461511
}
15471512

15481513
#[stable(feature = "map_values_mut", since = "1.10.0")]
@@ -1661,11 +1626,6 @@ impl<'a, K, V> Iterator for RangeMut<'a, K, V> {
16611626
unsafe { Some(self.next_unchecked()) }
16621627
}
16631628
}
1664-
1665-
#[inline]
1666-
fn last(mut self) -> Option<(&'a K, &'a mut V)> {
1667-
self.next_back()
1668-
}
16691629
}
16701630

16711631
impl<'a, K, V> RangeMut<'a, K, V> {

src/liballoc/collections/btree/set.rs

-15
Original file line numberDiff line numberDiff line change
@@ -1019,11 +1019,6 @@ impl<'a, T> Iterator for Iter<'a, T> {
10191019
fn size_hint(&self) -> (usize, Option<usize>) {
10201020
self.iter.size_hint()
10211021
}
1022-
1023-
#[inline]
1024-
fn last(mut self) -> Option<&'a T> {
1025-
self.next_back()
1026-
}
10271022
}
10281023
#[stable(feature = "rust1", since = "1.0.0")]
10291024
impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
@@ -1049,11 +1044,6 @@ impl<T> Iterator for IntoIter<T> {
10491044
fn size_hint(&self) -> (usize, Option<usize>) {
10501045
self.iter.size_hint()
10511046
}
1052-
1053-
#[inline]
1054-
fn last(mut self) -> Option<T> {
1055-
self.next_back()
1056-
}
10571047
}
10581048
#[stable(feature = "rust1", since = "1.0.0")]
10591049
impl<T> DoubleEndedIterator for IntoIter<T> {
@@ -1083,11 +1073,6 @@ impl<'a, T> Iterator for Range<'a, T> {
10831073
fn next(&mut self) -> Option<&'a T> {
10841074
self.iter.next().map(|(k, _)| k)
10851075
}
1086-
1087-
#[inline]
1088-
fn last(mut self) -> Option<&'a T> {
1089-
self.next_back()
1090-
}
10911076
}
10921077

10931078
#[stable(feature = "btree_range", since = "1.17.0")]

0 commit comments

Comments
 (0)