diff options
| author | bors <bors@rust-lang.org> | 2019-12-24 14:40:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-12-24 14:40:33 +0000 |
| commit | f6dca76be55dd6bb8d0d7d3b6bc39ae8373db506 (patch) | |
| tree | 7a11fc8bb67b4bdcdc6c49860d1f41381411f64f /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs | |
| parent | 84d8f9ddd3819501735d30b3c584c6935ef6c9da (diff) | |
| parent | 811bdeee002827fbc950ac52a6175e933567823c (diff) | |
| download | rust-f6dca76be55dd6bb8d0d7d3b6bc39ae8373db506.tar.gz rust-f6dca76be55dd6bb8d0d7d3b6bc39ae8373db506.zip | |
Auto merge of #66221 - ohadravid:doc-constants, r=Dylan-DPC
Show the actual value of constant values in the documentation Fixes #66099, making rustdoc show evaluated constant scalar values.  where `main.rs` is ``` pub const VAL3: i32 = i32::max_value(); pub const VAL4: i32 = i32::max_value() - 1; ``` As a fallback, when a constant value is not evaluated (either because of an error or because it isn't a scalar), the original expression is used for consistency. I mimicked the way min/max values of integers are [`pretty_print`ed](https://github.com/rust-lang/rust/blob/master/src/librustc/ty/print/pretty.rs#L900), to show both the value a the "hint". While a little goofy for `std`, in user crates I think it's actually rather helpful.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions
