diff options
| author | bors <bors@rust-lang.org> | 2023-01-19 02:09:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-19 02:09:45 +0000 |
| commit | 6ba6d22bdf5348e566dedc77a7dfee3f3804f2fb (patch) | |
| tree | a692060b061247109fb5a7302e39fc0b30c3dd9d /compiler/rustc_const_eval/src | |
| parent | 8b11574ca07f95dd33861d145a43708c20cb4eb5 (diff) | |
| parent | e12c6b277fab3aa401d38b89b0b3ec8fc96c8bde (diff) | |
| download | rust-6ba6d22bdf5348e566dedc77a7dfee3f3804f2fb.tar.gz rust-6ba6d22bdf5348e566dedc77a7dfee3f3804f2fb.zip | |
Auto merge of #107052 - compiler-errors:rollup-vxr22g5, r=compiler-errors
Rollup of 8 pull requests Successful merges: - #105796 (rustdoc: simplify JS search routine by not messing with lev distance) - #106753 (Make sure that RPITITs are not considered suggestable) - #106917 (Encode const mir for closures if they're const) - #107004 (Implement some candidates for the new solver (redux)) - #107023 (Stop using `BREAK` & `CONTINUE` in compiler) - #107030 (Correct typo) - #107042 (rustdoc: fix corner cases with "?" JS keyboard command) - #107045 (rustdoc: remove redundant CSS rule `#settings .setting-line`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/machine.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/util.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/lib.rs | 1 |
3 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 4f7c1fc96f1..ca6b01d8a8a 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -225,7 +225,7 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> { /// `align_offset(ptr, target_align)` needs special handling in const eval, because the pointer /// may not have an address. /// - /// If `ptr` does have a known address, then we return `CONTINUE` and the function call should + /// If `ptr` does have a known address, then we return `Continue(())` and the function call should /// proceed as normal. /// /// 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> { ret, StackPopUnwind::NotAllowed, )?; - Ok(ControlFlow::BREAK) + Ok(ControlFlow::Break(())) } else { // Not alignable in const, return `usize::MAX`. let usize_max = Scalar::from_machine_usize(self.machine_usize_max(), self); self.write_scalar(usize_max, dest)?; self.return_to_block(ret)?; - Ok(ControlFlow::BREAK) + Ok(ControlFlow::Break(())) } } Err(_addr) => { // The pointer has an address, continue with function call. - Ok(ControlFlow::CONTINUE) + Ok(ControlFlow::Continue(())) } } } diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs index a61d3ab40a5..cabc65e2c07 100644 --- a/compiler/rustc_const_eval/src/interpret/util.rs +++ b/compiler/rustc_const_eval/src/interpret/util.rs @@ -26,7 +26,7 @@ where fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { if !ty.needs_subst() { - return ControlFlow::CONTINUE; + return ControlFlow::Continue(()); } match *ty.kind() { @@ -48,7 +48,7 @@ where return subst.visit_with(self); } } - ControlFlow::CONTINUE + ControlFlow::Continue(()) } _ => ty.super_visit_with(self), } diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs index 46e7b09a55e..57b91df2d07 100644 --- a/compiler/rustc_const_eval/src/lib.rs +++ b/compiler/rustc_const_eval/src/lib.rs @@ -6,7 +6,6 @@ Rust MIR: a lowered representation of Rust. #![feature(assert_matches)] #![feature(box_patterns)] -#![feature(control_flow_enum)] #![feature(decl_macro)] #![feature(exact_size_is_empty)] #![feature(let_chains)] |
