Skip to content

Rollup of 8 pull requests #142059

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

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2b0797a
UnsafePinned: also include the effects of UnsafeCell
RalfJung May 4, 2025
259d6f4
add Miri tests
RalfJung May 4, 2025
033ea63
Do not run PGO/BOLT in x64 Linux alt builds
Kobzol May 30, 2025
ffeb532
Fix broken link to rustc_type_ir module in serialization docs
davidjsonn Jun 1, 2025
a62b7c8
use a relative path, so that this also works offline
tshepang Jun 2, 2025
d243d37
Merge pull request #2439 from rust-lang/tshepang-offline-love
tshepang Jun 2, 2025
23285ef
distracting indirection
tshepang Jun 2, 2025
d6cc62c
Merge pull request #2440 from rust-lang/tshepang-patch-1
Noratrieb Jun 2, 2025
3b85b2f
Trivial: dedup word
smanilov Jun 2, 2025
63ecc0e
Add title and toc to Async chapter
smanilov Jun 2, 2025
f8e21d0
Merge pull request #2444 from smanilov/patch-22
tshepang Jun 2, 2025
7fe7fdd
Merge pull request #2445 from smanilov/patch-23
tshepang Jun 2, 2025
0718d8f
Fix some warning blocks that contain Markdown
fmease Jun 2, 2025
9649a9c
Merge pull request #2446 from fmease/fix-warning-blocks
fmease Jun 2, 2025
e74c2b5
Simplify long sentence
smanilov Jun 2, 2025
10f2bcc
Merge pull request #2443 from smanilov/patch-21
tshepang Jun 2, 2025
8a807cd
This commit adds a `toml` module that represents various subsections …
Shourya742 Jun 3, 2025
cc30123
move target selection to its separate module
Shourya742 Jun 3, 2025
0de60dd
Move all common types, macros and utility method to config/mod.rs
Shourya742 Jun 3, 2025
edada36
add config.rs with new module structuring
Shourya742 Jun 3, 2025
8f22a50
Use 4-core large disk runner for the alt job
Kobzol May 30, 2025
6ec7ec9
correct the imports in flags, tests and download
Shourya742 Jun 3, 2025
bf9c9d2
Preparing for merge from rustc
jieyouxu Jun 3, 2025
b65ceb2
Merge from rustc
jieyouxu Jun 3, 2025
033b829
Merge pull request #2451 from jieyouxu/rustc-pull
jieyouxu Jun 3, 2025
143d813
implement new `x` flag: `--skip-std-check-if-no-download-rustc`
onur-ozkan Jun 3, 2025
f1e6afd
bless tidy
onur-ozkan Jun 3, 2025
9e162fe
add change-entry
onur-ozkan Jun 3, 2025
674a435
update gpu offload build command
ZuseZ4 Jun 3, 2025
0ca1be9
document `skip-std-check-if-no-download-rustc` in rustc-dev-guide
onur-ozkan Jun 4, 2025
c843bec
update `skip_std_check_if_no_download_rustc` doc-comments
onur-ozkan Jun 4, 2025
ff00561
cleaned up some tests
Kivooeo Jun 3, 2025
38fd777
Update link src/doc/rustc-dev-guide/src/serialization.md
davidjsonn Jun 4, 2025
e42b9ee
Rollup merge of #140638 - RalfJung:unsafe-pinned-shared-aliased, r=wo…
matthiaskrgr Jun 5, 2025
4050766
Rollup merge of #141272 - Shourya742:2025-05-18-modularize-config-mod…
matthiaskrgr Jun 5, 2025
801fbde
Rollup merge of #141777 - Kobzol:dist-linux-alt-no-pgo-bolt, r=marcoieni
matthiaskrgr Jun 5, 2025
b457ce2
Rollup merge of #141870 - davidjsonn:master, r=fee1-dead,compiler-errors
matthiaskrgr Jun 5, 2025
bac6f19
Rollup merge of #141938 - ZuseZ4:offload-updates, r=Kobzol
matthiaskrgr Jun 5, 2025
68b311b
Rollup merge of #141962 - BoxyUwU:rdg-push, r=jieyouxu
matthiaskrgr Jun 5, 2025
ab1c2c9
Rollup merge of #141965 - Kivooeo:test-reform, r=jieyouxu
matthiaskrgr Jun 5, 2025
9bd566c
Rollup merge of #141970 - onur-ozkan:skip-stage1-std, r=Kobzol
matthiaskrgr Jun 5, 2025
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
33 changes: 11 additions & 22 deletions library/core/src/pin/unsafe_pinned.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
use crate::cell::UnsafeCell;
use crate::marker::{PointerLike, Unpin};
use crate::ops::{CoerceUnsized, DispatchFromDyn};
use crate::pin::Pin;
use crate::{fmt, ptr};

