Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 6ba6d22

Browse files
committed
Auto merge of rust-lang#107052 - compiler-errors:rollup-vxr22g5, r=compiler-errors
Rollup of 8 pull requests Successful merges: - rust-lang#105796 (rustdoc: simplify JS search routine by not messing with lev distance) - rust-lang#106753 (Make sure that RPITITs are not considered suggestable) - rust-lang#106917 (Encode const mir for closures if they're const) - rust-lang#107004 (Implement some candidates for the new solver (redux)) - rust-lang#107023 (Stop using `BREAK` & `CONTINUE` in compiler) - rust-lang#107030 (Correct typo) - rust-lang#107042 (rustdoc: fix corner cases with "?" JS keyboard command) - rust-lang#107045 (rustdoc: remove redundant CSS rule `#settings .setting-line`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8b11574 + e12c6b2 commit 6ba6d22

File tree

58 files changed

+736
-239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+736
-239
lines changed

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> {
225225
/// `align_offset(ptr, target_align)` needs special handling in const eval, because the pointer
226226
/// may not have an address.
227227
///
228-
/// If `ptr` does have a known address, then we return `CONTINUE` and the function call should
228+
/// If `ptr` does have a known address, then we return `Continue(())` and the function call should
229229
/// proceed as normal.
230230
///
231231
/// If `ptr` doesn't have an address, but its underlying allocation's alignment is at most
@@ -273,18 +273,18 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> {
273273
ret,
274274
StackPopUnwind::NotAllowed,
275275
)?;
276-
Ok(ControlFlow::BREAK)
276+
Ok(ControlFlow::Break(()))
277277
} else {
278278
// Not alignable in const, return `usize::MAX`.
279279
let usize_max = Scalar::from_machine_usize(self.machine_usize_max(), self);
280280
self.write_scalar(usize_max, dest)?;
281281
self.return_to_block(ret)?;
282-
Ok(ControlFlow::BREAK)
282+
Ok(ControlFlow::Break(()))
283283
}
284284
}
285285
Err(_addr) => {
286286
// The pointer has an address, continue with function call.
287-
Ok(ControlFlow::CONTINUE)
287+
Ok(ControlFlow::Continue(()))
288288
}
289289
}
290290
}

compiler/rustc_const_eval/src/interpret/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ where
2626

2727
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
2828
if !ty.needs_subst() {
29-
return ControlFlow::CONTINUE;
29+
return ControlFlow::Continue(());
3030
}
3131

3232
match *ty.kind() {
@@ -48,7 +48,7 @@ where
4848
return subst.visit_with(self);
4949
}
5050
}
51-
ControlFlow::CONTINUE
51+
ControlFlow::Continue(())
5252
}
5353
_ => ty.super_visit_with(self),
5454
}

compiler/rustc_const_eval/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Rust MIR: a lowered representation of Rust.
66

77
#![feature(assert_matches)]
88
#![feature(box_patterns)]
9-
#![feature(control_flow_enum)]
109
#![feature(decl_macro)]
1110
#![feature(exact_size_is_empty)]
1211
#![feature(let_chains)]

compiler/rustc_data_structures/src/graph/iterate/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,12 @@ where
317317
_node: G::Node,
318318
_prior_status: Option<NodeStatus>,
319319
) -> ControlFlow<Self::BreakVal> {
320-
ControlFlow::CONTINUE
320+
ControlFlow::Continue(())
321321
}
322322

323323
/// Called after all nodes reachable from this one have been examined.
324324
fn node_settled(&mut self, _node: G::Node) -> ControlFlow<Self::BreakVal> {
325-
ControlFlow::CONTINUE
325+
ControlFlow::Continue(())
326326
}
327327

328328
/// Behave as if no edges exist from `source` to `target`.
@@ -346,8 +346,8 @@ where
346346
prior_status: Option<NodeStatus>,
347347
) -> ControlFlow<Self::BreakVal> {
348348
match prior_status {
349-
Some(NodeStatus::Visited) => ControlFlow::BREAK,
350-
_ => ControlFlow::CONTINUE,
349+
Some(NodeStatus::Visited) => ControlFlow::Break(()),
350+
_ => ControlFlow::Continue(()),
351351
}
352352
}
353353
}

