Skip to content

Commit 2594896

Browse files
committed
Auto merge of rust-lang#122925 - matthiaskrgr:rollup-2afe4wp, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang#116016 (Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition) - rust-lang#122460 (Rework rmake support library API) - rust-lang#122658 (ci: Build gccjit from a git archive) - rust-lang#122698 (Cancel `cargo update` job if there's no updates) - rust-lang#122878 (Use `arch::wasm::unreachable` instead of `arch::wasm32::unreachable`) - rust-lang#122915 (Delay a bug if no RPITITs were found) - rust-lang#122916 (docs(sync): normalize dot in fn summaries) - rust-lang#122921 (Enable more mir-opt tests in debug builds) - rust-lang#122922 (-Zprint-type-sizes: print the types of awaitees and unnamed coroutine locals.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c3b05c6 + 9ac1c80 commit 2594896

File tree

44 files changed

+527
-262
lines changed

Some content is hidden

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

44 files changed

+527
-262
lines changed

Diff for: .github/workflows/dependencies.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
4343
# Exit with error if open and S-waiting-on-bors
4444
if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then
45-
exit 1
45+
gh run cancel ${{ github.run_id }}
4646
fi
4747
4848
update:
@@ -65,7 +65,10 @@ jobs:
6565
6666
- name: cargo update
6767
# Remove first line that always just says "Updating crates.io index"
68-
run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
68+
# If there are no changes, cancel the job here
69+
run: |
70+
cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
71+
git status --porcelain | grep -q Cargo.lock || gh run cancel ${{ github.run_id }}
6972
- name: upload Cargo.lock artifact for use in PR
7073
uses: actions/upload-artifact@v3
7174
with:
@@ -131,7 +134,7 @@ jobs:
131134
# Exit with error if PR is closed
132135
STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state')
133136
if [[ "$STATE" != "OPEN" ]]; then
134-
exit 1
137+
gh run cancel ${{ github.run_id }}
135138
fi
136139
137140
gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY

Diff for: compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -639,10 +639,9 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
639639
}
640640
}
641641

