Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #122925

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9d66b1b
ci: Build gccjit from a git archive
cuviper Mar 17, 2024
7936e18
Use the rust-lang/gcc repo directly
cuviper Mar 17, 2024
f512f9e
Use `pushd` and `popd`
cuviper Mar 17, 2024
986f23e
Cancel `cargo update` job if there's no changes
clubby789 Mar 18, 2024
c828984
Rework rmake support library to have a weakly-typed API with helper m…
jieyouxu Mar 13, 2024
963844b
Use `arch::wasm::unreachable` instead of `arch::wasm32::unreachable`
newpavlov Mar 22, 2024
2624e91
Soft-destabilize `RustcEncodable`/`RustcDecodable`
jhpratt Sep 21, 2023
fbf21c5
Remove RustcEncodable/Decodable from 2024 prelude
jhpratt Sep 21, 2023
807bd98
Delay a bug if no RPITITs were found
fmease Mar 22, 2024
e853b50
docs(sync): normalize dot in fn summaries
MultisampledNight Mar 22, 2024
07994c9
Enable more mir-opt tests in debug builds
saethlin Mar 22, 2024
44d185b
-Zprint-type-sizes: print the types of awaitees and unnamed coroutine…
kpreid Mar 22, 2024
fe518a6
Rollup merge of #116016 - jhpratt:kill-rustc-serialize, r=dtolnay
matthiaskrgr Mar 23, 2024
a3f7fb3
Rollup merge of #122460 - jieyouxu:rmake-example-refactor, r=Nilstrieb
matthiaskrgr Mar 23, 2024
3f1240e
Rollup merge of #122658 - cuviper:gccjit-archive, r=Mark-Simulacrum
matthiaskrgr Mar 23, 2024
9d1610d
Rollup merge of #122698 - clubby789:cancel-hourly-update, r=Mark-Simu…
matthiaskrgr Mar 23, 2024
6ef7a67
Rollup merge of #122878 - newpavlov:patch-2, r=Mark-Simulacrum
matthiaskrgr Mar 23, 2024
a47688d
Rollup merge of #122915 - fmease:lt-opaq-mismatch-delay-bug, r=compil…
matthiaskrgr Mar 23, 2024
aa534e3
Rollup merge of #122916 - MultisampledNight:docs-sync-typo, r=jhpratt
matthiaskrgr Mar 23, 2024
aecc7fd
Rollup merge of #122921 - saethlin:mir-opt-tests-in-debug, r=Mark-Sim…
matthiaskrgr Mar 23, 2024
9ac1c80
Rollup merge of #122922 - kpreid:print-async, r=compiler-errors
matthiaskrgr Mar 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Exit with error if open and S-waiting-on-bors
if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then
exit 1
gh run cancel ${{ github.run_id }}
fi

update:
Expand All @@ -65,7 +65,10 @@ jobs:

- name: cargo update
# Remove first line that always just says "Updating crates.io index"
run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
# If there are no changes, cancel the job here
run: |
cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
git status --porcelain | grep -q Cargo.lock || gh run cancel ${{ github.run_id }}
- name: upload Cargo.lock artifact for use in PR
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -131,7 +134,7 @@ jobs:
# Exit with error if PR is closed
STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state')
if [[ "$STATE" != "OPEN" ]]; then
exit 1
gh run cancel ${{ github.run_id }}
fi

gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY
Expand Down
7 changes: 3 additions & 4 deletions compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,10 +639,9 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
}
}

