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 7 pull requests #128439

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b4e1a53
Update target-spec metadata for loongarch64 targets
heiher Jul 28, 2024
9e05fb6
Small simplification
Nadrieril Jun 23, 2024
e2fd9aa
Set up false edges in `lower_match_tree`
Nadrieril Jun 23, 2024
cbdacec
Abstract out the candidate manipulation not in the main algorithm
Nadrieril Jun 23, 2024
c747166
Visiting bindings is straightforward now
Nadrieril Jun 23, 2024
08bcc01
Entirely hide `Candidate`s from outside `lower_match_tree`
Nadrieril Jun 30, 2024
a75d2f9
Cleanup sys module to match house style
ChrisDenton Jul 24, 2024
9169622
Move Windows implementation of anon pipe
ChrisDenton Jul 24, 2024
c586eb6
Specify the integer type of the `powi` LLVM intrinsic
tgross35 Jul 12, 2024
b6d0517
Add math intrinsics for `f16` and `f128`
tgross35 Jun 19, 2024
90e63dd
Add math functions for `f16` and `f128`
tgross35 Jun 27, 2024
a4657dd
Add `core` functions for `f16` and `f128` that require math routines
tgross35 Jul 17, 2024
e1d23c9
Update comments for `{f16, f32, f64, f128}::midpoint`
tgross35 Jul 18, 2024
d64bbb1
Add a disclaimer about x86 `f128` math functions
tgross35 Jul 30, 2024
f6f587e
Introduce REDUNDANT_IMPORTS lint
compiler-errors Apr 11, 2024
e84a7d9
Remove unneeded `pub(crate)`
ChrisDenton Jul 31, 2024
62d4998
Add VxWorks platfrom support documents
Jul 31, 2024
f6c4110
improve bootstrap to allow selecting llvm tools individually
onur-ozkan Jul 31, 2024
82bcc42
Rollup merge of #123813 - compiler-errors:redundant-lint, r=petrochenkov
matthiaskrgr Jul 31, 2024
10f2ff2
Rollup merge of #127159 - Nadrieril:hide-candidate, r=matthewjasper
matthiaskrgr Jul 31, 2024
28cddd7
Rollup merge of #128162 - ChrisDenton:cleanup, r=joboet
matthiaskrgr Jul 31, 2024
723bd6b
Rollup merge of #128296 - heiher:update-metadata, r=Urgau
matthiaskrgr Jul 31, 2024
ee5a829
Rollup merge of #128417 - tgross35:f16-f128-math, r=dtolnay
matthiaskrgr Jul 31, 2024
113ca15
Rollup merge of #128431 - biabbas:master, r=Urgau
matthiaskrgr Jul 31, 2024
91869da
Rollup merge of #128437 - onur-ozkan:handle-llvm-tools-properly, r=al…
matthiaskrgr Jul 31, 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
Prev Previous commit
Next Next commit
Small simplification
Nadrieril committed Jul 29, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 9e05fb67a3360b9faf49b3484e2ac5cec27a6e78
34 changes: 20 additions & 14 deletions compiler/rustc_mir_build/src/build/matches/mod.rs
Original file line number Diff line number Diff line change
@@ -1199,6 +1199,17 @@ impl<'tcx, 'pat> Candidate<'pat, 'tcx> {
|_| {},
);
}

/// Visit the leaf candidates in reverse order.
fn visit_leaves_rev<'a>(&'a mut self, mut visit_leaf: impl FnMut(&'a mut Self)) {
traverse_candidate(
self,
&mut (),
&mut move |c, _| visit_leaf(c),
move |c, _| c.subcandidates.iter_mut().rev(),
|_| {},
);
}
}

/// A depth-first traversal of the `Candidate` and all of its recursive
@@ -1433,23 +1444,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let otherwise_block =
self.match_candidates(match_start_span, scrutinee_span, block, candidates);

// Link each leaf candidate to the `false_edge_start_block` of the next one.
let mut previous_candidate: Option<&mut Candidate<'_, '_>> = None;
for candidate in candidates {
candidate.visit_leaves(|leaf_candidate| {
if let Some(ref mut prev) = previous_candidate {
assert!(leaf_candidate.false_edge_start_block.is_some());
prev.next_candidate_start_block = leaf_candidate.false_edge_start_block;
}
previous_candidate = Some(leaf_candidate);
// Link each leaf candidate to the `false_edge_start_block` of the next one. In the
// refutable case we also want a false edge to the failure block.
let mut next_candidate_start_block = if refutable { Some(otherwise_block) } else { None };
for candidate in candidates.iter_mut().rev() {
candidate.visit_leaves_rev(|leaf_candidate| {
leaf_candidate.next_candidate_start_block = next_candidate_start_block;
assert!(leaf_candidate.false_edge_start_block.is_some());
next_candidate_start_block = leaf_candidate.false_edge_start_block;
});
}

if refutable {
// In refutable cases there's always at least one candidate, and we want a false edge to
// the failure block.
previous_candidate.as_mut().unwrap().next_candidate_start_block = Some(otherwise_block)
} else {
if !refutable {
// Match checking ensures `otherwise_block` is actually unreachable in irrefutable
// cases.
let source_info = self.source_info(scrutinee_span);