Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
fddee44
Remove old mingw-w64 workaround
mati865 Jun 17, 2026
edffa70
Add `riscv32imfc-unknown-none-elf` bare-metal target
sanchuanhehe Jun 27, 2026
a34f46f
process::exec: using appropriate exit code on vxworks.
devnexen Jun 29, 2026
958fa4a
forward signals as well
devnexen Jun 29, 2026
4910c97
address feedback
devnexen Jun 29, 2026
295ddb8
Improve diagnostic for too many super keywords
andrewkernel Jun 29, 2026
b818647
test(traits): add baseline test for conditionally implemented traits
raushan728 Jun 27, 2026
248a48b
refactor super_combine matches (no behavior change)
khyperia Jun 29, 2026
1fdd4de
use ProjectionPredicate instead of AliasRelate
khyperia Jun 30, 2026
e9df4e0
yeet AliasRelate
khyperia Jun 30, 2026
4480d78
Use `Option::into_flat_iter` in the compiler
cuviper Jun 30, 2026
ef3084c
Use more direct ways to flatten option-iterators
cuviper Jun 30, 2026
4613bf9
fix(traits): clarify conditional impl diagnostics
raushan728 Jun 27, 2026
a1fb429
ptr doc: reduce use of unsafe block to where needed
tshepang Jul 1, 2026
a507eec
Update LLVM submodule
nikic Jul 1, 2026
fe85327
Revert "Remove redundant dyn-compatibility check."
theemathas Jul 1, 2026
90abe72
Remove `src/tools/test-float-parse/Cargo.lock`
cuviper Jul 1, 2026
f1d0307
Avoid unsafe self type lookup in alias diagnostics
Dnreikronos Jul 1, 2026
14da4e8
library: Polish transmute's `split_at_stdlib` example
workingjubilee Jul 1, 2026
1fb14f8
Add extra dyn non-tuple trait splat tests
teor2345 Jul 1, 2026
941bc65
Add a splat codegen run test
teor2345 Jul 1, 2026
26fdc4f
Add tests for invalid splatted casts
teor2345 Jul 2, 2026
7592485
Add tests for splatted self
teor2345 Jul 2, 2026
cd228ce
add regression test for NonZero<char> improper_ctypes ICE
TaKO8Ki Jul 2, 2026
dd937e4
Remove unnecessary `Hash` derives from MIR types
nnethercote Jul 2, 2026
427a94a
avoid ICE for NonZero<char> in improper_ctypes
TaKO8Ki Jul 2, 2026
f3d4f18
add a test for malformed disabled on_type_error arguments
TaKO8Ki Jul 2, 2026
673dcf0
ignore on_type_error args when the feature is disabled
TaKO8Ki Jul 2, 2026
8020a9b
Resolve fixme in test files
Ajay-singh1 Jul 2, 2026
50181ca
Add test and comment for https://github.com/rust-lang/rust/issues/158656
theemathas Jul 2, 2026
2740f6c
Remove unused `MacEager` fields
nnethercote Jul 2, 2026
1346c26
Eliminate `make_MacEager!`
nnethercote Jul 2, 2026
9ccafdc
the .eq() in instantiate_normalizes_to_term may fail
khyperia Jun 30, 2026
1f5a905
VisibleForLeakCheck::No in evaluate_root_goal_for_proof_tree
khyperia Jun 30, 2026
c77583e
instantiate_normalizes_to_as_rigid
khyperia Jun 30, 2026
6bae483
Cleanup attribute docs and add links to other mentioned attributes
GuillaumeGomez Jul 2, 2026
471f97d
Emit retags without precise information on pinning and interior mutab…
icmccorm Jun 15, 2026
c268765
Unconditionally jump to the join block when retagging variants.
icmccorm Jun 30, 2026
b0cbd79
Rollup merge of #158100 - BorrowSanitizer:codegen-emit-retag-4, r=sae…
JonathanBrouwer Jul 5, 2026
9ef160f
Rollup merge of #158494 - raushan728:issues/158423, r=mu001999
JonathanBrouwer Jul 5, 2026
c9d4d4d
Rollup merge of #158606 - khyperia:yeet-aliasrelate, r=lcnr
JonathanBrouwer Jul 5, 2026
3dad78a
Rollup merge of #158627 - cuviper:option-iterator-flattening, r=nneth…
JonathanBrouwer Jul 5, 2026
fa70b78
Rollup merge of #158658 - nikic:update-fix-evex-compress, r=cuviper
JonathanBrouwer Jul 5, 2026
988fe15
Rollup merge of #158665 - theemathas:undel-dyn-compat-check, r=Kivooe…
JonathanBrouwer Jul 5, 2026
c320e32
Rollup merge of #158021 - mati865:mingw-remove-workaround, r=marcoieni
JonathanBrouwer Jul 5, 2026
3b20143
Rollup merge of #158473 - hispark-rs:riscv32imfc-unknown-none-elf, r=…
JonathanBrouwer Jul 5, 2026
d79878e
Rollup merge of #158549 - devnexen:vxworks_exit_status_fix, r=clarfon…
JonathanBrouwer Jul 5, 2026
f26d346
Rollup merge of #158585 - andrewkernel:improve-too-many-super-diagnos…
JonathanBrouwer Jul 5, 2026
d03da06
Rollup merge of #158637 - Dnreikronos:hir_ty_lowering/skip_inherent_p…
JonathanBrouwer Jul 5, 2026
8e73857
Rollup merge of #158651 - tshepang:restrict-use-of-unsafe, r=LawnGnome
JonathanBrouwer Jul 5, 2026
9a96647
Rollup merge of #158669 - cuviper:unlock-test-float-parse, r=jieyouxu
JonathanBrouwer Jul 5, 2026
3bfc916
Rollup merge of #158674 - workingjubilee:polish-mem-transmute, r=jhpratt
JonathanBrouwer Jul 5, 2026
63f9378
Rollup merge of #158677 - teor2345:extra-splat-tests, r=wesleywiser
JonathanBrouwer Jul 5, 2026
7d8b0a9
Rollup merge of #158680 - TaKO8Ki:fix-nonzero-char-improper-ctypes-ic…
JonathanBrouwer Jul 5, 2026
e71e76c
Rollup merge of #158681 - nnethercote:mir-derives-FIDDLING, r=oli-obk
JonathanBrouwer Jul 5, 2026
17ec372
Rollup merge of #158682 - TaKO8Ki:fix-158628-on-type-error-args, r=Jo…
JonathanBrouwer Jul 5, 2026
b669f0d
Rollup merge of #158684 - Ajay-singh1:ui-tests-for-splat, r=teor2345
JonathanBrouwer Jul 5, 2026
af430b4
Rollup merge of #158687 - nnethercote:streamline-MacEager, r=petroche…
JonathanBrouwer Jul 5, 2026
3755fd9
Rollup merge of #158688 - GuillaumeGomez:attr-doc-cleanup, r=mejrs
JonathanBrouwer Jul 5, 2026
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
16 changes: 8 additions & 8 deletions compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
let spans = sess.psess.gated_spans.spans.borrow();
macro_rules! gate_all {
($feature:ident, $explain:literal $(, $help:literal)?) => {
for &span in spans.get(&sym::$feature).into_iter().flatten() {
for &span in spans.get(&sym::$feature).into_flat_iter() {
gate!(visitor, $feature, span, $explain $(, $help)?);
}
};
Expand Down Expand Up @@ -527,13 +527,13 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
);

// `associated_const_equality` will be stabilized as part of `min_generic_const_args`.
for &span in spans.get(&sym::associated_const_equality).into_iter().flatten() {
for &span in spans.get(&sym::associated_const_equality).into_flat_iter() {
gate!(visitor, min_generic_const_args, span, "associated const equality is incomplete");
}

// `mgca_type_const_syntax` is part of `min_generic_const_args` so if
// either or both are enabled we don't need to emit a feature error.
for &span in spans.get(&sym::mgca_type_const_syntax).into_iter().flatten() {
for &span in spans.get(&sym::mgca_type_const_syntax).into_flat_iter() {
if visitor.features.min_generic_const_args()
|| visitor.features.mgca_type_const_syntax()
|| span.allows_unstable(sym::min_generic_const_args)
Expand Down Expand Up @@ -561,13 +561,13 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
// it does **not** mean "`T` doesn't implement `Bound` (positively or negatively)"!
// The latter would be a SemVer hazard!
if !sess.opts.unstable_opts.internal_testing_features || !visitor.features.negative_bounds() {
for &span in spans.get(&sym::negative_bounds).into_iter().flatten() {
for &span in spans.get(&sym::negative_bounds).into_flat_iter() {
sess.dcx().emit_err(diagnostics::NegativeBoundUnsupported { span });
}
}

if !visitor.features.never_patterns() {
for &span in spans.get(&sym::never_patterns).into_iter().flatten() {
for &span in spans.get(&sym::never_patterns).into_flat_iter() {
if span.allows_unstable(sym::never_patterns) {
continue;
}
Expand All @@ -585,7 +585,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
}

// Yield exprs can be enabled either by `yield_expr`, by `coroutines` or by `gen_blocks`.
for &span in spans.get(&sym::yield_expr).into_iter().flatten() {
for &span in spans.get(&sym::yield_expr).into_flat_iter() {
if (!visitor.features.coroutines() && !span.allows_unstable(sym::coroutines))
&& (!visitor.features.gen_blocks() && !span.allows_unstable(sym::gen_blocks))
&& (!visitor.features.yield_expr() && !span.allows_unstable(sym::yield_expr))
Expand All @@ -607,7 +607,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {

macro_rules! soft_gate_all_legacy_dont_use {
($feature:ident, $explain:literal) => {
for &span in spans.get(&sym::$feature).into_iter().flatten() {
for &span in spans.get(&sym::$feature).into_flat_iter() {
if !visitor.features.$feature() && !span.allows_unstable(sym::$feature) {
feature_warn(&visitor.sess, sym::$feature, span, $explain);
}
Expand All @@ -625,7 +625,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
soft_gate_all_legacy_dont_use!(try_blocks, "`try` blocks are unstable");
// tidy-alphabetical-end

for &span in spans.get(&sym::min_specialization).into_iter().flatten() {
for &span in spans.get(&sym::min_specialization).into_flat_iter() {
if !visitor.features.specialization()
&& !visitor.features.min_specialization()
&& !span.allows_unstable(sym::specialization)
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast_passes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#![feature(deref_patterns)]
#![feature(iter_intersperse)]
#![feature(iter_is_partitioned)]
#![feature(option_into_flat_iter)]
// tidy-alphabetical-end

pub mod ast_validation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub(crate) struct OnTypeErrorParser {
impl OnTypeErrorParser {
fn parse<'sess>(&mut self, cx: &mut AcceptContext<'_, 'sess>, args: &ArgParser, mode: Mode) {
if !cx.features().diagnostic_on_type_error() {
// `UnknownDiagnosticAttribute` is emitted in rustc_resolve/macros.rs
args.ignore_args();
return;
}

Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_borrowck/src/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,8 @@ impl<'a, 'tcx> Borrows<'a, 'tcx> {
.borrow_set
.local_map
.get(&place.local)
.into_iter()
.flat_map(|bs| bs.iter())
.copied();
.map(|bs| bs.iter().copied())
.into_flat_iter();

// If the borrowed place is a local with no projections, all other borrows of this
// local must conflict. This is purely an optimization so we don't have to call
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#![feature(file_buffered)]
#![feature(negative_impls)]
#![feature(never_type)]
#![feature(option_into_flat_iter)]
#![feature(rustc_attrs)]
#![feature(stmt_expr_attributes)]
#![feature(try_blocks)]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/polonius/constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl LocalizedConstraintGraph {
// The physical edges present at this node are:
//
// 1. the typeck edges that flow from region to region *at this point*.
for &succ in self.edges.get(&node).into_iter().flatten() {
for &succ in self.edges.get(&node).into_flat_iter() {
let succ = LocalizedNode { region: succ, point: node.point };
successor_found(succ);
}
Expand Down Expand Up @@ -229,7 +229,7 @@ impl LocalizedConstraintGraph {
}

// And finally, we have the logical edges, materialized at this point.
for &logical_succ in self.logical_edges.get(&node.region).into_iter().flatten() {
for &logical_succ in self.logical_edges.get(&node.region).into_flat_iter() {
let succ = LocalizedNode { region: logical_succ, point: node.point };
successor_found(succ);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub(super) fn apply_member_constraints<'tcx>(
rcx.scc_values.add_region(scc_a, scc_b);
}

for defining_use in member_constraints.get(&scc_a).into_iter().flatten() {
for defining_use in member_constraints.get(&scc_a).into_flat_iter() {
apply_member_constraint(rcx, scc_a, &defining_use.arg_regions);
}
}
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_borrowck/src/region_infer/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl LivenessValues {

/// Returns an iterator of all the points where `region` is live.
fn live_points(&self, region: RegionVid) -> impl Iterator<Item = PointIndex> {
self.point_liveness(region).into_iter().flat_map(|set| set.iter())
self.point_liveness(region).map(|set| set.iter()).into_flat_iter()
}

/// For debugging purposes, returns a pretty-printed string of the points where the `region` is
Expand Down Expand Up @@ -348,13 +348,13 @@ impl<'tcx, N: Idx> RegionValues<'tcx, N> {
pub(crate) fn locations_outlived_by(&self, r: N) -> impl Iterator<Item = Location> {
self.points
.row(r)
.into_iter()
.flat_map(move |set| set.iter().map(move |p| self.location_map.to_location(p)))
.map(move |set| set.iter().map(move |p| self.location_map.to_location(p)))
.into_flat_iter()
}

/// Returns just the universal regions that are contained in a given region's value.
pub(crate) fn universal_regions_outlived_by(&self, r: N) -> impl Iterator<Item = RegionVid> {
self.free_regions.row(r).into_iter().flat_map(|set| set.iter())
self.free_regions.row(r).map(|set| set.iter()).into_flat_iter()
}

/// Returns all the elements contained in a given region's value.
Expand All @@ -364,8 +364,8 @@ impl<'tcx, N: Idx> RegionValues<'tcx, N> {
) -> impl Iterator<Item = ty::PlaceholderRegion<'tcx>> {
self.placeholders
.row(r)
.into_iter()
.flat_map(|set| set.iter())
.map(|set| set.iter())
.into_flat_iter()
.map(move |p| self.placeholder_indices.lookup_placeholder(p))
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
self.super_local_decl(local, local_decl);

for user_ty in
local_decl.user_ty.as_deref().into_iter().flat_map(UserTypeProjections::projections)
local_decl.user_ty.as_deref().map(UserTypeProjections::projections).into_flat_iter()
{
let span = self.user_type_annotations[user_ty.base].span;

Expand Down
24 changes: 2 additions & 22 deletions compiler/rustc_borrowck/src/type_check/relate_tys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,27 +597,7 @@ impl<'b, 'tcx> PredicateEmittingRelation<InferCtxt<'tcx>> for NllTypeRelating<'_
);
}

fn register_alias_relate_predicate(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) {
self.register_predicates([ty::Binder::dummy(match self.ambient_variance {
ty::Covariant => ty::PredicateKind::AliasRelate(
a.into(),
b.into(),
ty::AliasRelationDirection::Subtype,
),
// a :> b is b <: a
ty::Contravariant => ty::PredicateKind::AliasRelate(
b.into(),
a.into(),
ty::AliasRelationDirection::Subtype,
),
ty::Invariant => ty::PredicateKind::AliasRelate(
a.into(),
b.into(),
ty::AliasRelationDirection::Equate,
),
ty::Bivariant => {
unreachable!("cannot defer an alias-relate goal with Bivariant variance (yet?)")
}
})]);
fn ambient_variance(&self) -> ty::Variance {
self.ambient_variance
}
}
3 changes: 1 addition & 2 deletions compiler/rustc_codegen_ssa/src/assert_module_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ impl<'tcx> AssertModuleSource<'tcx> {
fn check_attrs(&mut self, attrs: &[hir::Attribute]) {
for &(span, cgu_fields) in find_attr!(attrs,
RustcCguTestAttr(e) => e)
.into_iter()
.flatten()
.into_flat_iter()
{
let (expected_reuse, comp_kind) = match cgu_fields {
CguFields::PartitionReused { .. } => (CguReuse::PreLto, ComparisonKind::AtLeast),
Expand Down
8 changes: 3 additions & 5 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1091,9 +1091,7 @@ fn link_natively(
let get_objects = |objects: &CrtObjects, kind| {
objects
.get(&kind)
.iter()
.copied()
.flatten()
.into_flat_iter()
.map(|obj| {
get_object_file_path(sess, obj, self_contained_crt_objects).into_os_string()
})
Expand Down Expand Up @@ -2073,7 +2071,7 @@ fn add_pre_link_objects(
} else {
&empty
};
for obj in objects.get(&link_output_kind).iter().copied().flatten() {
for obj in objects.get(&link_output_kind).into_flat_iter() {
cmd.add_object(&get_object_file_path(sess, obj, self_contained));
}
}
Expand All @@ -2090,7 +2088,7 @@ fn add_post_link_objects(
} else {
&sess.target.post_link_objects
};
for obj in objects.get(&link_output_kind).iter().copied().flatten() {
for obj in objects.get(&link_output_kind).into_flat_iter() {
cmd.add_object(&get_object_file_path(sess, obj, self_contained));
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![feature(deref_patterns)]
#![feature(file_buffered)]
#![feature(negative_impls)]
#![feature(option_into_flat_iter)]
#![feature(string_from_utf8_lossy_owned)]
#![feature(trait_alias)]
#![feature(try_blocks)]
Expand Down
49 changes: 49 additions & 0 deletions compiler/rustc_codegen_ssa/src/mir/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,34 @@ impl<'a, 'tcx, V: CodegenObject> OperandRefBuilder<'tcx, V> {
OperandRefBuilder { val, layout }
}

/// Creates an initialized builder for updating an existing `operand`.
///
/// ICEs for [`BackendRepr::Memory`] types (other than ZSTs), which use
/// which use [`OperandValue::Ref`]. In this case, updates should be
/// performed by writing into the place
pub(super) fn from_existing(operand: OperandRef<'tcx, V>) -> Self {
let layout = operand.layout;
let val = match (operand.val, layout.backend_repr) {
(OperandValue::ZeroSized, _) => OperandValueBuilder::ZeroSized,
(OperandValue::Immediate(v), BackendRepr::Scalar(_)) => {
OperandValueBuilder::Immediate(Either::Left(v))
}
(OperandValue::Immediate(v), BackendRepr::SimdVector { .. }) => {
OperandValueBuilder::Vector(Either::Left(v))
}
(OperandValue::Pair(a, b), BackendRepr::ScalarPair(_, _)) => {
OperandValueBuilder::Pair(Either::Left(a), Either::Left(b))
}
(_, BackendRepr::Memory { .. }) => {
bug!("Cannot use non-ZST Memory-ABI type in operand builder: {layout:?}");
}
_ => {
bug!("Operand cannot be used with `from_existing`: {operand:?}")
}
};
OperandRefBuilder { val, layout }
}

pub(super) fn insert_field<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
&mut self,
bx: &mut Bx,
Expand Down Expand Up @@ -829,6 +857,27 @@ impl<'a, 'tcx, V: CodegenObject> OperandRefBuilder<'tcx, V> {
}
}

/// Replaces the current immediate value at the offset `offset`
/// with the value `imm`. A value must already be present.
///
/// This is used along with [`Self::from_existing`] to perform in-place updates
/// of any operand.
pub(super) fn update_imm(&mut self, offset: Size, imm: V) {
let is_zero_offset = offset == Size::ZERO;
match &mut self.val {
OperandValueBuilder::Immediate(val @ Either::Left(_)) if is_zero_offset => {
*val = Either::Left(imm);
}
OperandValueBuilder::Pair(fst @ Either::Left(_), _) if is_zero_offset => {
*fst = Either::Left(imm);
}
OperandValueBuilder::Pair(_, snd @ Either::Left(_)) if !is_zero_offset => {
*snd = Either::Left(imm);
}
_ => bug!("Tried to update {imm:?} at offset {offset:?} of {self:?}"),
}
}

/// After having set all necessary fields, this converts the builder back
/// to the normal `OperandRef`.
///
Expand Down
Loading
Loading