/// This type provides a way to opt-out of typical aliasing rules;
/// This type provides a way to entirely opt-out of typical aliasing rules;
/// specifically, `&mut UnsafePinned<T>` is not guaranteed to be a unique pointer.
/// This also subsumes the effects of `UnsafeCell`, i.e., `&UnsafePinned<T>` may point to data
/// that is being mutated.
///
/// However, even if you define your type like `pub struct Wrapper(UnsafePinned<...>)`, it is still
/// very risky to have an `&mut Wrapper` that aliases anything else. Many functions that work
Expand All @@ -17,38 +20,24 @@ use crate::{fmt, ptr};
/// the public API of a library. It is an internal implementation detail of libraries that need to
/// support aliasing mutable references.
///
/// Further note that this does *not* lift the requirement that shared references must be read-only!
/// Use `UnsafeCell` for that.
///
/// This type blocks niches the same way `UnsafeCell` does.
#[lang = "unsafe_pinned"]
#[repr(transparent)]
#[unstable(feature = "unsafe_pinned", issue = "125735")]
pub struct UnsafePinned<T: ?Sized> {
value: T,
value: UnsafeCell<T>,
}

// Override the manual `!Sync` in `UnsafeCell`.
#[unstable(feature = "unsafe_pinned", issue = "125735")]
unsafe impl<T: ?Sized + Sync> Sync for UnsafePinned<T> {}

/// When this type is used, that almost certainly means safe APIs need to use pinning to avoid the
/// aliases from becoming invalidated. Therefore let's mark this as `!Unpin`. You can always opt
/// back in to `Unpin` with an `impl` block, provided your API is still sound while unpinned.
#[unstable(feature = "unsafe_pinned", issue = "125735")]
impl<T: ?Sized> !Unpin for UnsafePinned<T> {}

/// The type is `Copy` when `T` is to avoid people assuming that `Copy` implies there is no
/// `UnsafePinned` anywhere. (This is an issue with `UnsafeCell`: people use `Copy` bounds to mean
/// `Freeze`.) Given that there is no `unsafe impl Copy for ...`, this is also the option that
/// leaves the user more choices (as they can always wrap this in a `!Copy` type).
// FIXME(unsafe_pinned): this may be unsound or a footgun?
#[unstable(feature = "unsafe_pinned", issue = "125735")]
impl<T: Copy> Copy for UnsafePinned<T> {}

#[unstable(feature = "unsafe_pinned", issue = "125735")]
impl<T: Copy> Clone for UnsafePinned<T> {
fn clone(&self) -> Self {
*self
}
}

// `Send` and `Sync` are inherited from `T`. This is similar to `SyncUnsafeCell`, since
// we eventually concluded that `UnsafeCell` implicitly making things `!Sync` is sometimes
// unergonomic. A type that needs to be `!Send`/`!Sync` should really have an explicit
Expand All @@ -63,7 +52,7 @@ impl<T> UnsafePinned<T> {
#[must_use]
#[unstable(feature = "unsafe_pinned", issue = "125735")]
pub const fn new(value: T) -> Self {
UnsafePinned { value }
UnsafePinned { value: UnsafeCell::new(value) }
}

/// Unwraps the value, consuming this `UnsafePinned`.
Expand All @@ -72,7 +61,7 @@ impl<T> UnsafePinned<T> {
#[unstable(feature = "unsafe_pinned", issue = "125735")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
pub const fn into_inner(self) -> T {
self.value
self.value.into_inner()
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ impl Step for Std {
}

fn run(self, builder: &Builder<'_>) {
if !builder.download_rustc() && builder.config.skip_std_check_if_no_download_rustc {
eprintln!(
"WARNING: `--skip-std-check-if-no-download-rustc` flag was passed and `rust.download-rustc` is not available. Skipping."
);
return;
}

builder.require_submodule("library/stdarch", None);

let stage = self.custom_stage.unwrap_or(builder.top_stage);
Expand Down
15 changes: 9 additions & 6 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,23 +443,26 @@ impl Step for Llvm {
// See https://github.com/rust-lang/rust/pull/50104
cfg.define("LLVM_ENABLE_LIBXML2", "OFF");

if !enabled_llvm_projects.is_empty() {
enabled_llvm_projects.sort();
enabled_llvm_projects.dedup();
cfg.define("LLVM_ENABLE_PROJECTS", enabled_llvm_projects.join(";"));
}

let mut enabled_llvm_runtimes = Vec::new();

if helpers::forcing_clang_based_tests() {
enabled_llvm_runtimes.push("compiler-rt");
}

// This is an experimental flag, which likely builds more than necessary.
// We will optimize it when we get closer to releasing it on nightly.
if builder.config.llvm_offload {
enabled_llvm_runtimes.push("offload");
//FIXME(ZuseZ4): LLVM intends to drop the offload dependency on openmp.
//Remove this line once they achieved it.
enabled_llvm_runtimes.push("openmp");
enabled_llvm_projects.push("compiler-rt");
}

if !enabled_llvm_projects.is_empty() {
enabled_llvm_projects.sort();
enabled_llvm_projects.dedup();
cfg.define("LLVM_ENABLE_PROJECTS", enabled_llvm_projects.join(";"));
}

if !enabled_llvm_runtimes.is_empty() {
Expand Down
Loading
Loading