if !unnormalized_trait_sig.output().references_error() {
debug_assert!(
!collector.types.is_empty(),
"expect >0 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`"
if !unnormalized_trait_sig.output().references_error() && collector.types.is_empty() {
tcx.dcx().delayed_bug(
"expect >0 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`",
);
}

Expand Down
18 changes: 14 additions & 4 deletions compiler/rustc_session/src/code_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ pub struct FieldInfo {
pub offset: u64,
pub size: u64,
pub align: u64,
/// Name of the type of this field.
/// Present only if the creator thought that this would be important for identifying the field,
/// typically because the field name is uninformative.
pub type_name: Option<Symbol>,
}

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

for field in fields {
let FieldInfo { kind, ref name, offset, size, align } = field;
let FieldInfo { kind, ref name, offset, size, align, type_name } = field;

if offset > min_offset {
let pad = offset - min_offset;
Expand All @@ -201,21 +205,27 @@ impl CodeStats {

if offset < min_offset {
// If this happens it's probably a union.
println!(
print!(
"print-type-size {indent}{kind} `.{name}`: {size} bytes, \
offset: {offset} bytes, \
alignment: {align} bytes"
);
} else if info.packed || offset == min_offset {
println!("print-type-size {indent}{kind} `.{name}`: {size} bytes");
print!("print-type-size {indent}{kind} `.{name}`: {size} bytes");
} else {
// Include field alignment in output only if it caused padding injection
println!(
print!(
"print-type-size {indent}{kind} `.{name}`: {size} bytes, \
alignment: {align} bytes"
);
}

if let Some(type_name) = type_name {
println!(", type: {type_name}");
} else {
println!();
}

min_offset = offset + size;
}
}
Expand Down
10 changes: 9 additions & 1 deletion compiler/rustc_ty_utils/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use rustc_middle::ty::layout::{
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, AdtDef, EarlyBinder, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt};
use rustc_session::{DataTypeKind, FieldInfo, FieldKind, SizeKind, VariantInfo};
use rustc_span::sym;
use rustc_span::symbol::Symbol;
use rustc_target::abi::*;

Expand Down Expand Up @@ -1007,6 +1008,7 @@ fn variant_info_for_adt<'tcx>(
offset: offset.bytes(),
size: field_layout.size.bytes(),
align: field_layout.align.abi.bytes(),
type_name: None,
}
})
.collect();
Expand Down Expand Up @@ -1090,6 +1092,7 @@ fn variant_info_for_coroutine<'tcx>(
offset: offset.bytes(),
size: field_layout.size.bytes(),
align: field_layout.align.abi.bytes(),
type_name: None,
}
})
.collect();
Expand All @@ -1104,19 +1107,24 @@ fn variant_info_for_coroutine<'tcx>(
.iter()
.enumerate()
.map(|(field_idx, local)| {
let field_name = coroutine.field_names[*local];
let field_layout = variant_layout.field(cx, field_idx);
let offset = variant_layout.fields.offset(field_idx);
// The struct is as large as the last field's end
variant_size = variant_size.max(offset + field_layout.size);
FieldInfo {
kind: FieldKind::CoroutineLocal,
name: coroutine.field_names[*local].unwrap_or(Symbol::intern(&format!(
name: field_name.unwrap_or(Symbol::intern(&format!(
".coroutine_field{}",
local.as_usize()
))),
offset: offset.bytes(),
size: field_layout.size.bytes(),
align: field_layout.align.abi.bytes(),
// Include the type name if there is no field name, or if the name is the
// __awaitee placeholder symbol which means a child future being `.await`ed.
type_name: (field_name.is_none() || field_name == Some(sym::__awaitee))
.then(|| Symbol::intern(&field_layout.ty.to_string())),
}
})
.chain(upvar_fields.iter().copied())
Expand Down
20 changes: 14 additions & 6 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1726,20 +1726,28 @@ pub(crate) mod builtin {
builtin # deref($pat)
}

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

/// Unstable implementation detail of the `rustc` compiler, do not use.
/// Derive macro for `rustc-serialize`. Should not be used in new code.
#[rustc_builtin_macro]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(core_intrinsics, rt)]
#[unstable(
feature = "rustc_encodable_decodable",
issue = "none",
soft,
reason = "derive macro for `rustc-serialize`; should not be used in new code"
)]
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
pub macro RustcEncodable($item:item) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! The first version of the core prelude.
//! Items common to the prelude of all editions.
//!
//! See the [module-level documentation](super) for more.

#![stable(feature = "core_prelude", since = "1.4.0")]

// Re-exported core operators
#[stable(feature = "core_prelude", since = "1.4.0")]
#[doc(no_inline)]
Expand Down Expand Up @@ -68,11 +66,6 @@ pub use crate::{
#[doc(no_inline)]
pub use crate::concat_bytes;

// Do not `doc(inline)` these `doc(hidden)` items.
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow(deprecated)]
pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};

// Do not `doc(no_inline)` so that they become doc items on their own
// (no public module for them to be re-exported from).
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down
34 changes: 30 additions & 4 deletions library/core/src/prelude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@

#![stable(feature = "core_prelude", since = "1.4.0")]

pub mod v1;
mod common;

