about summary refs log tree commit diff
path: root/library/std/src/io/cursor/tests.rs
diff options
context:
space:
mode:
authorBenoît du Garreau <benoit.dugarreau@platform.sh>2020-11-06 17:46:56 +0100
committerBenoît du Garreau <benoit.dugarreau@platform.sh>2020-11-06 17:48:26 +0100
commitae059b532fcc504b75388d043d56ce12fdb055a7 (patch)
tree00090ce2836abe933e675e75b8a704e97f0e464a /library/std/src/io/cursor/tests.rs
parentdc06a36074f04c6a77b5834f2950011d49607898 (diff)
downloadrust-ae059b532fcc504b75388d043d56ce12fdb055a7.tar.gz
rust-ae059b532fcc504b75388d043d56ce12fdb055a7.zip
Make some std::io functions `const`
Includes:
- io::Cursor::new
- io::Cursor::get_ref
- io::Cursor::position
- io::empty
- io::repeat
- io::sink
Diffstat (limited to 'library/std/src/io/cursor/tests.rs')
-rw-r--r--library/std/src/io/cursor/tests.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/std/src/io/cursor/tests.rs b/library/std/src/io/cursor/tests.rs
index 80d88ca66f6..5da31ce0ba7 100644
--- a/library/std/src/io/cursor/tests.rs
+++ b/library/std/src/io/cursor/tests.rs
@@ -514,3 +514,10 @@ fn test_eq() {
 
     let _: AssertEq<Cursor<Vec<u8>>> = AssertEq(Cursor::new(Vec::new()));
 }
+
+#[allow(dead_code)]
+fn const_cursor() {
+    const CURSOR: Cursor<&[u8]> = Cursor::new(&[0]);
+    const _: &&[u8] = CURSOR.get_ref();
+    const _: u64 = CURSOR.position();
+}