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 8 pull requests #127519

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5df6f72
Add test
Nadrieril Jun 27, 2024
834f043
Fix expansion of or-patterns
Nadrieril Jun 27, 2024
90cbd0b
impl FusedIterator and a size hint for the error sources iter
Sky9x Jun 28, 2024
d9ed923
Use verbose style when suggesting changing `const` with `let`
estebank Jul 5, 2024
de14f1f
add test that multi-threaded panics aren't interleaved
jyn514 Jul 5, 2024
875b730
fix interleaved panic output
jyn514 Jul 5, 2024
ab56dfd
Account for `let foo = expr`; to suggest `const foo: Ty = expr;`
estebank Jul 8, 2024
321eba5
Update f16/f128 FIXMEs that needed (NEG_)INFINITY
tgross35 Jul 8, 2024
ec662e7
`#[doc(alias)]`'s doc: say that ASCII spaces are allowed
ShE3py Jul 8, 2024
96a7916
Update a f16/f128 FIXME to be more accurate
tgross35 Jul 8, 2024
7097dbc
exhaustively destructure external constraints
lcnr Jul 9, 2024
e38109d
use `update_parent_goal` for lazy updates
lcnr Jul 9, 2024
fd9a925
Automatically taint when reporting errors from ItemCtxt
oli-obk Jul 5, 2024
aece064
Remove HirTyLowerer::set_tainted_by_errors, since it is now redundant
oli-obk Jul 5, 2024
dd175fe
cycle_participants to nested_goals
lcnr Jul 9, 2024
64bebff
Rollup merge of #127028 - Nadrieril:fix-or-pat-expansion, r=matthewja…
matthiaskrgr Jul 9, 2024
d591c2b
Rollup merge of #127091 - Sky9x:fused-error-sources-iter, r=dtolnay
matthiaskrgr Jul 9, 2024
a557e18
Rollup merge of #127358 - oli-obk:taint_itemctxt, r=fmease
matthiaskrgr Jul 9, 2024
2fea2c7
Rollup merge of #127382 - estebank:const-let, r=compiler-errors
matthiaskrgr Jul 9, 2024
d2220e3
Rollup merge of #127397 - jyn514:multi-thread-panic-hook, r=workingju…
matthiaskrgr Jul 9, 2024
5b84462
Rollup merge of #127484 - ShE3py:rustdoc-doc-alias-whitespace-doc, r=…
matthiaskrgr Jul 9, 2024
4f6ede1
Rollup merge of #127496 - tgross35:f16-f128-pattern-fixme, r=Nadrieril
matthiaskrgr Jul 9, 2024
9a1c4cb
Rollup merge of #127508 - lcnr:search-graph-prep, r=compiler-errors
matthiaskrgr Jul 9, 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
cycle_participants to nested_goals
  • Loading branch information
lcnr committed Jul 9, 2024
commit dd175feb25bc09484a74994a1b80af290eeb6509
22 changes: 11 additions & 11 deletions compiler/rustc_next_trait_solver/src/solve/search_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct StackEntry<I: Interner> {
/// C :- D
/// D :- C
/// ```
cycle_participants: HashSet<CanonicalInput<I>>,
nested_goals: HashSet<CanonicalInput<I>>,
/// Starts out as `None` and gets set when rerunning this
/// goal in case we encounter a cycle.
provisional_result: Option<QueryResult<I>>,
Expand Down Expand Up @@ -215,8 +215,8 @@ impl<I: Interner> SearchGraph<I> {
let current_cycle_root = &mut stack[current_root.as_usize()];
for entry in cycle_participants {
entry.non_root_cycle_participant = entry.non_root_cycle_participant.max(Some(head));
current_cycle_root.cycle_participants.insert(entry.input);
current_cycle_root.cycle_participants.extend(mem::take(&mut entry.cycle_participants));
current_cycle_root.nested_goals.insert(entry.input);
current_cycle_root.nested_goals.extend(mem::take(&mut entry.nested_goals));
}
}

Expand Down Expand Up @@ -335,7 +335,7 @@ impl<I: Interner> SearchGraph<I> {
non_root_cycle_participant: None,
encountered_overflow: false,
has_been_used: HasBeenUsed::empty(),
cycle_participants: Default::default(),
nested_goals: Default::default(),
provisional_result: None,
};
assert_eq!(self.stack.push(entry), depth);
Expand Down Expand Up @@ -389,15 +389,15 @@ impl<I: Interner> SearchGraph<I> {
//
// We must not use the global cache entry of a root goal if a cycle
// participant is on the stack. This is necessary to prevent unstable
// results. See the comment of `StackEntry::cycle_participants` for
// results. See the comment of `StackEntry::nested_goals` for
// more details.
self.global_cache(cx).insert(
cx,
input,
proof_tree,
reached_depth,
final_entry.encountered_overflow,
final_entry.cycle_participants,
final_entry.nested_goals,
dep_node,
result,
)
Expand Down Expand Up @@ -544,27 +544,27 @@ impl<I: Interner> SearchGraph<I> {
non_root_cycle_participant,
encountered_overflow: _,
has_been_used,
ref cycle_participants,
ref nested_goals,
provisional_result,
} = *entry;
let cache_entry = provisional_cache.get(&entry.input).unwrap();
assert_eq!(cache_entry.stack_depth, Some(depth));
if let Some(head) = non_root_cycle_participant {
assert!(head < depth);
assert!(cycle_participants.is_empty());
assert!(nested_goals.is_empty());
assert_ne!(stack[head].has_been_used, HasBeenUsed::empty());

let mut current_root = head;
while let Some(parent) = stack[current_root].non_root_cycle_participant {
current_root = parent;
}
assert!(stack[current_root].cycle_participants.contains(&input));
assert!(stack[current_root].nested_goals.contains(&input));
}

if !cycle_participants.is_empty() {
if !nested_goals.is_empty() {
assert!(provisional_result.is_some() || !has_been_used.is_empty());
for entry in stack.iter().take(depth.as_usize()) {
assert_eq!(cycle_participants.get(&entry.input), None);
assert_eq!(nested_goals.get(&entry.input), None);
}
}
}
Expand Down
Loading