642-
if !unnormalized_trait_sig.output().references_error() {
643-
debug_assert!(
644-
!collector.types.is_empty(),
645-
"expect >0 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`"
642+
if !unnormalized_trait_sig.output().references_error() && collector.types.is_empty() {
643+
tcx.dcx().delayed_bug(
644+
"expect >0 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`",
646645
);
647646
}
648647

Diff for: compiler/rustc_session/src/code_stats.rs

+14-4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ pub struct FieldInfo {
4444
pub offset: u64,
4545
pub size: u64,
4646
pub align: u64,
47+
/// Name of the type of this field.
48+
/// Present only if the creator thought that this would be important for identifying the field,
49+
/// typically because the field name is uninformative.
50+
pub type_name: Option<Symbol>,
4751
}
4852

4953
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
@@ -192,7 +196,7 @@ impl CodeStats {
192196
fields.sort_by_key(|f| (f.offset, f.size));
193197

194198
for field in fields {
195-
let FieldInfo { kind, ref name, offset, size, align } = field;
199+
let FieldInfo { kind, ref name, offset, size, align, type_name } = field;
196200

197201
if offset > min_offset {
198202
let pad = offset - min_offset;
@@ -201,21 +205,27 @@ impl CodeStats {
201205

202206
if offset < min_offset {
203207
// If this happens it's probably a union.
204-
println!(
208+
print!(
205209
"print-type-size {indent}{kind} `.{name}`: {size} bytes, \
206210
offset: {offset} bytes, \
207211
alignment: {align} bytes"
208212
);
209213
} else if info.packed || offset == min_offset {
210-
println!("print-type-size {indent}{kind} `.{name}`: {size} bytes");
214+
print!("print-type-size {indent}{kind} `.{name}`: {size} bytes");
211215
} else {
212216
// Include field alignment in output only if it caused padding injection
213-
println!(
217+
print!(
214218
"print-type-size {indent}{kind} `.{name}`: {size} bytes, \
215219
alignment: {align} bytes"
216220
);
217221
}
218222

223+
if let Some(type_name) = type_name {
224+
println!(", type: {type_name}");
225+
} else {
226+
println!();
227+
}
228+
219229
min_offset = offset + size;
220230
}
221231
}

Diff for: compiler/rustc_ty_utils/src/layout.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use rustc_middle::ty::layout::{
1010
use rustc_middle::ty::print::with_no_trimmed_paths;
1111
use rustc_middle::ty::{self, AdtDef, EarlyBinder, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt};
1212
use rustc_session::{DataTypeKind, FieldInfo, FieldKind, SizeKind, VariantInfo};
13+
use rustc_span::sym;
1314
use rustc_span::symbol::Symbol;
1415
use rustc_target::abi::*;
1516

@@ -1007,6 +1008,7 @@ fn variant_info_for_adt<'tcx>(
10071008
offset: offset.bytes(),
10081009
size: field_layout.size.bytes(),
10091010
align: field_layout.align.abi.bytes(),
1011+
type_name: None,
10101012
}
10111013
})
10121014
.collect();
@@ -1090,6 +1092,7 @@ fn variant_info_for_coroutine<'tcx>(
10901092
offset: offset.bytes(),
10911093
size: field_layout.size.bytes(),
10921094
align: field_layout.align.abi.bytes(),
1095+
type_name: None,
10931096
}
10941097
})
10951098
.collect();
@@ -1104,19 +1107,24 @@ fn variant_info_for_coroutine<'tcx>(
11041107
.iter()
11051108
.enumerate()
11061109
.map(|(field_idx, local)| {
1110+
let field_name = coroutine.field_names[*local];
11071111
let field_layout = variant_layout.field(cx, field_idx);
11081112
let offset = variant_layout.fields.offset(field_idx);
11091113
// The struct is as large as the last field's end
11101114
variant_size = variant_size.max(offset + field_layout.size);
11111115
FieldInfo {
11121116
kind: FieldKind::CoroutineLocal,
1113-
name: coroutine.field_names[*local].unwrap_or(Symbol::intern(&format!(
1117+
name: field_name.unwrap_or(Symbol::intern(&format!(
11141118
".coroutine_field{}",
11151119
local.as_usize()
11161120
))),
11171121
offset: offset.bytes(),
11181122
size: field_layout.size.bytes(),
11191123
align: field_layout.align.abi.bytes(),
1124+
// Include the type name if there is no field name, or if the name is the
1125+
// __awaitee placeholder symbol which means a child future being `.await`ed.
1126+
type_name: (field_name.is_none() || field_name == Some(sym::__awaitee))
1127+
.then(|| Symbol::intern(&field_layout.ty.to_string())),
11201128
}
11211129
})
11221130
.chain(upvar_fields.iter().copied())

Diff for: library/core/src/macros/mod.rs

+14-6
Original file line numberDiff line numberDiff line change
@@ -1726,20 +1726,28 @@ pub(crate) mod builtin {
17261726
builtin # deref($pat)
17271727
}
17281728

1729-
/// Unstable implementation detail of the `rustc` compiler, do not use.
1729+
/// Derive macro for `rustc-serialize`. Should not be used in new code.
17301730
#[rustc_builtin_macro]
1731-
#[stable(feature = "rust1", since = "1.0.0")]
1732-
#[allow_internal_unstable(core_intrinsics, libstd_sys_internals, rt)]
1731+
#[unstable(
1732+
feature = "rustc_encodable_decodable",
1733+
issue = "none",
1734+
soft,
1735+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
1736+
)]
17331737
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
17341738
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
17351739
pub macro RustcDecodable($item:item) {
17361740
/* compiler built-in */
17371741
}
17381742

1739-
/// Unstable implementation detail of the `rustc` compiler, do not use.
1743+
/// Derive macro for `rustc-serialize`. Should not be used in new code.
17401744
#[rustc_builtin_macro]
1741-
#[stable(feature = "rust1", since = "1.0.0")]
1742-
#[allow_internal_unstable(core_intrinsics, rt)]
1745+
#[unstable(
1746+
feature = "rustc_encodable_decodable",
1747+
issue = "none",
1748+
soft,
1749+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
1750+
)]
17431751
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
17441752
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
17451753
pub macro RustcEncodable($item:item) {

Diff for: library/core/src/prelude/v1.rs renamed to library/core/src/prelude/common.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
//! The first version of the core prelude.
1+
//! Items common to the prelude of all editions.
22
//!
33
//! See the [module-level documentation](super) for more.
44
5-
#![stable(feature = "core_prelude", since = "1.4.0")]
6-
75
// Re-exported core operators
86
#[stable(feature = "core_prelude", since = "1.4.0")]
97
#[doc(no_inline)]
@@ -68,11 +66,6 @@ pub use crate::{
6866
#[doc(no_inline)]
6967
pub use crate::concat_bytes;
7068

71-
// Do not `doc(inline)` these `doc(hidden)` items.
72-
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
73-
#[allow(deprecated)]
74-
pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};
75-
7669
// Do not `doc(no_inline)` so that they become doc items on their own
7770
// (no public module for them to be re-exported from).
7871
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

Diff for: library/core/src/prelude/mod.rs

+30-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,26 @@
66
77
#![stable(feature = "core_prelude", since = "1.4.0")]
88

9-
pub mod v1;
9+
mod common;
10+
11+
/// The first version of the prelude of The Rust Standard Library.
12+
///
13+
/// See the [module-level documentation](self) for more.
14+
#[stable(feature = "rust1", since = "1.0.0")]
15+
pub mod v1 {
16+
#[stable(feature = "rust1", since = "1.0.0")]
17+
pub use super::common::*;
18+
19+
// Do not `doc(inline)` these `doc(hidden)` items.
20+
#[unstable(
21+
feature = "rustc_encodable_decodable",
22+
issue = "none",
23+
soft,
24+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
25+
)]
26+
#[allow(deprecated)]
27+
pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};
28+
}
1029

