about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-20 00:37:27 +0100
committerGitHub <noreply@github.com>2022-02-20 00:37:27 +0100
commit9e9cc66e428b5a073d5583fb0071c629e1c8bc52 (patch)
tree4c3a47e746f06bdad082af4f823db315aa5a04cd /src/test/rustdoc
parent1771b98a69b0b8d142507cce4b32db404950add6 (diff)
parent296adbac0a6bb06d60459ec0cd634cb530d3be3d (diff)
downloadrust-9e9cc66e428b5a073d5583fb0071c629e1c8bc52.tar.gz
rust-9e9cc66e428b5a073d5583fb0071c629e1c8bc52.zip
Rollup merge of #94091 - GuillaumeGomez:rustdoc-const-computed-value, r=oli-obk
Fix rustdoc const computed value

Fixes #85088.

It looks like this now (instead of hexadecimal):

![Screenshot from 2022-02-17 17-55-39](https://user-images.githubusercontent.com/3050060/154532115-0f9861a0-406f-4c9c-957f-32bedd8aca7d.png)

r? ````@oli-obk````
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/const-value-display.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/rustdoc/const-value-display.rs b/src/test/rustdoc/const-value-display.rs
new file mode 100644
index 00000000000..0ae52592b64
--- /dev/null
+++ b/src/test/rustdoc/const-value-display.rs
@@ -0,0 +1,9 @@
+#![crate_name = "foo"]
+
+// @has 'foo/constant.HOUR_IN_SECONDS.html'
+// @has - '//*[@class="docblock item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = 60 * 60; // 3_600u64'
+pub const HOUR_IN_SECONDS: u64 = 60 * 60;
+
+// @has 'foo/constant.NEGATIVE.html'
+// @has - '//*[@class="docblock item-decl"]//code' 'pub const NEGATIVE: i64 = -60 * 60; // -3_600i64'
+pub const NEGATIVE: i64 = -60 * 60;