about summary refs log tree commit diff
path: root/src/libstd/sys/windows/fs.rs
diff options
context:
space:
mode:
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>2019-05-27 16:44:06 +0200
committerHugo Beauzée-Luyssen <hugo@beauzee.fr>2019-07-25 21:30:08 +0200
commitef267284e8a2d021afe70f00eabcbbf7d076d56f (patch)
tree25d0941db1b956cb0dba50cf0f479c5ec3dcfcec /src/libstd/sys/windows/fs.rs
parenta713a0399a6e63de1c8009a390ae964ff03f4067 (diff)
downloadrust-ef267284e8a2d021afe70f00eabcbbf7d076d56f.tar.gz
rust-ef267284e8a2d021afe70f00eabcbbf7d076d56f.zip
std: win: Don't expose link() on UWP
Or rather expose it, but always return an error
Diffstat (limited to 'src/libstd/sys/windows/fs.rs')
-rw-r--r--src/libstd/sys/windows/fs.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs
index d5cb205c85f..f6f64a008bb 100644
--- a/src/libstd/sys/windows/fs.rs
+++ b/src/libstd/sys/windows/fs.rs
@@ -670,6 +670,7 @@ pub fn symlink_inner(src: &Path, dst: &Path, dir: bool) -> io::Result<()> {
     Ok(())
 }
 
+#[cfg(not(target_vendor = "uwp"))]
 pub fn link(src: &Path, dst: &Path) -> io::Result<()> {
     let src = to_u16s(src)?;
     let dst = to_u16s(dst)?;
@@ -679,6 +680,12 @@ pub fn link(src: &Path, dst: &Path) -> io::Result<()> {
     Ok(())
 }
 
+#[cfg(target_vendor = "uwp")]
+pub fn link(_src: &Path, _dst: &Path) -> io::Result<()> {
+    return Err(io::Error::new(io::ErrorKind::Other,
+                            "hard link are not supported on UWP"));
+}
+
 pub fn stat(path: &Path) -> io::Result<FileAttr> {
     let mut opts = OpenOptions::new();
     // No read or write permissions are necessary