1130
/// The 2015 version of the core prelude.
1231
///
@@ -46,14 +65,21 @@ pub mod rust_2021 {
4665
pub use crate::convert::{TryFrom, TryInto};
4766
}
4867

49-
/// The 2024 edition of the core prelude.
68+
/// The 2024 version of the core prelude.
5069
///
5170
/// See the [module-level documentation](self) for more.
5271
#[unstable(feature = "prelude_2024", issue = "121042")]
5372
pub mod rust_2024 {
54-
#[unstable(feature = "prelude_2024", issue = "121042")]
73+
#[stable(feature = "rust1", since = "1.0.0")]
74+
pub use super::common::*;
75+
76+
#[stable(feature = "prelude_2021", since = "1.55.0")]
77+
#[doc(no_inline)]
78+
pub use crate::iter::FromIterator;
79+
80+
#[stable(feature = "prelude_2021", since = "1.55.0")]
5581
#[doc(no_inline)]
56-
pub use super::rust_2021::*;
82+
pub use crate::convert::{TryFrom, TryInto};
5783

5884
#[unstable(feature = "prelude_2024", issue = "121042")]
5985
#[doc(no_inline)]

Diff for: library/std/src/prelude/v1.rs renamed to library/std/src/prelude/common.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
//! The first version of the prelude of The Rust Standard Library.
1+
//! Items common to the prelude of all editions.
22
//!
33
//! See the [module-level documentation](super) for more.
44
5-
#![stable(feature = "rust1", since = "1.0.0")]
6-
75
// Re-exported core operators
86
#[stable(feature = "rust1", since = "1.0.0")]
97
#[doc(no_inline)]
@@ -52,11 +50,6 @@ pub use core::prelude::v1::{
5250
#[doc(no_inline)]
5351
pub use core::prelude::v1::concat_bytes;
5452

55-
// Do not `doc(inline)` these `doc(hidden)` items.
56-
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
57-
#[allow(deprecated)]
58-
pub use core::prelude::v1::{RustcDecodable, RustcEncodable};
59-
6053
// Do not `doc(no_inline)` so that they become doc items on their own
6154
// (no public module for them to be re-exported from).
6255
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

Diff for: library/std/src/prelude/mod.rs

+22-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,26 @@
9393
9494
#![stable(feature = "rust1", since = "1.0.0")]
9595

96-
pub mod v1;
96+
mod common;
97+
98+
/// The first version of the prelude of The Rust Standard Library.
99+
///
100+
/// See the [module-level documentation](self) for more.
101+
#[stable(feature = "rust1", since = "1.0.0")]
102+
pub mod v1 {
103+
#[stable(feature = "rust1", since = "1.0.0")]
104+
pub use super::common::*;
105+
106+
// Do not `doc(inline)` these `doc(hidden)` items.
107+
#[unstable(
108+
feature = "rustc_encodable_decodable",
109+
issue = "none",
110+
soft,
111+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
112+
)]
113+
#[allow(deprecated)]
114+
pub use core::prelude::v1::{RustcDecodable, RustcEncodable};
115+
}
97116

