]> git.lizzy.rs Git - rust.git/commitdiff
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)
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.

1  2 
src/librustdoc/clean/utils.rs

Simple merge