about summary refs log tree commit diff
path: root/src/libstd/sys/windows
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2016-08-06 15:01:20 +0300
committerGitHub <noreply@github.com>2016-08-06 15:01:20 +0300
commit68f7b265042c5dc023f24aaf65db60d030c8dbc2 (patch)
tree2c76880f49ac6ee7ede90148c0aa631daa95f515 /src/libstd/sys/windows
parent8e04264b2387c66e10d150e50fca4cb9cba19046 (diff)
parent291b6f16bb03c92fb383dfa12b8849808bace801 (diff)
downloadrust-68f7b265042c5dc023f24aaf65db60d030c8dbc2.tar.gz
rust-68f7b265042c5dc023f24aaf65db60d030c8dbc2.zip
Rollup merge of #34916 - tbu-:pr_comment_on_seek_cast, r=GuillaumeGomez
Comment on the casts in the `seek` implementations on files
Diffstat (limited to 'src/libstd/sys/windows')
-rw-r--r--src/libstd/sys/windows/fs.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs
index 2683e57256d..4e6cef9a28d 100644
--- a/src/libstd/sys/windows/fs.rs
+++ b/src/libstd/sys/windows/fs.rs
@@ -324,6 +324,8 @@ impl File {
 
     pub fn seek(&self, pos: SeekFrom) -> io::Result<u64> {
         let (whence, pos) = match pos {
+            // Casting to `i64` is fine, `SetFilePointerEx` reinterprets this
+            // integer as `u64`.
             SeekFrom::Start(n) => (c::FILE_BEGIN, n as i64),
             SeekFrom::End(n) => (c::FILE_END, n),
             SeekFrom::Current(n) => (c::FILE_CURRENT, n),