98117
/// The 2015 version of the prelude of The Rust Standard Library.
99118
///
@@ -134,9 +153,8 @@ pub mod rust_2021 {
134153
/// See the [module-level documentation](self) for more.
135154
#[unstable(feature = "prelude_2024", issue = "121042")]
136155
pub mod rust_2024 {
137-
#[unstable(feature = "prelude_2024", issue = "121042")]
138-
#[doc(no_inline)]
139-
pub use super::v1::*;
156+
#[stable(feature = "rust1", since = "1.0.0")]
157+
pub use super::common::*;
140158

141159
#[unstable(feature = "prelude_2024", issue = "121042")]
142160
#[doc(no_inline)]

Diff for: library/std/src/sync/mutex.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ impl<T: ?Sized> Mutex<T> {
396396
self.poison.get()
397397
}
398398

399-
/// Clear the poisoned state from a mutex
399+
/// Clear the poisoned state from a mutex.
400400
///
401401
/// If the mutex is poisoned, it will remain poisoned until this function is called. This
402402
/// allows recovering from a poisoned state and marking that it has recovered. For example, if

Diff for: library/std/src/sync/rwlock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl<T: ?Sized> RwLock<T> {
439439
self.poison.get()
440440
}
441441

442-
/// Clear the poisoned state from a lock
442+
/// Clear the poisoned state from a lock.
443443
///
444444
/// If the lock is poisoned, it will remain poisoned until this function is called. This allows
445445
/// recovering from a poisoned state and marking that it has recovered. For example, if the

Diff for: library/unwind/src/wasm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub unsafe fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwi
5959
wasm_throw(0, exception.cast())
6060
} else {
6161
let _ = exception;
62-
core::arch::wasm32::unreachable()
62+
core::arch::wasm::unreachable()
6363
}
6464
}
6565
}
+11-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
#!/usr/bin/env bash
22

3+
GIT_REPO="https://github.com/rust-lang/gcc"
4+
5+
# This commit hash needs to be updated to use a more recent gcc fork version.
6+
GIT_COMMIT="78dc50f0e50e6cd1433149520bd512a4e0eaa1bc"
7+
38
set -ex
49

510
cd $1
611

712
source shared.sh
813

914
# Setting up folders for GCC
10-
git clone https://github.com/antoyo/gcc gcc-src
11-
cd gcc-src
12-
# This commit hash needs to be updated to use a more recent gcc fork version.
13-
git checkout 78dc50f0e50e6cd1433149520bd512a4e0eaa1bc
15+
curl -L "$GIT_REPO/archive/$GIT_COMMIT.tar.gz" |
16+
tar -xz --transform "s/gcc-$GIT_COMMIT/gcc-src/"
1417

15-
mkdir ../gcc-build ../gcc-install
16-
cd ../gcc-build
18+
mkdir gcc-build gcc-install
19+
pushd gcc-build
1720

1821
# Building GCC.
1922
hide_output \
@@ -28,6 +31,7 @@ hide_output \
2831
hide_output make -j$(nproc)
2932
hide_output make install
3033

31-
rm -rf ../gcc-src
34+
popd
35+
rm -rf gcc-src gcc-build
3236
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
3337
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so.0

0 commit comments

Comments
 (0)