rust/compiler/rustc_middle/src
Michael Goulet 5460f92a0f
Rollup merge of #112168 - scottmcm:lower-div-rem-unchecked-to-mir, r=oli-obk
Lower `unchecked_div`/`_rem` to MIR's `BinOp::Div`/`Rem`

As described in <https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.BinOp.html#variant.Div>, the ordinary `BinOp`s for these are already UB for division by zero ([or overflow](https://llvm.org/docs/LangRef.html#sdiv-instruction), [demo](https://rust.godbolt.org/z/71e7P7Exh)), as MIR building is responsible for inserting code to panic for those cases regardless of whether the overflow checks are enabled.

So we can lower these in the same arm that lowers `wrapping_add` to MIR `BinOp::Add` and such, as all these cases turn into ordinary `Rvalue::BinaryOp`s.
2023-06-02 16:02:06 -07:00
..
dep_graph Allow LocalDefId as the argument to def_path_str 2023-04-21 22:27:20 +00:00
hir Separate AnonConst from ConstBlock in HIR. 2023-06-02 21:25:18 +00:00
infer Rename tcx.mk_re_* => Region::new_* 2023-05-29 17:54:53 +00:00
middle Remove const eval limit and implement an exponential backoff lint instead 2023-05-31 10:24:17 +00:00
mir Rollup merge of #112168 - scottmcm:lower-div-rem-unchecked-to-mir, r=oli-obk 2023-06-02 16:02:06 -07:00
query Rename impl_defaultness to defaultness 2023-06-01 06:14:06 +00:00
thir offset_of 2023-04-21 02:14:02 -07:00
traits Rollup merge of #112165 - fee1-dead-contrib:rn-defualtness, r=compiler-errors 2023-06-02 18:12:45 +02:00
ty Rollup merge of #112189 - compiler-errors:bad-gen, r=cjgillot 2023-06-02 18:12:46 +02:00
util Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
arena.rs Prepopulate opaques in canonical input 2023-05-25 03:21:22 +00:00
error.rs Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
lib.rs Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
lint.rs Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
macros.rs Simplify CloneLiftImpls and TrivialTypeTraversalImpls. 2023-04-16 14:19:50 +10:00
metadata.rs rustc_metadata: Remove Span from ModChild 2023-04-18 17:25:04 +03:00
tests.rs
thir.rs Remove unused TypeFoldable/TypeVisitable impls. 2023-04-26 15:19:50 +10:00
values.rs EarlyBinder::new -> EarlyBinder::bind 2023-05-29 13:46:10 +02:00