]> git.lizzy.rs Git - rust.git/commit
Auto merge of #73513 - oli-obk:const_binop_overflow, r=estebank
authorbors <bors@rust-lang.org>
Fri, 26 Jun 2020 14:08:46 +0000 (14:08 +0000)
committerbors <bors@rust-lang.org>
Fri, 26 Jun 2020 14:08:46 +0000 (14:08 +0000)
commit7750c3d46bc19784adb1ee6e37a5ec7e4cd7e772
treee395669f205e3b46ff20c3eaa11b02b07f52528d
parent9672b5e95c520774cc17bffc7031c80a1bcf4b4c
parent819cde5dabd90dab1fb462cd713457421d0ebd36
Auto merge of #73513 - oli-obk:const_binop_overflow, r=estebank

Show the values and computation that would overflow a const evaluation or propagation

Fixes #71134

In contrast to the example in the issue it doesn't use individual spans for each operand. The effort required to implement that is quite high compared to the little (if at all) benefit it would bring to diagnostics.

cc @shepmaster

The way this is implemented it is also fairly easy to do the same for overflow panics at runtime, but that should be done in a separate PR since it may have runtime performance implications.
src/librustdoc/clean/utils.rs