Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5a446c1
Fix `window.hashchange is not a function`
fmckeogh Aug 21, 2019
cab607e
Emit a single error on if expr with expectation and no else clause
estebank Sep 1, 2019
aae2b24
deduplicate code
estebank Sep 1, 2019
a9ce33c
Account for arbitrary self types in E0599
estebank Sep 1, 2019
84ccbe2
librustc_errors: Extract sugg/subst handling into method
phansch Sep 1, 2019
35c9e5f
Fix const_err with `-(-0.0)`
JohnTitor Sep 1, 2019
3a6aada
Add `opt-level` check
JohnTitor Sep 1, 2019
ab12dfe
following the same style
Sep 1, 2019
4a0872b
Add `overflow_check` check
JohnTitor Sep 1, 2019
f53c217
review comments
estebank Sep 1, 2019
8e9825a
Fix overflow_check
JohnTitor Sep 1, 2019
141f5a7
review comments
estebank Sep 1, 2019
0cd9c16
Fix condition and tests' flags
JohnTitor Sep 1, 2019
a937d8c
Fix tests again
JohnTitor Sep 1, 2019
991f436
Fix regex replacement in theme detection
GuillaumeGomez Sep 2, 2019
52c68d1
Add buffer abstraction
Mark-Simulacrum Aug 27, 2019
3c83d64
Migrate top-level rendering to Buffer
Mark-Simulacrum Aug 30, 2019
a076816
Create buffers in top-level rendering
Mark-Simulacrum Aug 30, 2019
8850cb5
Remove needless clone of layout
Mark-Simulacrum Aug 30, 2019
a3539f9
Move constant parameters to render to Layout struct
Mark-Simulacrum Aug 30, 2019
d869748
Replace writeln!/write! with push_str
Mark-Simulacrum Aug 31, 2019
14fcaa1
Remove unnecessary Buffer in layout::render
Mark-Simulacrum Aug 31, 2019
ca2801f
Move sidebar to Buffer-printing
Mark-Simulacrum Aug 31, 2019
2367975
Implement Print for FnOnce(&mut Buffer)
Mark-Simulacrum Aug 31, 2019
8c06e79
Delete Sidebar struct in favor of FnOnce impl
Mark-Simulacrum Aug 31, 2019
6ab9b32
De-indent all fmt::Display impls for later replacement to functions
Mark-Simulacrum Aug 31, 2019
6165313
layout::render takes Print instead of fmt::Display
Mark-Simulacrum Aug 31, 2019
a57f00d
Move Source to Buffer
Mark-Simulacrum Aug 31, 2019
cd92ed2
Settings to function
Mark-Simulacrum Aug 31, 2019
b2eb65b
AllTypes to function
Mark-Simulacrum Aug 31, 2019
31391ca
Item to function
Mark-Simulacrum Aug 31, 2019
a9c6ef6
Move to buffers throughout print_item
Mark-Simulacrum Aug 31, 2019
dd323f8
Emit error on intrinsic to fn ptr casts
Mark-Simulacrum Sep 2, 2019
cdc821f
Rollup merge of #63774 - chocol4te:fix_63707, r=GuillaumeGomez
Centril Sep 3, 2019
85baeec
Rollup merge of #64044 - Mark-Simulacrum:rustdoc-clean-2, r=Guillaume…
Centril Sep 3, 2019
781f533
Rollup merge of #64049 - estebank:if-else-type-err, r=Centril
Centril Sep 3, 2019
43eac83
Rollup merge of #64056 - estebank:arbitrary-self-types, r=Centril
Centril Sep 3, 2019
dd8d419
Rollup merge of #64058 - phansch:refactor_out_method, r=estebank
Centril Sep 3, 2019
c1832a6
Rollup merge of #64063 - JohnTitor:fix-const-err, r=oli-obk
Centril Sep 3, 2019
ed13e27
Rollup merge of #64071 - guanqun:style-fix, r=Centril
Centril Sep 3, 2019
3e427d9
Rollup merge of #64096 - GuillaumeGomez:theme-regex-fix, r=Mark-Simul…
Centril Sep 3, 2019
0de3668
Rollup merge of #64104 - Mark-Simulacrum:intrinsic-fn-ptr-ice, r=este…
Centril Sep 3, 2019
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
Add overflow_check check
  • Loading branch information
JohnTitor committed Sep 1, 2019
commit 4a0872b37efbd982aed7e29f166e4ccb095f5779
8 changes: 6 additions & 2 deletions src/librustc_mir/transform/const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,13 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
}

let arg = self.eval_operand(arg, source_info)?;
let is_release_mode = self.tcx.sess.opts.debugging_opts.mir_opt_level >= 2;
let is_release_mode = self.tcx.sess.overflow_checks();
let val = self.use_ecx(source_info, |this| {
let prim = this.ecx.read_immediate(arg)?;
match op {
UnOp::Neg => {
// We don't have to check overflow here when we already
// check it in release mode.
if is_release_mode
&& prim.to_bits()? == (1 << (prim.layout.size.bits() - 1)) {
throw_panic!(OverflowNeg)
Expand Down Expand Up @@ -485,7 +487,9 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
Scalar::from_bool(overflow).into(),
)
} else {
if self.tcx.sess.opts.debugging_opts.mir_opt_level >= 2 && overflow {
// We don't have to check overflow here when we already
// check it in release mode.
if self.tcx.sess.overflow_checks() && overflow {
let err = err_panic!(Overflow(op)).into();
let _: Option<()> = self.use_ecx(source_info, |_| Err(err));
return None;
Expand Down

This file was deleted.