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 10 pull requests #138007

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1cac5fa
Look for `python3` first on MacOS, not `py`
jyn514 Feb 13, 2025
477a2ee
std::fs: slightly reformat `remove_dir_all` error docs
jieyouxu Feb 18, 2025
9323ba5
Remove MaybeForgetReturn suggestion
compiler-errors Feb 20, 2025
b60aeb0
Stop passing --lib to cargo test
bjorn3 Feb 26, 2025
b491494
Also test coretests when running ./x.py test core
bjorn3 Feb 19, 2025
169e731
Fix unused import in coretests on wasm32
bjorn3 Feb 26, 2025
762fdf6
default to `-znostart-stop-gc`
lqd Feb 26, 2025
3786a7a
stabilize `box_uninit_write`
slanterns Mar 1, 2025
8b4007a
Update `compiler-builtins` to 0.1.150
tgross35 Feb 25, 2025
3998690
compiletest: remove legacy `Makefile`-based `run-make` support
jieyouxu Feb 5, 2025
413b824
run-make: remove `tools.mk`
jieyouxu Feb 5, 2025
9b17c98
run-make: update test suite README
jieyouxu Feb 5, 2025
ed168e7
run-make-support: remove outdated comments
jieyouxu Mar 1, 2025
efec638
tidy: remove legacy `Makefile` checks
jieyouxu Feb 5, 2025
b0d6a84
rustc-dev-guide: remove mentions of legacy `Makefile` run-make infra
jieyouxu Feb 5, 2025
95b030f
triagebot: stop backlinking to the test porting tracking issue
jieyouxu Feb 5, 2025
7e0a2fc
compiletest: change `TEST_BUILD_DIR` to maximally normalize
jieyouxu Feb 11, 2025
8342914
tests: remove explicit long type filename hash normalization from som…
jieyouxu Feb 11, 2025
12cd0f1
tests: rebless some tests as a side-effect of `TEST_BUILD_DIR` changes
jieyouxu Feb 11, 2025
4f2a3dc
tests: manually rebless `tests/ui-fulldeps/codegen-backend/hotplug.rs`
jieyouxu Feb 11, 2025
e3117e6
Do not use rustup to build Rust for Linux
Kobzol Mar 3, 2025
4f4cbff
Re-enable Rust for Linux CI job
Kobzol Mar 3, 2025
692c2e8
Rollup merge of #136581 - jieyouxu:makefile-be-gone, r=Kobzol
jieyouxu Mar 4, 2025
fa752ca
Rollup merge of #136865 - jieyouxu:long-type-path-compare-mode, r=lqd
jieyouxu Mar 4, 2025
c1ef9cc
Rollup merge of #136975 - jyn514:macos-x, r=Mark-Simulacrum
jieyouxu Mar 4, 2025
a1fb52e
Rollup merge of #137240 - jieyouxu:remove_dir_all, r=Mark-Simulacrum
jieyouxu Mar 4, 2025
5be1bcf
Rollup merge of #137303 - compiler-errors:maybe-forgor, r=cjgillot
jieyouxu Mar 4, 2025
6980d9d
Rollup merge of #137634 - tgross35:update-builtins, r=tgross35
jieyouxu Mar 4, 2025
0b5ee16
Rollup merge of #137679 - bjorn3:coretests_improvements, r=jieyouxu,o…
jieyouxu Mar 4, 2025
5f438e2
Rollup merge of #137685 - lqd:nostart-stop-gc, r=petrochenkov
jieyouxu Mar 4, 2025
32be95c
Rollup merge of #137850 - slanterns:box_uninit_write, r=ibraheemdev
jieyouxu Mar 4, 2025
89c12e0
Rollup merge of #137947 - Kobzol:fix-rfl, r=marcoieni
jieyouxu Mar 4, 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ index 7165c3e48af..968552ad435 100644

[dependencies]
core = { path = "../core", public = true }
-compiler_builtins = { version = "=0.1.148", features = ['rustc-dep-of-std'] }
+compiler_builtins = { version = "=0.1.148", features = ['rustc-dep-of-std', 'no-f16-f128'] }
-compiler_builtins = { version = "=0.1.150", features = ['rustc-dep-of-std'] }
+compiler_builtins = { version = "=0.1.150", features = ['rustc-dep-of-std', 'no-f16-f128'] }

