Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
31ce9e7
debuginfo: slices are DW_TAG_array_type's
shua Feb 26, 2026
580e752
add regression test
qaijuang May 28, 2026
b459cfc
don't recover `&raw EXPR` as a missing comma
qaijuang May 28, 2026
3914f38
adding debuginfo tests for str repr llvm di
shua May 5, 2026
307310c
Add tests/ui/impl-trait/unpin-for-future.rs
Darksonn May 28, 2026
b9706c0
Update aarch64-unknown-freebsd target description
mrkajetanp May 29, 2026
649f45a
./miri test: run some tests natively
RalfJung May 29, 2026
7fa4180
Prepare for merging from rust-lang/rust
Jun 2, 2026
b96e7a6
Merge ref '4f84d9fac456' from rust-lang/rust
Jun 2, 2026
05e3945
fmt
Jun 2, 2026
ff15330
Merge pull request #5085 from rust-lang/rustup-2026-06-02
oli-obk Jun 2, 2026
5886a51
rustc_session: apply -Zremap-cwd-prefix when building the file mapping
ashi009 Jun 3, 2026
1fc7bf3
Prepare for merging from rust-lang/rust
Jun 4, 2026
9bd40c9
Merge ref '76dfce2cb2d3' from rust-lang/rust
Jun 4, 2026
4799240
fmt
Jun 4, 2026
07fe0fa
clippy
RalfJung Jun 4, 2026
566e318
CreateFileW: retry to deal with race conditions
RalfJung Jun 2, 2026
e1d51e6
Merge pull request #5089 from rust-lang/rustup-2026-06-04
RalfJung Jun 4, 2026
2b25e90
Merge pull request #5087 from RalfJung/CreateFileW
RalfJung Jun 4, 2026
3d69765
refactor: delegate raw ref mut checks to a new helper method
qaijuang Jun 4, 2026
5fde1fd
preserve arg count in call recovery
qaijuang Jun 4, 2026
a832c14
Add powerpc64-unknown-linux-gnuelfv2 target
Gelbpunkt Jun 3, 2026
553d694
Prepare for merging from rust-lang/rust
Jun 5, 2026
790c19a
Merge ref '3179a47d6771' from rust-lang/rust
Jun 5, 2026
9c189a4
move cron job earlier
RalfJung Jun 5, 2026
7e64f8a
bump 'aes'
RalfJung Jun 5, 2026
221f40c
Merge pull request #5090 from rust-lang/rustup-2026-06-05
RalfJung Jun 5, 2026
0d8d22d
Merge pull request #5092 from RalfJung/aes
RalfJung Jun 5, 2026
819843c
add missing FIXME for Windows TLS API tests
RalfJung Jun 5, 2026
4619a89
use Size::unsigned_int_max to make code more readable
RalfJung Jun 5, 2026
612f2d2
Merge pull request #5093 from RalfJung/minor
RalfJung Jun 5, 2026
8793422
Merge pull request #5091 from RalfJung/cron
RalfJung Jun 5, 2026
a49f1ed
Merge pull request #5076 from RalfJung/native-tests
oli-obk Jun 6, 2026
6d2f2be
add Miri sticker to README
RalfJung Jun 6, 2026
96f1059
Merge pull request #5094 from RalfJung/sticker
saethlin Jun 6, 2026
d1abd50
fix spurious epoll-blocking test
RalfJung Jun 7, 2026
993fbc8
Merge pull request #5096 from RalfJung/epoll-tests
RalfJung Jun 7, 2026
56a3442
[Priroda] Add quit command
moabo3li May 30, 2026
72d02f0
[Priroda] Handle EOF explicitly
moabo3li May 30, 2026
e32687c
[Priroda] Report program exit code
moabo3li May 30, 2026
375b175
[Priroda] Add continue command
moabo3li May 30, 2026
e24b246
[Priroda] Add structured source locations
moabo3li May 30, 2026
0f5355f
[Priroda] Add breakpoint command
moabo3li May 31, 2026
b0d748d
[Priroda] Skip hidden MIR instructions while stepping
moabo3li May 31, 2026
b151668
[Priroda] Centralize execution resume policy
moabo3li May 31, 2026
395bd02
[Priroda] Separate CLI handling from debugger state
moabo3li Jun 1, 2026
ffcfd58
[Priroda] Index breakpoints by normalized path and line
moabo3li Jun 5, 2026
e5f0e6b
[Priroda] Store spans and compute normalized paths lazily
moabo3li Jun 5, 2026
0455053
triagebot: remove assign.custom_welcome_messages
RalfJung Jun 7, 2026
3f88267
Merge pull request #5097 from RalfJung/custom_welcome_messages
RalfJung Jun 7, 2026
2f88cd1
Merge pull request #5086 from moabo3li/push-surtywykyuvw
saethlin Jun 7, 2026
cd6c3a6
[Priroda] Add Priroda CLI integration test
moabo3li Jun 6, 2026
775c84d
[Priroda] Add CLI command handling tests
moabo3li Jun 7, 2026
764fe8c
[Priroda] Add CLI continue execution tests
moabo3li Jun 7, 2026
c91119e
[Priroda] Add CLI stepping regression tests
moabo3li Jun 7, 2026
8ed3e54
[Priroda] Add testing to CI job
moabo3li Jun 7, 2026
b01a70d
Prepare for merging from rust-lang/rust
Jun 8, 2026
8da359a
Merge ref '029c9e18dd1f' from rust-lang/rust
Jun 8, 2026
b080061
Merge pull request #5100 from rust-lang/rustup-2026-06-08
oli-obk Jun 8, 2026
e789c33
Add missing tests and adress concerns
P8L1 Jun 8, 2026
5004367
Make Share::share final and improve docs
P8L1 Jun 8, 2026
16e2fd2
Remove redundant normalize-stderr directives
P8L1 Jun 9, 2026
219a65f
Simplify the initialisation of region values in `region_infer`
amandasystems Jun 9, 2026
6a93bcc
ci: rename `job-macos` anchor to `job-macos-15`
jieyouxu Jun 10, 2026
3619e22
ci: add new anchor for `macos-26` runners
jieyouxu Jun 10, 2026
b509dcc
ci: create experiment test job `aarch64-apple-macos-26`
jieyouxu Jun 10, 2026
68381b1
address clean code suggestion
qaijuang Jun 10, 2026
0b6f400
`SccValues`: Inline and monomorphise `ToElementIndex`
amandasystems Jun 10, 2026
0c141eb
[Priroda] Port Priroda CLI tests to ui_test
moabo3li Jun 9, 2026
50b0362
Require #[pin_v2] for explicit pin-projection patterns
Dnreikronos Jun 9, 2026
3b17418
[Priroda] Add a `--bless` flag to update the expected output files
moabo3li Jun 11, 2026
84c2a74
add borrow model test for mixed-mutability static
RalfJung Jun 11, 2026
942e38e
Merge pull request #5103 from RalfJung/mixed-mutability-static
RalfJung Jun 11, 2026
b0a1930
Merge pull request #5099 from moabo3li/priroda-cli-tests
oli-obk Jun 11, 2026
334c9df
fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia
PiJoules Jun 11, 2026
cc89e06
Disable retagging for variadic arguments.
icmccorm Jun 8, 2026
390c6a4
use empty assumptions not no assumptions in solver relating
BoxyUwU Jun 9, 2026
f8aff87
revert let pattern check
Kivooeo Jun 12, 2026
e04bcaf
rustdoc: Some more lazy formatting
yotamofek Jun 12, 2026
25e83a0
Update library/core/src/clone.rs
P8L1 Jun 12, 2026
c9ecb9f
interpret: avoid computing layout of sized raw pointee
RalfJung Jun 11, 2026
602df86
Bless reborrow UI tests
P8L1 Jun 12, 2026
23e03d9
Extend capabilities of `TypeFoldable_Generic`
Jamesbarford Jun 10, 2026
ea8f0d8
Mask CRC intrinsic inputs to match LoongArch hardware semantics
heiher Jun 10, 2026
42d7bf1
add #[rustc_no_writable] to slice::get_unchecked_mut
quiode Jun 12, 2026
b89d46f
Merge pull request #5102 from heiher/fix-loong-crc
RalfJung Jun 12, 2026
c15d9ab
Prevent approving PRs that wait for Crater or formal decisions
Kobzol Jun 12, 2026
9dcf73a
Rename `rustc_hir_monomorphize/src/errors.rs` into `rustc_hir_monomor…
GuillaumeGomez Jun 12, 2026
d0b019e
Rename `rustc_incremental/src/errors.rs` into `rustc_incremental/src/…
GuillaumeGomez Jun 12, 2026
6e1de07
add pre-stabilization testing CI job
lqd Jun 2, 2026
5c35f31
Fuse the two loops and do all region initialisation in one shot
amandasystems Jun 12, 2026
17d3900
Rollup merge of #144220 - Gelbpunkt:powerpc64-unknown-linux-gnuelfv2,…
JonathanBrouwer Jun 12, 2026
3a29576
Rollup merge of #153238 - shua:lldb-rcstr, r=davidtwco
JonathanBrouwer Jun 12, 2026
9c50ee0
Rollup merge of #157112 - mrkajetanp:aarch64-freebsd-tier2, r=davidtwco
JonathanBrouwer Jun 12, 2026
460c711
Rollup merge of #157322 - lqd:ci-new-solver-bootstrapping, r=kobzol,j…
JonathanBrouwer Jun 12, 2026
c756ac4
Rollup merge of #157348 - ashi009:remap-cwd-prefix-incremental, r=dav…
JonathanBrouwer Jun 12, 2026
264355d
Rollup merge of #157490 - P8L1:split/coerceshared-field-reborrow-test…
JonathanBrouwer Jun 12, 2026
3bfbba5
Rollup merge of #157655 - P8L1:share-trait-final-docs, r=nikomatsakis
JonathanBrouwer Jun 12, 2026
af8cbe7
Rollup merge of #157672 - amandasystems:region-inference-initialisati…
JonathanBrouwer Jun 12, 2026
927b226
Rollup merge of #157680 - Dnreikronos:pin_ergonomics_explicit_project…
JonathanBrouwer Jun 12, 2026
ec1bf5e
Rollup merge of #157688 - jieyouxu:jieyouxu/ci/try-macos-26, r=Kobzol
JonathanBrouwer Jun 12, 2026
0d01d51
Rollup merge of #157796 - yotamofek:pr/rustdoc/more-lazy-formatting, …
JonathanBrouwer Jun 12, 2026
53b94ea
Rollup merge of #157818 - RalfJung:miri, r=RalfJung
JonathanBrouwer Jun 12, 2026
55885d4
Rollup merge of #157069 - Darksonn:unpin-for-fut-tait, r=lcnr,RalfJung
JonathanBrouwer Jun 12, 2026
3f0676c
Rollup merge of #157079 - qaijuang:raw-expr-list-recovery, r=Kivooeo
JonathanBrouwer Jun 12, 2026
64eda74
Rollup merge of #157202 - quiode:add-rustc_no_writable-more-fns, r=Ra…
JonathanBrouwer Jun 12, 2026
4203236
Rollup merge of #157622 - BorrowSanitizer:ignore-retags-variadics, r=…
JonathanBrouwer Jun 12, 2026
1b6d004
Rollup merge of #157684 - BoxyUwU:empty_assumptions_in_solver_relatin…
JonathanBrouwer Jun 12, 2026
43a42ff
Rollup merge of #157695 - Jamesbarford:feat/extend-type-foldable-gene…
JonathanBrouwer Jun 12, 2026
d334b26
Rollup merge of #157766 - RalfJung:too-big, r=oli-obk
JonathanBrouwer Jun 12, 2026
69d5465
Rollup merge of #157785 - PiJoules:fuchsia-riscv64-asan-support, r=nn…
JonathanBrouwer Jun 12, 2026
28f2324
Rollup merge of #157795 - Kivooeo:revert-2, r=lcnr
JonathanBrouwer Jun 12, 2026
2e5b118
Rollup merge of #157798 - Kobzol:crater-block-bors, r=jieyouxu
JonathanBrouwer Jun 12, 2026
5e5789c
Rollup merge of #157803 - GuillaumeGomez:rename-err-to-diag, r=Jonath…
JonathanBrouwer Jun 12, 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
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4892,6 +4892,7 @@ dependencies = [
name = "rustc_type_ir_macros"
version = "0.0.0"
dependencies = [
"indexmap",
"proc-macro2",
"quote",
"syn",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/diagnostics/find_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<'a, 'tcx> UseFinder<'a, 'tcx> {

queue.push_back(self.start_point);
while let Some(p) = queue.pop_front() {
if !self.regioncx.region_contains(self.region_vid, p) {
if !self.regioncx.region_contains_point(self.region_vid, p) {
continue;
}

Expand Down
133 changes: 41 additions & 92 deletions compiler/rustc_borrowck/src/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::diagnostics::{RegionErrorKind, RegionErrors, UniverseInfo};
use crate::handle_placeholders::{LoweredConstraints, RegionTracker};
use crate::polonius::LiveLoans;
use crate::polonius::legacy::PoloniusOutput;
use crate::region_infer::values::{LivenessValues, RegionElement, RegionValues, ToElementIndex};
use crate::region_infer::values::{LivenessValues, RegionElement, RegionValues};
use crate::type_check::Locations;
use crate::type_check::free_region_relations::UniversalRegionRelations;
use crate::universal_regions::UniversalRegions;
Expand Down Expand Up @@ -345,7 +345,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
outlives_constraints,
scc_annotations,
type_tests,
liveness_constraints,
mut liveness_constraints,
universe_causes,
placeholder_indices,
} = lowered_constraints;
Expand All @@ -364,106 +364,54 @@ impl<'tcx> RegionInferenceContext<'tcx> {
let mut scc_values =
RegionValues::new(location_map, universal_regions.len(), placeholder_indices);

for region in liveness_constraints.regions() {
// Initializes the region variables with their initial live points.
for (region, definition) in definitions.iter_enumerated() {
let scc = constraint_sccs.scc(region);
scc_values.merge_liveness(scc, region, &liveness_constraints);
}

let mut result = Self {
definitions,
liveness_constraints,
constraints: outlives_constraints,
constraint_graph,
constraint_sccs,
scc_annotations,
universe_causes,
scc_values,
type_tests,
universal_region_relations,
};

result.init_free_and_bound_regions();

result
}

/// Initializes the region variables for each universally
/// quantified region (lifetime parameter). The first N variables
/// always correspond to the regions appearing in the function
/// signature (both named and anonymous) and where-clauses. This
/// function iterates over those regions and initializes them with
/// minimum values.
///
/// For example:
/// ```ignore (illustrative)
/// fn foo<'a, 'b>( /* ... */ ) where 'a: 'b { /* ... */ }
/// ```
/// would initialize two variables like so:
/// ```ignore (illustrative)
/// R0 = { CFG, R0 } // 'a
/// R1 = { CFG, R0, R1 } // 'b
/// ```
/// Here, R0 represents `'a`, and it contains (a) the entire CFG
/// and (b) any universally quantified regions that it outlives,
/// which in this case is just itself. R1 (`'b`) in contrast also
/// outlives `'a` and hence contains R0 and R1.
///
/// This bit of logic also handles invalid universe relations
/// for higher-kinded types.
///
/// We Walk each SCC `A` and `B` such that `A: B`
/// and ensure that universe(A) can see universe(B).
///
/// This serves to enforce the 'empty/placeholder' hierarchy
/// (described in more detail on `RegionKind`):
///
/// ```ignore (illustrative)
/// static -----+
/// | |
/// empty(U0) placeholder(U1)
/// | /
/// empty(U1)
/// ```
///
/// In particular, imagine we have variables R0 in U0 and R1
/// created in U1, and constraints like this;
///
/// ```ignore (illustrative)
/// R1: !1 // R1 outlives the placeholder in U1
/// R1: R0 // R1 outlives R0
/// ```
///
/// Here, we wish for R1 to be `'static`, because it
/// cannot outlive `placeholder(U1)` and `empty(U0)` any other way.
///
/// Thanks to this loop, what happens is that the `R1: R0`
/// constraint has lowered the universe of `R1` to `U0`, which in turn
/// means that the `R1: !1` constraint here will cause
/// `R1` to become `'static`.
fn init_free_and_bound_regions(&mut self) {
for variable in self.definitions.indices() {
let scc = self.constraint_sccs.scc(variable);

match self.definitions[variable].origin {
// For each universally quantified region (lifetime parameter). The
// first N variables always correspond to the regions appearing in the
// function signature (both named and anonymous) and in where-clauses.
match definition.origin {
// For each free, universally quantified region X:
NllRegionVariableOrigin::FreeRegion => {
// For each free, universally quantified region X:

// Add all nodes in the CFG to liveness constraints
self.liveness_constraints.add_all_points(variable);
self.scc_values.add_all_points(scc);
liveness_constraints.add_all_points(region);

// Add `end(X)` into the set for X.
self.scc_values.add_element(scc, variable);
scc_values.add_free_region(scc, region);
}

NllRegionVariableOrigin::Placeholder(placeholder) => {
self.scc_values.add_element(scc, placeholder);
scc_values.add_placeholder(scc, placeholder);
}

NllRegionVariableOrigin::Existential { .. } => {
// For existential, regions, nothing to do.
}
}

// Initially copy the liveness constraints of any region that
// has them, setting `scc_values[scc(region)] |= liveness_constraints[region]`.
//
// These values will later be propagated during [`Self::propagate_constraints()`].
// The values include any live-at-all-points constraints added above
// for free regions.
if let Some(liveness) = liveness_constraints.point_liveness(region) {
scc_values.merge_liveness(scc, liveness)
}
}

Self {
definitions,
liveness_constraints,
constraints: outlives_constraints,
constraint_graph,
constraint_sccs,
scc_annotations,
universe_causes,
scc_values,
type_tests,
universal_region_relations,
}
}

Expand Down Expand Up @@ -495,9 +443,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
/// Returns `true` if the region `r` contains the point `p`.
///
/// Panics if called before `solve()` executes,
pub(crate) fn region_contains(&self, r: RegionVid, p: impl ToElementIndex<'tcx>) -> bool {
pub(crate) fn region_contains_point(&self, r: RegionVid, p: Location) -> bool {
let scc = self.constraint_sccs.scc(r);
self.scc_values.contains(scc, p)
self.scc_values.contains_point(scc, p)
}

/// Returns the lowest statement index in `start..=end` which is not contained by `r`.
Expand Down Expand Up @@ -608,7 +556,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
// To propagate constraints, we walk the DAG induced by the
// SCC. For each SCC `A`, we visit its successors and compute
// their values, then we union all those values to get our
// own.
// own. This one-shot approach works because iteration is in
// dependency order. I.e. a chain A: B: C will visit C, B, A.
for scc_a in self.constraint_sccs.all_sccs() {
// Walk each SCC `B` such that `A: B`...
for &scc_b in self.constraint_sccs.successors(scc_a) {
Expand Down Expand Up @@ -1643,10 +1592,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
&self.definitions[r]
}

/// Check if the SCC of `r` contains `upper`.
/// Check if the SCC of `r` contains `upper`, a free region.
pub(crate) fn upper_bound_in_region_scc(&self, r: RegionVid, upper: RegionVid) -> bool {
let r_scc = self.constraint_sccs.scc(r);
self.scc_values.contains(r_scc, upper)
self.scc_values.contains_free_region(r_scc, upper)
}

pub(crate) fn universal_regions(&self) -> &UniversalRegions<'tcx> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
let placeholder_indices = Default::default();
let mut scc_values =
RegionValues::new(location_map, universal_regions.len(), placeholder_indices);
for variable in definitions.indices() {
for (variable, definition) in definitions.iter_enumerated() {
let scc = constraint_sccs.scc(variable);
match definitions[variable].origin {
match definition.origin {
NllRegionVariableOrigin::FreeRegion => {
scc_values.add_element(scc, variable);
scc_values.add_free_region(scc, variable);
}
_ => {}
}
Expand Down
86 changes: 22 additions & 64 deletions compiler/rustc_borrowck/src/region_infer/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ impl LivenessValues {
}
}

/// Iterate through each region that has a value in this set.
pub(crate) fn regions(&self) -> impl Iterator<Item = RegionVid> {
self.points().rows()
/// Get the liveness status of a region `r`, if any.
/// Panics if liveness data is not tracked for any region.
pub(crate) fn point_liveness(&self, region: RegionVid) -> Option<&IntervalSet<PointIndex>> {
self.points().row(region)
}

/// Iterate through each region that has a value in this set.
Expand Down Expand Up @@ -166,13 +167,12 @@ impl LivenessValues {
/// [`point`][rustc_mir_dataflow::points::PointIndex].
#[inline]
pub(crate) fn is_live_at_point(&self, region: RegionVid, point: PointIndex) -> bool {
self.points().row(region).is_some_and(|r| r.contains(point))
self.point_liveness(region).is_some_and(|r| r.contains(point))
}

/// Returns an iterator of all the points where `region` is live.
fn live_points(&self, region: RegionVid) -> impl Iterator<Item = PointIndex> {
self.points()
.row(region)
self.point_liveness(region)
.into_iter()
.flat_map(|set| set.iter())
.take_while(|&p| self.location_map.point_in_range(p))
Expand Down Expand Up @@ -296,18 +296,6 @@ impl<'tcx, N: Idx> RegionValues<'tcx, N> {
}
}

/// Adds the given element to the value for the given region. Returns whether
/// the element is newly added (i.e., was not already present).
pub(crate) fn add_element(&mut self, r: N, elem: impl ToElementIndex<'tcx>) -> bool {
debug!("add(r={:?}, elem={:?})", r, elem);
elem.add_to_row(self, r)
}

/// Adds all the control-flow points to the values for `r`.
pub(crate) fn add_all_points(&mut self, r: N) {
self.points.insert_all_into_row(r);
}

/// Adds all elements in `r_from` to `r_to` (because e.g., `r_to:
/// r_from`).
pub(crate) fn add_region(&mut self, r_to: N, r_from: N) -> bool {
Expand All @@ -316,11 +304,6 @@ impl<'tcx, N: Idx> RegionValues<'tcx, N> {
| self.placeholders.union_rows(r_from, r_to)
}

/// Returns `true` if the region `r` contains the given element.
pub(crate) fn contains(&self, r: N, elem: impl ToElementIndex<'tcx>) -> bool {
elem.contained_in_row(self, r)
}

/// Returns the lowest statement index in `start..=end` which is not contained by `r`.
pub(crate) fn first_non_contained_inclusive(
&self,
Expand All @@ -337,13 +320,9 @@ impl<'tcx, N: Idx> RegionValues<'tcx, N> {
Some(first_unset.index() - block.index())
}

/// `self[to] |= values[from]`, essentially: that is, take all the
/// elements for the region `from` from `values` and add them to
/// the region `to` in `self`.
pub(crate) fn merge_liveness(&mut self, to: N, from: RegionVid, values: &LivenessValues) {
if let Some(set) = values.points().row(from) {
self.points.union_row(to, set);
}
/// Merge a row of liveness into our points.
pub(crate) fn merge_liveness(&mut self, to: N, liveness: &IntervalSet<PointIndex>) {
self.points.union_row(to, liveness);
}

/// Returns `true` if `sup_region` contains all the CFG points that
Expand Down Expand Up @@ -405,47 +384,26 @@ impl<'tcx, N: Idx> RegionValues<'tcx, N> {
pub(crate) fn region_value_str(&self, r: N) -> String {
pretty_print_region_elements(self.elements_contained_in(r))
}
}

pub(crate) trait ToElementIndex<'tcx>: Debug + Copy {
fn add_to_row<N: Idx>(self, values: &mut RegionValues<'tcx, N>, row: N) -> bool;

fn contained_in_row<N: Idx>(self, values: &RegionValues<'tcx, N>, row: N) -> bool;
}

impl ToElementIndex<'_> for Location {
fn add_to_row<N: Idx>(self, values: &mut RegionValues<'_, N>, row: N) -> bool {
let index = values.location_map.point_from_location(self);
values.points.insert(row, index)
}

fn contained_in_row<N: Idx>(self, values: &RegionValues<'_, N>, row: N) -> bool {
let index = values.location_map.point_from_location(self);
values.points.contains(row, index)
}
}

impl ToElementIndex<'_> for RegionVid {
fn add_to_row<N: Idx>(self, values: &mut RegionValues<'_, N>, row: N) -> bool {
values.free_regions.insert(row, self)
/// Add a the free region with rvid `region` to SCC `scc`
pub(crate) fn add_free_region(&mut self, scc: N, region: RegionVid) {
self.free_regions.insert(scc, region);
}

fn contained_in_row<N: Idx>(self, values: &RegionValues<'_, N>, row: N) -> bool {
values.free_regions.contains(row, self)
pub(crate) fn add_placeholder(&mut self, scc: N, placeholder: ty::PlaceholderRegion<'tcx>) {
let index = self.placeholder_indices.lookup_index(placeholder);
self.placeholders.insert(scc, index);
}
}

impl<'tcx> ToElementIndex<'tcx> for ty::PlaceholderRegion<'tcx> {
fn add_to_row<N: Idx>(self, values: &mut RegionValues<'tcx, N>, row: N) -> bool {
let placeholder: ty::PlaceholderRegion<'tcx> = self.into();
let index = values.placeholder_indices.lookup_index(placeholder);
values.placeholders.insert(row, index)
/// Determine if `scc` contains the CFG point `p`.
pub(crate) fn contains_point(&self, scc: N, p: Location) -> bool {
let index = self.location_map.point_from_location(p);
self.points.contains(scc, index)
}

fn contained_in_row<N: Idx>(self, values: &RegionValues<'tcx, N>, row: N) -> bool {
let placeholder: ty::PlaceholderRegion<'tcx> = self.into();
let index = values.placeholder_indices.lookup_index(placeholder);
values.placeholders.contains(row, index)
/// Determine if `scc` contains the free region `free_region`.
pub(crate) fn contains_free_region(&self, scc: N, free_region: RegionVid) -> bool {
self.free_regions.contains(scc, free_region)
}
}

Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ pub(crate) unsafe fn create_module<'ll>(
if sess.target.arch == Arch::PowerPC64 {
// LLVM 22 updated the ABI alignment for double on AIX: https://github.com/llvm/llvm-project/pull/144673
target_data_layout = target_data_layout.replace("-f64:32:64", "");

// LLVM 22 fixed the data layout calculation for targets that default to ELFv1
// when the ABI is set to ELFv2. With LLVM 21, the ELFv1 datalayout must be used,
// which will overalign function entries.
// https://github.com/llvm/llvm-project/pull/149725
if sess.target.llvm_target == "powerpc64-unknown-linux-gnu" {
target_data_layout = target_data_layout.replace("-Fn32", "-Fi64");
}
}
if sess.target.arch == Arch::AmdGpu {
// LLVM 22 specified ELF mangling in the amdgpu data layout:
Expand Down
Loading
Loading