/// The first version of the prelude of The Rust Standard Library.
///
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
pub mod v1 {
#[stable(feature = "rust1", since = "1.0.0")]
pub use super::common::*;

// Do not `doc(inline)` these `doc(hidden)` items.
#[unstable(
feature = "rustc_encodable_decodable",
issue = "none",
soft,
reason = "derive macro for `rustc-serialize`; should not be used in new code"
)]
#[allow(deprecated)]
pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};
}

/// The 2015 version of the core prelude.
///
Expand Down Expand Up @@ -46,14 +65,21 @@ pub mod rust_2021 {
pub use crate::convert::{TryFrom, TryInto};
}

/// The 2024 edition of the core prelude.
/// The 2024 version of the core prelude.
///
/// See the [module-level documentation](self) for more.
#[unstable(feature = "prelude_2024", issue = "121042")]
pub mod rust_2024 {
#[unstable(feature = "prelude_2024", issue = "121042")]
#[stable(feature = "rust1", since = "1.0.0")]
pub use super::common::*;

#[stable(feature = "prelude_2021", since = "1.55.0")]
#[doc(no_inline)]
pub use crate::iter::FromIterator;

#[stable(feature = "prelude_2021", since = "1.55.0")]
#[doc(no_inline)]
pub use super::rust_2021::*;
pub use crate::convert::{TryFrom, TryInto};

#[unstable(feature = "prelude_2024", issue = "121042")]
#[doc(no_inline)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! The first version of the prelude of The Rust Standard Library.
//! Items common to the prelude of all editions.
//!
//! See the [module-level documentation](super) for more.

#![stable(feature = "rust1", since = "1.0.0")]

// Re-exported core operators
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
Expand Down Expand Up @@ -52,11 +50,6 @@ pub use core::prelude::v1::{
#[doc(no_inline)]
pub use core::prelude::v1::concat_bytes;

// Do not `doc(inline)` these `doc(hidden)` items.
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow(deprecated)]
pub use core::prelude::v1::{RustcDecodable, RustcEncodable};

// Do not `doc(no_inline)` so that they become doc items on their own
// (no public module for them to be re-exported from).
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down
26 changes: 22 additions & 4 deletions library/std/src/prelude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,26 @@

#![stable(feature = "rust1", since = "1.0.0")]

pub mod v1;
mod common;

/// The first version of the prelude of The Rust Standard Library.
///
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
pub mod v1 {
#[stable(feature = "rust1", since = "1.0.0")]
pub use super::common::*;

// Do not `doc(inline)` these `doc(hidden)` items.
#[unstable(
feature = "rustc_encodable_decodable",
issue = "none",
soft,
reason = "derive macro for `rustc-serialize`; should not be used in new code"
)]
#[allow(deprecated)]
pub use core::prelude::v1::{RustcDecodable, RustcEncodable};
}

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

#[unstable(feature = "prelude_2024", issue = "121042")]
#[doc(no_inline)]
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ impl<T: ?Sized> Mutex<T> {
self.poison.get()
}

/// Clear the poisoned state from a mutex
/// Clear the poisoned state from a mutex.
///
/// If the mutex is poisoned, it will remain poisoned until this function is called. This
/// allows recovering from a poisoned state and marking that it has recovered. For example, if
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl<T: ?Sized> RwLock<T> {
self.poison.get()
}

/// Clear the poisoned state from a lock
/// Clear the poisoned state from a lock.
///
/// If the lock is poisoned, it will remain poisoned until this function is called. This allows
/// recovering from a poisoned state and marking that it has recovered. For example, if the
Expand Down
2 changes: 1 addition & 1 deletion library/unwind/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub unsafe fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwi
wasm_throw(0, exception.cast())
} else {
let _ = exception;
core::arch::wasm32::unreachable()
core::arch::wasm::unreachable()
}
}
}
18 changes: 11 additions & 7 deletions src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/usr/bin/env bash

GIT_REPO="https://github.com/rust-lang/gcc"

# This commit hash needs to be updated to use a more recent gcc fork version.
GIT_COMMIT="78dc50f0e50e6cd1433149520bd512a4e0eaa1bc"

set -ex

cd $1

source shared.sh

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

mkdir ../gcc-build ../gcc-install
cd ../gcc-build
mkdir gcc-build gcc-install
pushd gcc-build

# Building GCC.
hide_output \
Expand All @@ -28,6 +31,7 @@ hide_output \
hide_output make -j$(nproc)
hide_output make install

rm -rf ../gcc-src
popd
rm -rf gcc-src gcc-build
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so.0
Loading
Loading