diff options
| author | Benoît du Garreau <benoit.dugarreau@platform.sh> | 2020-11-06 17:46:56 +0100 |
|---|---|---|
| committer | Benoît du Garreau <benoit.dugarreau@platform.sh> | 2020-11-06 17:48:26 +0100 |
| commit | ae059b532fcc504b75388d043d56ce12fdb055a7 (patch) | |
| tree | 00090ce2836abe933e675e75b8a704e97f0e464a /library/std/src/io/cursor/tests.rs | |
| parent | dc06a36074f04c6a77b5834f2950011d49607898 (diff) | |
| download | rust-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.rs | 7 |
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(); +} |
