Skip to content

Commit 503dfcf

Browse files
committed
Auto merge of #126202 - jieyouxu:rollup-2ixnizz, r=jieyouxu
Rollup of 6 pull requests Successful merges: - #125041 (Enable GVN for `AggregateKind::RawPtr`) - #125253 (Add `FRAC_1_SQRT_2PI` constant to f16/f32/f64/f128) - #125465 (bootstrap: vendor crates required by opt-dist to collect profiles ) - #125470 (Add release notes for 1.79.0) - #125963 (Remove hard-coded hashes from codegen tests) - #126188 (Fix documentation for `impl_common_helpers` in `run-make-support`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 65d1a73 + a8cba36 commit 503dfcf

30 files changed

+767
-70
lines changed

RELEASES.md

+128
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,131 @@
1+
Version 1.79.0 (2024-06-13)
2+
==========================
3+
4+
<a id="1.79.0-Language"></a>
5+
6+
Language
7+
--------
8+
- [Stabilize inline `const {}` expressions.](https://github.com/rust-lang/rust/pull/104087/)
9+
- [Prevent opaque types being instantiated twice with different regions within the same function.](https://github.com/rust-lang/rust/pull/116935/)
10+
- [Stabilize WebAssembly target features that are in phase 4 and 5.](https://github.com/rust-lang/rust/pull/117457/)
11+
- [Add the `redundant_lifetimes` lint to detect lifetimes which are semantically redundant.](https://github.com/rust-lang/rust/pull/118391/)
12+
- [Stabilize the `unnameable_types` lint for public types that can't be named.](https://github.com/rust-lang/rust/pull/120144/)
13+
- [Enable debuginfo in macros, and stabilize `-C collapse-macro-debuginfo` and `#[collapse_debuginfo]`.](https://github.com/rust-lang/rust/pull/120845/)
14+
- [Propagate temporary lifetime extension into `if` and `match` expressions.](https://github.com/rust-lang/rust/pull/121346/)
15+
- [Restrict promotion of `const fn` calls.](https://github.com/rust-lang/rust/pull/121557/)
16+
- [Warn against refining impls of crate-private traits with `refining_impl_trait` lint.](https://github.com/rust-lang/rust/pull/121720/)
17+
- [Stabilize associated type bounds (RFC 2289).](https://github.com/rust-lang/rust/pull/122055/)
18+
- [Stabilize importing `main` from other modules or crates.](https://github.com/rust-lang/rust/pull/122060/)
19+
- [Check return types of function types for well-formedness](https://github.com/rust-lang/rust/pull/115538)
20+
- [Rework `impl Trait` lifetime inference](https://github.com/rust-lang/rust/pull/116891/)
21+
- [Change inductive trait solver cycles to be ambiguous](https://github.com/rust-lang/rust/pull/122791)
22+
23+
<a id="1.79.0-Compiler"></a>
24+
25+
Compiler
26+
--------
27+
- [Define `-C strip` to only affect binaries, not artifacts like `.pdb`.](https://github.com/rust-lang/rust/pull/115120/)
28+
- [Stabilize `-Crelro-level` for controlling runtime link hardening.](https://github.com/rust-lang/rust/pull/121694/)
29+
- [Stabilize checking of `cfg` names and values at compile-time with `--check-cfg`.](https://github.com/rust-lang/rust/pull/123501/)
30+
*Note that this only stabilizes the compiler part, the Cargo part is still unstable in this release.*
31+
- [Add `aarch64-apple-visionos` and `aarch64-apple-visionos-sim` tier 3 targets.](https://github.com/rust-lang/rust/pull/121419/)
32+
- [Add `riscv32ima-unknown-none-elf` tier 3 target.](https://github.com/rust-lang/rust/pull/122696/)
33+
- [Promote several Windows targets to tier 2](https://github.com/rust-lang/rust/pull/121712): `aarch64-pc-windows-gnullvm`, `i686-pc-windows-gnullvm`, and `x86_64-pc-windows-gnullvm`.
34+
35+
Refer to Rust's [platform support page][platform-support-doc]
36+
for more information on Rust's tiered platform support.
37+
38+
<a id="1.79.0-Libraries"></a>
39+
40+
Libraries
41+
---------
42+
43+
- [Implement `FromIterator` for `(impl Default + Extend, impl Default + Extend)`.](https://github.com/rust-lang/rust/pull/107462/)
44+
- [Implement `{Div,Rem}Assign<NonZero<X>>` on `X`.](https://github.com/rust-lang/rust/pull/121952/)
45+
- [Document overrides of `clone_from()` in core/std.](https://github.com/rust-lang/rust/pull/122201/)
46+
- [Link MSVC default lib in core.](https://github.com/rust-lang/rust/pull/122268/)
47+
- [Caution against using `transmute` between pointers and integers.](https://github.com/rust-lang/rust/pull/122379/)
48+
- [Enable frame pointers for the standard library.](https://github.com/rust-lang/rust/pull/122646/)
49+
50+
<a id="1.79.0-Stabilized-APIs"></a>
51+
52+
Stabilized APIs
53+
---------------
54+
55+
- [`{integer}::unchecked_add`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_add)
56+
- [`{integer}::unchecked_mul`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_mul)
57+
- [`{integer}::unchecked_sub`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_sub)
58+
- [`<[T]>::split_at_unchecked`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_unchecked)
59+
- [`<[T]>::split_at_mut_unchecked`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_unchecked)
60+
- [`<[u8]>::utf8_chunks`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.utf8_chunks)
61+
- [`str::Utf8Chunks`](https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunks.html)
62+
- [`str::Utf8Chunk`](https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunk.html)
63+
- [`<*const T>::is_aligned`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned)
64+
- [`<*mut T>::is_aligned`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned-1)
65+
- [`NonNull::is_aligned`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_aligned)
66+
- [`<*const [T]>::len`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len)
67+
- [`<*mut [T]>::len`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len-1)
68+
- [`<*const [T]>::is_empty`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty)
69+
- [`<*mut [T]>::is_empty`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty-1)
70+
- [`NonNull::<[T]>::is_empty`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_empty)
71+
- [`CStr::count_bytes`](https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes)
72+
- [`io::Error::downcast`](https://doc.rust-lang.org/stable/std/io/struct.Error.html#method.downcast)
73+
- [`num::NonZero<T>`](https://doc.rust-lang.org/stable/core/num/struct.NonZero.html)
74+
- [`path::absolute`](https://doc.rust-lang.org/stable/std/path/fn.absolute.html)
75+
- [`proc_macro::Literal::byte_character`](https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.byte_character)
76+
- [`proc_macro::Literal::c_string`](https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.c_string)
77+
78+
These APIs are now stable in const contexts:
79+
80+
- [`Atomic*::into_inner`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.into_inner)
81+
- [`io::Cursor::new`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.new)
82+
- [`io::Cursor::get_ref`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_ref)
83+
- [`io::Cursor::position`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.position)
84+
- [`io::empty`](https://doc.rust-lang.org/stable/std/io/fn.empty.html)
85+
- [`io::repeat`](https://doc.rust-lang.org/stable/std/io/fn.repeat.html)
86+
- [`io::sink`](https://doc.rust-lang.org/stable/std/io/fn.sink.html)
87+
- [`panic::Location::caller`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.caller)
88+
- [`panic::Location::file`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.file)
89+
- [`panic::Location::line`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.line)
90+
- [`panic::Location::column`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.column)
91+
92+
<a id="1.79.0-Cargo"></a>
93+
94+
Cargo
95+
-----
96+
97+
- [Prevent dashes in `lib.name`, always normalizing to `_`.](https://github.com/rust-lang/cargo/pull/12783/)
98+
- [Stabilize MSRV-aware version requirement selection in `cargo add`.](https://github.com/rust-lang/cargo/pull/13608/)
99+
- [Switch to using `gitoxide` by default for listing files.](https://github.com/rust-lang/cargo/pull/13696/)
100+
- [Error on `[project]` in Edition 2024; `cargo fix --edition` will change it to `[package]`.](https://github.com/rust-lang/cargo/pull/13747/)
101+
102+
<a id="1.79.0-Rustdoc"></a>
103+
104+
Rustdoc
105+
-----
106+
107+
- [Always display stability version even if it's the same as the containing item.](https://github.com/rust-lang/rust/pull/118441/)
108+
- [Show a single search result for items with multiple paths.](https://github.com/rust-lang/rust/pull/119912/)
109+
- [Support typing `/` in docs to begin a search.](https://github.com/rust-lang/rust/pull/123355/)
110+
111+
<a id="1.79.0-Misc"></a>
112+
113+
Misc
114+
----
115+
116+
<a id="1.79.0-Compatibility-Notes"></a>
117+
118+
Compatibility Notes
119+
-------------------
120+
121+
- [Update the minimum external LLVM to 17.](https://github.com/rust-lang/rust/pull/122649/)
122+
- [`RustcEncodable` and `RustcDecodable` are soft-destabilized, to be removed
123+
from the prelude in next edition.](https://github.com/rust-lang/rust/pull/116016/)
124+
- [The `wasm_c_abi` future-incompatibility lint will warn about use of the
125+
non-spec-compliant C ABI.](https://github.com/rust-lang/rust/pull/117918/)
126+
Use `wasm-bindgen v0.2.88` to generate forward-compatible bindings.
127+
- [Check return types of function types for well-formedness](https://github.com/rust-lang/rust/pull/115538)
128+
1129
Version 1.78.0 (2024-05-02)
2130
==========================
3131

compiler/rustc_mir_transform/src/gvn.rs

+87-12
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
//! that contain `AllocId`s.
8484
8585
use rustc_const_eval::const_eval::DummyMachine;
86-
use rustc_const_eval::interpret::{intern_const_alloc_for_constprop, MemoryKind};
87-
use rustc_const_eval::interpret::{ImmTy, InterpCx, OpTy, Projectable, Scalar};
86+
use rustc_const_eval::interpret::{intern_const_alloc_for_constprop, MemPlaceMeta, MemoryKind};
87+
use rustc_const_eval::interpret::{ImmTy, Immediate, InterpCx, OpTy, Projectable, Scalar};
8888
use rustc_data_structures::fx::FxIndexSet;
8989
use rustc_data_structures::graph::dominators::Dominators;
9090
use rustc_hir::def::DefKind;
@@ -99,7 +99,7 @@ use rustc_middle::ty::layout::{HasParamEnv, LayoutOf};
9999
use rustc_middle::ty::{self, Ty, TyCtxt};
100100
use rustc_span::def_id::DefId;
101101
use rustc_span::DUMMY_SP;
102-
use rustc_target::abi::{self, Abi, Size, VariantIdx, FIRST_VARIANT};
102+
use rustc_target::abi::{self, Abi, FieldIdx, Size, VariantIdx, FIRST_VARIANT};
103103
use smallvec::SmallVec;
104104
use std::borrow::Cow;
105105

@@ -177,6 +177,12 @@ enum AggregateTy<'tcx> {
177177
Array,
178178
Tuple,
179179
Def(DefId, ty::GenericArgsRef<'tcx>),
180+
RawPtr {
181+
/// Needed for cast propagation.
182+
data_pointer_ty: Ty<'tcx>,
183+
/// The data pointer can be anything thin, so doesn't determine the output.
184+
output_pointer_ty: Ty<'tcx>,
185+
},
180186
}
181187

182188
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
@@ -385,11 +391,22 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
385391
AggregateTy::Def(def_id, args) => {
386392
self.tcx.type_of(def_id).instantiate(self.tcx, args)
387393
}
394+
AggregateTy::RawPtr { output_pointer_ty, .. } => output_pointer_ty,
388395
};
389396
let variant = if ty.is_enum() { Some(variant) } else { None };
390397
let ty = self.ecx.layout_of(ty).ok()?;
391398
if ty.is_zst() {
392399
ImmTy::uninit(ty).into()
400+
} else if matches!(kind, AggregateTy::RawPtr { .. }) {
401+
// Pointers don't have fields, so don't `project_field` them.
402+
let data = self.ecx.read_pointer(fields[0]).ok()?;
403+
let meta = if fields[1].layout.is_zst() {
404+
MemPlaceMeta::None
405+
} else {
406+
MemPlaceMeta::Meta(self.ecx.read_scalar(fields[1]).ok()?)
407+
};
408+
let ptr_imm = Immediate::new_pointer_with_meta(data, meta, &self.ecx);
409+
ImmTy::from_immediate(ptr_imm, ty).into()
393410
} else if matches!(ty.abi, Abi::Scalar(..) | Abi::ScalarPair(..)) {
394411
let dest = self.ecx.allocate(ty, MemoryKind::Stack).ok()?;
395412
let variant_dest = if let Some(variant) = variant {
@@ -864,10 +881,10 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
864881
rvalue: &mut Rvalue<'tcx>,
865882
location: Location,
866883
) -> Option<VnIndex> {
867-
let Rvalue::Aggregate(box ref kind, ref mut fields) = *rvalue else { bug!() };
884+
let Rvalue::Aggregate(box ref kind, ref mut field_ops) = *rvalue else { bug!() };
868885

869886
let tcx = self.tcx;
870-
if fields.is_empty() {
887+
if field_ops.is_empty() {
871888
let is_zst = match *kind {
872889
AggregateKind::Array(..)
873890
| AggregateKind::Tuple
@@ -886,13 +903,13 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
886903
}
887904
}
888905

889-
let (ty, variant_index) = match *kind {
906+
let (mut ty, variant_index) = match *kind {
890907
AggregateKind::Array(..) => {
891-
assert!(!fields.is_empty());
908+
assert!(!field_ops.is_empty());
892909
(AggregateTy::Array, FIRST_VARIANT)
893910
}
894911
AggregateKind::Tuple => {
895-
assert!(!fields.is_empty());
912+
assert!(!field_ops.is_empty());
896913
(AggregateTy::Tuple, FIRST_VARIANT)
897914
}
898915
AggregateKind::Closure(did, args)
@@ -903,15 +920,49 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
903920
}
904921
// Do not track unions.
905922
AggregateKind::Adt(_, _, _, _, Some(_)) => return None,
906-
// FIXME: Do the extra work to GVN `from_raw_parts`
907-
AggregateKind::RawPtr(..) => return None,
923+
AggregateKind::RawPtr(pointee_ty, mtbl) => {
924+
assert_eq!(field_ops.len(), 2);
925+
let data_pointer_ty = field_ops[FieldIdx::ZERO].ty(self.local_decls, self.tcx);
926+
let output_pointer_ty = Ty::new_ptr(self.tcx, pointee_ty, mtbl);
927+
(AggregateTy::RawPtr { data_pointer_ty, output_pointer_ty }, FIRST_VARIANT)
928+
}
908929
};
909930

910-
let fields: Option<Vec<_>> = fields
931+
let fields: Option<Vec<_>> = field_ops
911932
.iter_mut()
912933
.map(|op| self.simplify_operand(op, location).or_else(|| self.new_opaque()))
913934
.collect();
914-
let fields = fields?;
935+
let mut fields = fields?;
936+
937+
if let AggregateTy::RawPtr { data_pointer_ty, output_pointer_ty } = &mut ty {
938+
let mut was_updated = false;
939+
940+
// Any thin pointer of matching mutability is fine as the data pointer.
941+
while let Value::Cast {
942+
kind: CastKind::PtrToPtr,
943+
value: cast_value,
944+
from: cast_from,
945+
to: _,
946+
} = self.get(fields[0])
947+
&& let ty::RawPtr(from_pointee_ty, from_mtbl) = cast_from.kind()
948+
&& let ty::RawPtr(_, output_mtbl) = output_pointer_ty.kind()
949+
&& from_mtbl == output_mtbl
950+
&& from_pointee_ty.is_sized(self.tcx, self.param_env)
951+
{
952+
fields[0] = *cast_value;
953+
*data_pointer_ty = *cast_from;
954+
was_updated = true;
955+
}
956+
957+
if was_updated {
958+
if let Some(const_) = self.try_as_constant(fields[0]) {
959+
field_ops[FieldIdx::ZERO] = Operand::Constant(Box::new(const_));
960+
} else if let Some(local) = self.try_as_local(fields[0], location) {
961+
field_ops[FieldIdx::ZERO] = Operand::Copy(Place::from(local));
962+
self.reused_locals.insert(local);
963+
}
964+
}
965+
}
915966

916967
if let AggregateTy::Array = ty
917968
&& fields.len() > 4
@@ -943,6 +994,9 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
943994
(UnOp::Not, Value::BinaryOp(BinOp::Ne, lhs, rhs)) => {
944995
Value::BinaryOp(BinOp::Eq, *lhs, *rhs)
945996
}
997+
(UnOp::PtrMetadata, Value::Aggregate(AggregateTy::RawPtr { .. }, _, fields)) => {
998+
return Some(fields[1]);
999+
}
9461000
_ => return None,
9471001
};
9481002

@@ -1094,6 +1148,23 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
10941148
return self.new_opaque();
10951149
}
10961150

1151+
let mut was_updated = false;
1152+
1153+
// If that cast just casts away the metadata again,
1154+
if let PtrToPtr = kind
1155+
&& let Value::Aggregate(AggregateTy::RawPtr { data_pointer_ty, .. }, _, fields) =
1156+
self.get(value)
1157+
&& let ty::RawPtr(to_pointee, _) = to.kind()
1158+
&& to_pointee.is_sized(self.tcx, self.param_env)
1159+
{
1160+
from = *data_pointer_ty;
1161+
value = fields[0];
1162+
was_updated = true;
1163+
if *data_pointer_ty == to {
1164+
return Some(fields[0]);
1165+
}
1166+
}
1167+
10971168
if let PtrToPtr | PointerCoercion(MutToConstPointer) = kind
10981169
&& let Value::Cast { kind: inner_kind, value: inner_value, from: inner_from, to: _ } =
10991170
*self.get(value)
@@ -1102,9 +1173,13 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
11021173
from = inner_from;
11031174
value = inner_value;
11041175
*kind = PtrToPtr;
1176+
was_updated = true;
11051177
if inner_from == to {
11061178
return Some(inner_value);
11071179
}
1180+
}
1181+
1182+
if was_updated {
11081183
if let Some(const_) = self.try_as_constant(value) {
11091184
*operand = Operand::Constant(Box::new(const_));
11101185
} else if let Some(local) = self.try_as_local(value, location) {

library/core/src/num/f128.rs

+7
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ pub mod consts {
6868
pub const FRAC_1_SQRT_PI: f128 =
6969
0.564189583547756286948079451560772585844050629328998856844086_f128;
7070

71+
/// 1/sqrt(2π)
72+
#[doc(alias = "FRAC_1_SQRT_TAU")]
73+
#[unstable(feature = "f128", issue = "116909")]
74+
// Also, #[unstable(feature = "more_float_constants", issue = "103883")]
75+
pub const FRAC_1_SQRT_2PI: f128 =
76+
0.398942280401432677939946059934381868475858631164934657665926_f128;
77+
7178
/// 2/π
7279
#[unstable(feature = "f128", issue = "116909")]
7380
pub const FRAC_2_PI: f128 = 0.636619772367581343075535053490057448137838582961825794990669_f128;

library/core/src/num/f16.rs

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ pub mod consts {
6767
// Also, #[unstable(feature = "more_float_constants", issue = "103883")]
6868
pub const FRAC_1_SQRT_PI: f16 = 0.564189583547756286948079451560772586_f16;
6969

70+
/// 1/sqrt(2π)
71+
#[doc(alias = "FRAC_1_SQRT_TAU")]
72+
#[unstable(feature = "f16", issue = "116909")]
73+
// Also, #[unstable(feature = "more_float_constants", issue = "103883")]
74+
pub const FRAC_1_SQRT_2PI: f16 = 0.398942280401432677939946059934381868_f16;
75+
7076
/// 2/π
7177
#[unstable(feature = "f16", issue = "116909")]
7278
pub const FRAC_2_PI: f16 = 0.636619772367581343075535053490057448_f16;

library/core/src/num/f32.rs

+5
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ pub mod consts {
327327
#[unstable(feature = "more_float_constants", issue = "103883")]
328328
pub const FRAC_1_SQRT_PI: f32 = 0.564189583547756286948079451560772586_f32;
329329

330+
/// 1/sqrt(2π)
331+
#[doc(alias = "FRAC_1_SQRT_TAU")]
332+
#[unstable(feature = "more_float_constants", issue = "103883")]
333+
pub const FRAC_1_SQRT_2PI: f32 = 0.398942280401432677939946059934381868_f32;
334+
330335
/// 2/π
331336
#[stable(feature = "rust1", since = "1.0.0")]
332337
pub const FRAC_2_PI: f32 = 0.636619772367581343075535053490057448_f32;

library/core/src/num/f64.rs

+5
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ pub mod consts {
327327
#[unstable(feature = "more_float_constants", issue = "103883")]
328328
pub const FRAC_1_SQRT_PI: f64 = 0.564189583547756286948079451560772586_f64;
329329

330+
/// 1/sqrt(2π)
331+
#[doc(alias = "FRAC_1_SQRT_TAU")]
332+
#[unstable(feature = "more_float_constants", issue = "103883")]
333+
pub const FRAC_1_SQRT_2PI: f64 = 0.398942280401432677939946059934381868_f64;
334+
330335
/// 2/π
331336
#[stable(feature = "rust1", since = "1.0.0")]
332337
pub const FRAC_2_PI: f64 = 0.636619772367581343075535053490057448_f64;

src/bootstrap/src/core/build_steps/dist.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,21 @@ impl Step for PlainSourceTarball {
10411041
.env("RUSTC_BOOTSTRAP", "1")
10421042
.current_dir(plain_dst_src);
10431043

1044+
// Vendor packages that are required by opt-dist to collect PGO profiles.
1045+
let pkgs_for_pgo_training = build_helper::LLVM_PGO_CRATES
1046+
.iter()
1047+
.chain(build_helper::RUSTC_PGO_CRATES)
1048+
.map(|pkg| {
1049+
let mut manifest_path =
1050+
builder.src.join("./src/tools/rustc-perf/collector/compile-benchmarks");
1051+
manifest_path.push(pkg);
1052+
manifest_path.push("Cargo.toml");
1053+
manifest_path
1054+
});
1055+
for manifest_path in pkgs_for_pgo_training {
1056+
cmd.arg("--sync").arg(manifest_path);
1057+
}
1058+
10441059
let config = if !builder.config.dry_run() {
10451060
t!(String::from_utf8(t!(cmd.output()).stdout))
10461061
} else {

src/tools/build_helper/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Types and functions shared across tools in this workspace.

0 commit comments

Comments
 (0)