about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2019-05-18 15:56:53 +0200
committerJonas Schievink <jonasschievink@gmail.com>2019-07-23 17:17:31 +0200
commit138e08ccf6f6c6caf55a135bd0edcba8e6855df5 (patch)
tree87eabfe1808c8fad13278d5e1e7f802f1526caeb /src/libstd
parentba78db310b2ddf9b5f8e6c87a58e8ea8df374e16 (diff)
downloadrust-138e08ccf6f6c6caf55a135bd0edcba8e6855df5.tar.gz
rust-138e08ccf6f6c6caf55a135bd0edcba8e6855df5.zip
Make #[doc(include)] paths behave like other paths
This makes them relative to the containing file instead of the crate
root
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/os/raw/mod.rs48
1 files changed, 32 insertions, 16 deletions
diff --git a/src/libstd/os/raw/mod.rs b/src/libstd/os/raw/mod.rs
index c0b0b6d40d8..fd50657800d 100644
--- a/src/libstd/os/raw/mod.rs
+++ b/src/libstd/os/raw/mod.rs
@@ -8,7 +8,8 @@
 
 #![stable(feature = "raw_os", since = "1.1.0")]
 
-#[doc(include = "os/raw/char.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/char.md"))]
+#[cfg_attr(not(stage0), doc(include = "char.md"))]
 #[cfg(any(all(target_os = "linux", any(target_arch = "aarch64",
                                        target_arch = "arm",
                                        target_arch = "powerpc",
@@ -31,7 +32,8 @@
                                          target_arch = "powerpc")),
           all(target_os = "fuchsia", target_arch = "aarch64")))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
-#[doc(include = "os/raw/char.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/char.md"))]
+#[cfg_attr(not(stage0), doc(include = "char.md"))]
 #[cfg(not(any(all(target_os = "linux", any(target_arch = "aarch64",
                                            target_arch = "arm",
                                            target_arch = "powerpc",
@@ -54,37 +56,51 @@
                                              target_arch = "powerpc")),
               all(target_os = "fuchsia", target_arch = "aarch64"))))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = i8;
-#[doc(include = "os/raw/schar.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/schar.md"))]
+#[cfg_attr(not(stage0), doc(include = "schar.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_schar = i8;
-#[doc(include = "os/raw/uchar.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/uchar.md"))]
+#[cfg_attr(not(stage0), doc(include = "uchar.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_uchar = u8;
-#[doc(include = "os/raw/short.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/short.md"))]
+#[cfg_attr(not(stage0), doc(include = "short.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_short = i16;
-#[doc(include = "os/raw/ushort.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/ushort.md"))]
+#[cfg_attr(not(stage0), doc(include = "ushort.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_ushort = u16;
-#[doc(include = "os/raw/int.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/int.md"))]
+#[cfg_attr(not(stage0), doc(include = "int.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_int = i32;
-#[doc(include = "os/raw/uint.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/uint.md"))]
+#[cfg_attr(not(stage0), doc(include = "uint.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_uint = u32;
-#[doc(include = "os/raw/long.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/long.md"))]
+#[cfg_attr(not(stage0), doc(include = "long.md"))]
 #[cfg(any(target_pointer_width = "32", windows))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_long = i32;
-#[doc(include = "os/raw/ulong.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/ulong.md"))]
+#[cfg_attr(not(stage0), doc(include = "ulong.md"))]
 #[cfg(any(target_pointer_width = "32", windows))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulong = u32;
-#[doc(include = "os/raw/long.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/long.md"))]
+#[cfg_attr(not(stage0), doc(include = "long.md"))]
 #[cfg(all(target_pointer_width = "64", not(windows)))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_long = i64;
-#[doc(include = "os/raw/ulong.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/ulong.md"))]
+#[cfg_attr(not(stage0), doc(include = "ulong.md"))]
 #[cfg(all(target_pointer_width = "64", not(windows)))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulong = u64;
-#[doc(include = "os/raw/longlong.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/longlong.md"))]
+#[cfg_attr(not(stage0), doc(include = "longlong.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_longlong = i64;
-#[doc(include = "os/raw/ulonglong.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/ulonglong.md"))]
+#[cfg_attr(not(stage0), doc(include = "ulonglong.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulonglong = u64;
-#[doc(include = "os/raw/float.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/float.md"))]
+#[cfg_attr(not(stage0), doc(include = "float.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_float = f32;
-#[doc(include = "os/raw/double.md")]
+#[cfg_attr(stage0, doc(include = "os/raw/double.md"))]
+#[cfg_attr(not(stage0), doc(include = "double.md"))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_double = f64;
 
 #[stable(feature = "raw_os", since = "1.1.0")]