compiler/rustc_data_structures/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(associated_type_bounds)]
1212
#![feature(auto_traits)]
1313
#![feature(cell_leak)]
14-
#![feature(control_flow_enum)]
1514
#![feature(extend_one)]
1615
#![feature(hash_raw_entry)]
1716
#![feature(hasher_prefixfree_extras)]

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
267267
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
268268
debug!(?t, "root_visit_ty");
269269
if t == self.opaque_identity_ty {
270-
ControlFlow::CONTINUE
270+
ControlFlow::Continue(())
271271
} else {
272272
t.visit_with(&mut ConstrainOpaqueTypeRegionVisitor {
273273
tcx: self.tcx,
@@ -282,7 +282,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
282282
if self.references_parent_regions {
283283
ControlFlow::Break(t)
284284
} else {
285-
ControlFlow::CONTINUE
285+
ControlFlow::Continue(())
286286
}
287287
}
288288
}
@@ -1439,7 +1439,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) -> E
14391439
match *t.kind() {
14401440
ty::Alias(ty::Opaque, ty::AliasTy { def_id: def, .. }) => {
14411441
self.0.push(def);
1442-
ControlFlow::CONTINUE
1442+
ControlFlow::Continue(())
14431443
}
14441444
_ => t.super_visit_with(self),
14451445
}

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
14281428
}
14291429

14301430
fn visit_region(&mut self, _: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
1431-
ControlFlow::BREAK
1431+
ControlFlow::Break(())
14321432
}
14331433

14341434
fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {

compiler/rustc_hir_analysis/src/coherence/orphan.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,13 @@ fn fast_reject_auto_impl<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId, self_ty:
416416
if t != self.self_ty_root {
417417
for impl_def_id in tcx.non_blanket_impls_for_ty(self.trait_def_id, t) {
418418
match tcx.impl_polarity(impl_def_id) {
419-
ImplPolarity::Negative => return ControlFlow::BREAK,
419+
ImplPolarity::Negative => return ControlFlow::Break(()),
420420
ImplPolarity::Reservation => {}
421421
// FIXME(@lcnr): That's probably not good enough, idk
422422
//
423423
// We might just want to take the rustdoc code and somehow avoid
424424
// explicit impls for `Self`.
425-
ImplPolarity::Positive => return ControlFlow::CONTINUE,
425+
ImplPolarity::Positive => return ControlFlow::Continue(()),
426426
}
427427
}
428428
}
@@ -440,7 +440,7 @@ fn fast_reject_auto_impl<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId, self_ty:
440440
}
441441
}
442442

443-
ControlFlow::CONTINUE
443+
ControlFlow::Continue(())
444444
}
445445
_ => t.super_visit_with(self),
446446
}

compiler/rustc_hir_analysis/src/constrained_generic_params.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'tcx> TypeVisitor<'tcx> for ParameterCollector {
6161
match *t.kind() {
6262
ty::Alias(ty::Projection, ..) if !self.include_nonconstraining => {
6363
// projections are not injective
64-
return ControlFlow::CONTINUE;
64+
return ControlFlow::Continue(());
6565
}
6666
ty::Param(data) => {
6767
self.parameters.push(Parameter::from(data));
@@ -76,7 +76,7 @@ impl<'tcx> TypeVisitor<'tcx> for ParameterCollector {
7676
if let ty::ReEarlyBound(data) = *r {
7777
self.parameters.push(Parameter::from(data));
7878
}
79-
ControlFlow::CONTINUE
79+
ControlFlow::Continue(())
8080
}
8181

8282
fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {

compiler/rustc_hir_analysis/src/variance/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
9292
a.visit_with(self)?;
9393
}
9494
}
95-
ControlFlow::CONTINUE
95+
ControlFlow::Continue(())
9696
} else {
9797
substs.visit_with(self)
9898
}

0 commit comments

Comments
 (0)