[dev-dependencies]
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
Expand Down
26 changes: 26 additions & 0 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3438,6 +3438,32 @@ fn add_lld_args(
// this, `wasm-component-ld`, which is overridden if this option is passed.
if !sess.target.is_like_wasm {
cmd.cc_arg("-fuse-ld=lld");

// GNU ld and LLD have opposite defaults on some section garbage-collection features. For
// example, the somewhat popular `linkme` crate and its dependents rely in practice on this
// difference: when using lld, they need `-z nostart-stop-gc` to prevent encapsulation
// symbols and sections from being garbage-collected.
//
// More information about all this can be found in:
// - https://maskray.me/blog/2021-01-31-metadata-sections-comdat-and-shf-link-order
// - https://lld.llvm.org/ELF/start-stop-gc
//
// So when using lld, we restore, for now, the traditional behavior to help migration, but
// will remove it in the future.
// Since this only disables an optimization, it shouldn't create issues, but is in theory
// slightly suboptimal. However, it:
// - doesn't have any visible impact on our benchmarks
// - reduces the need to disable lld for the crates that depend on this
//
// Note that lld can detect some cases where this difference is relied on, and emits a
// dedicated error to add this link arg. We could make use of this error to emit an FCW. As
// of writing this, we don't do it, because lld is already enabled by default on nightly
// without this mitigation: no working project would see the FCW, so we do this to help
// stabilization.
//
// FIXME: emit an FCW if linking fails due its absence, and then remove this link-arg in the
// future.
cmd.link_arg("-znostart-stop-gc");
}

if !flavor.is_gnu() {
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ pub enum StashKey {
MaybeFruTypo,
CallAssocMethod,
AssociatedTypeSuggestion,
MaybeForgetReturn,
/// Query cycle detected, stashing in favor of a better error.
Cycle,
UndeterminedMacroResolution,
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

if !errors.is_empty() {
self.adjust_fulfillment_errors_for_expr_obligation(&mut errors);
let errors_causecode = errors
.iter()
.map(|e| (e.obligation.cause.span, e.root_obligation.cause.code().clone()))
.collect::<Vec<_>>();
self.err_ctxt().report_fulfillment_errors(errors);
self.collect_unused_stmts_for_coerce_return_ty(errors_causecode);
}
}

Expand Down
60 changes: 1 addition & 59 deletions compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ use std::{fmt, iter, mem};
use itertools::Itertools;
use rustc_data_structures::fx::FxIndexSet;
use rustc_errors::codes::*;
use rustc_errors::{
Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, a_or_an, listify, pluralize,
};
use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, a_or_an, listify, pluralize};
use rustc_hir::def::{CtorOf, DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::Visitor;
Expand Down Expand Up @@ -2193,62 +2191,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}

pub(super) fn collect_unused_stmts_for_coerce_return_ty(
&self,
errors_causecode: Vec<(Span, ObligationCauseCode<'tcx>)>,
) {
for (span, code) in errors_causecode {
self.dcx().try_steal_modify_and_emit_err(span, StashKey::MaybeForgetReturn, |err| {
if let Some(fn_sig) = self.body_fn_sig()
&& let ObligationCauseCode::WhereClauseInExpr(_, _, binding_hir_id, ..) = code
&& !fn_sig.output().is_unit()
{
let mut block_num = 0;
let mut found_semi = false;
for (hir_id, node) in self.tcx.hir_parent_iter(binding_hir_id) {
// Don't proceed into parent bodies
if hir_id.owner != binding_hir_id.owner {
break;
}
match node {
hir::Node::Stmt(stmt) => {
if let hir::StmtKind::Semi(expr) = stmt.kind {
let expr_ty = self.typeck_results.borrow().expr_ty(expr);
let return_ty = fn_sig.output();
if !matches!(expr.kind, hir::ExprKind::Ret(..))
&& self.may_coerce(expr_ty, return_ty)
{
found_semi = true;
}
}
}
hir::Node::Block(_block) => {
if found_semi {
block_num += 1;
}
}
hir::Node::Item(item) => {
if let hir::ItemKind::Fn { .. } = item.kind {
break;
}
}
_ => {}
}
}
if block_num > 1 && found_semi {
err.span_suggestion_verbose(
// use the span of the *whole* expr
self.tcx.hir().span(binding_hir_id).shrink_to_lo(),
"you might have meant to return this to infer its type parameters",
"return ",
Applicability::MaybeIncorrect,
);
}
}
});
}
}

/// Given a vector of fulfillment errors, try to adjust the spans of the
/// errors to more accurately point at the cause of the failure.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use std::ops::ControlFlow;

use rustc_errors::{
Applicability, Diag, E0283, E0284, E0790, MultiSpan, StashKey, struct_span_code_err,
};
use rustc_errors::{Applicability, Diag, E0283, E0284, E0790, MultiSpan, struct_span_code_err};
use rustc_hir as hir;
use rustc_hir::LangItem;
use rustc_hir::def::{DefKind, Res};
Expand Down Expand Up @@ -197,7 +195,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
// be ignoring the fact that we don't KNOW the type works
// out. Though even that would probably be harmless, given that
// we're only talking about builtin traits, which are known to be
// inhabited. We used to check for `self.tcx.sess.has_errors()` to
// inhabited. We used to check for `self.tainted_by_errors()` to
// avoid inundating the user with unnecessary errors, but we now
// check upstream for type errors and don't add the obligations to
// begin with in those cases.
Expand All @@ -211,7 +209,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
TypeAnnotationNeeded::E0282,
false,
);
return err.stash(span, StashKey::MaybeForgetReturn).unwrap();
return err.emit();
}
Some(e) => return e,
}
Expand Down
4 changes: 2 additions & 2 deletions library/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ dependencies = [

[[package]]
name = "compiler_builtins"
version = "0.1.148"
version = "0.1.150"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26137996631d90d2727b905b480fdcf8c4479fdbce7afd7f8e3796d689b33cc2"
checksum = "5c42734e0ccf0d9f953165770593a75306f0b24dda1aa03f115c70748726dbca"
dependencies = [
"cc",
"rustc-std-workspace-core",
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2021"

[dependencies]
core = { path = "../core", public = true }
compiler_builtins = { version = "=0.1.148", features = ['rustc-dep-of-std'] }
compiler_builtins = { version = "=0.1.150", features = ['rustc-dep-of-std'] }

[dev-dependencies]
rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
Expand Down
4 changes: 1 addition & 3 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,6 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
/// # Examples
///
/// ```
/// #![feature(box_uninit_write)]
///
/// let big_box = Box::<[usize; 1024]>::new_uninit();
///
/// let mut array = [0; 1024];
Expand All @@ -954,7 +952,7 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
/// assert_eq!(*x, i);
/// }
/// ```
#[unstable(feature = "box_uninit_write", issue = "129397")]
#[stable(feature = "box_uninit_write", since = "CURRENT_RUSTC_VERSION")]
#[inline]
pub fn write(mut boxed: Self, value: T) -> Box<T, A> {
unsafe {
Expand Down
1 change: 0 additions & 1 deletion library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
#![feature(assert_matches)]
#![feature(async_fn_traits)]
#![feature(async_iterator)]
#![feature(box_uninit_write)]
#![feature(bstr)]
#![feature(bstr_internals)]
#![feature(char_max_len)]
Expand Down
3 changes: 1 addition & 2 deletions library/coretests/tests/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use core::num::NonZero;
use core::ops::{Range, RangeInclusive};
use core::slice;

use rand::seq::IndexedRandom;

#[test]
fn test_position() {
let b = [1, 2, 3, 5, 5];
Expand Down Expand Up @@ -1810,6 +1808,7 @@ fn select_nth_unstable() {
use core::cmp::Ordering::{Equal, Greater, Less};

use rand::Rng;
use rand::seq::IndexedRandom;

let mut rng = crate::test_rng();

Expand Down
2 changes: 1 addition & 1 deletion library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" }
core = { path = "../core", public = true }
compiler_builtins = { version = "=0.1.148" }
compiler_builtins = { version = "=0.1.150" }
unwind = { path = "../unwind" }
hashbrown = { version = "0.15", default-features = false, features = [
'rustc-dep-of-std',
Expand Down
8 changes: 5 additions & 3 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2857,9 +2857,11 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
///
/// See [`fs::remove_file`] and [`fs::remove_dir`].
///
/// `remove_dir_all` will fail if `remove_dir` or `remove_file` fail on any constituent paths, including the root `path`.
/// As a result, the directory you are deleting must exist, meaning that this function is not idempotent.
/// Additionally, `remove_dir_all` will also fail if the `path` is not a directory.
/// [`remove_dir_all`] will fail if [`remove_dir`] or [`remove_file`] fail on *any* constituent
/// paths, *including* the root `path`. Consequently,
///
/// - The directory you are deleting *must* exist, meaning that this function is *not idempotent*.
/// - [`remove_dir_all`] will fail if the `path` is *not* a directory.
///
/// Consider ignoring the error if validating the removal is not required for your use case.
///
Expand Down
Loading
Loading