@@ -31,7 +31,8 @@ pub trait FileExt {
3131 ///
3232 /// # Examples
3333 ///
34- /// ```no_run
34+ #[ cfg_attr( windows, doc = "```no_run" ) ]
35+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
3536 /// use std::io;
3637 /// use std::fs::File;
3738 /// use std::os::windows::prelude::*;
@@ -59,7 +60,8 @@ pub trait FileExt {
5960 ///
6061 /// # Examples
6162 ///
62- /// ```no_run
63+ #[ cfg_attr( windows, doc = "```no_run" ) ]
64+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
6365 /// #![feature(core_io_borrowed_buf)]
6466 /// #![feature(read_buf_at)]
6567 ///
@@ -104,7 +106,8 @@ pub trait FileExt {
104106 ///
105107 /// # Examples
106108 ///
107- /// ```no_run
109+ #[ cfg_attr( windows, doc = "```no_run" ) ]
110+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
108111 /// use std::fs::File;
109112 /// use std::os::windows::prelude::*;
110113 ///
@@ -151,7 +154,8 @@ pub trait OpenOptionsExt {
151154 ///
152155 /// # Examples
153156 ///
154- /// ```no_run
157+ #[ cfg_attr( windows, doc = "```no_run" ) ]
158+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
155159 /// use std::fs::OpenOptions;
156160 /// use std::os::windows::prelude::*;
157161 ///
@@ -176,7 +180,8 @@ pub trait OpenOptionsExt {
176180 ///
177181 /// # Examples
178182 ///
179- /// ```no_run
183+ #[ cfg_attr( windows, doc = "```no_run" ) ]
184+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
180185 /// use std::fs::OpenOptions;
181186 /// use std::os::windows::prelude::*;
182187 ///
@@ -202,7 +207,8 @@ pub trait OpenOptionsExt {
202207 ///
203208 /// # Examples
204209 ///
205- /// ```no_run
210+ #[ cfg_attr( windows, doc = "```no_run" ) ]
211+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
206212 /// # #![allow(unexpected_cfgs)]
207213 /// # #[cfg(for_demonstration_only)]
208214 /// extern crate winapi;
@@ -240,7 +246,8 @@ pub trait OpenOptionsExt {
240246 ///
241247 /// # Examples
242248 ///
243- /// ```no_run
249+ #[ cfg_attr( windows, doc = "```no_run" ) ]
250+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
244251 /// # #![allow(unexpected_cfgs)]
245252 /// # #[cfg(for_demonstration_only)]
246253 /// extern crate winapi;
@@ -282,7 +289,8 @@ pub trait OpenOptionsExt {
282289
283290 /// # Examples
284291 ///
285- /// ```no_run
292+ #[ cfg_attr( windows, doc = "```no_run" ) ]
293+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
286294 /// # #![allow(unexpected_cfgs)]
287295 /// # #[cfg(for_demonstration_only)]
288296 /// extern crate winapi;
@@ -377,7 +385,8 @@ impl OpenOptionsExt2 for OpenOptions {
377385///
378386/// # Example
379387///
380- /// ```no_run
388+ #[ cfg_attr( windows, doc = "```no_run" ) ]
389+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
381390/// #![feature(windows_permissions_ext)]
382391/// use std::fs::Permissions;
383392/// use std::os::windows::fs::PermissionsExt;
@@ -440,7 +449,8 @@ pub trait MetadataExt {
440449 ///
441450 /// # Examples
442451 ///
443- /// ```no_run
452+ #[ cfg_attr( windows, doc = "```no_run" ) ]
453+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
444454 /// use std::io;
445455 /// use std::fs;
446456 /// use std::os::windows::prelude::*;
@@ -470,7 +480,8 @@ pub trait MetadataExt {
470480 ///
471481 /// # Examples
472482 ///
473- /// ```no_run
483+ #[ cfg_attr( windows, doc = "```no_run" ) ]
484+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
474485 /// use std::io;
475486 /// use std::fs;
476487 /// use std::os::windows::prelude::*;
@@ -505,7 +516,8 @@ pub trait MetadataExt {
505516 ///
506517 /// # Examples
507518 ///
508- /// ```no_run
519+ #[ cfg_attr( windows, doc = "```no_run" ) ]
520+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
509521 /// use std::io;
510522 /// use std::fs;
511523 /// use std::os::windows::prelude::*;
@@ -538,7 +550,8 @@ pub trait MetadataExt {
538550 ///
539551 /// # Examples
540552 ///
541- /// ```no_run
553+ #[ cfg_attr( windows, doc = "```no_run" ) ]
554+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
542555 /// use std::io;
543556 /// use std::fs;
544557 /// use std::os::windows::prelude::*;
@@ -561,7 +574,8 @@ pub trait MetadataExt {
561574 ///
562575 /// # Examples
563576 ///
564- /// ```no_run
577+ #[ cfg_attr( windows, doc = "```no_run" ) ]
578+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
565579 /// use std::io;
566580 /// use std::fs;
567581 /// use std::os::windows::prelude::*;
@@ -700,7 +714,8 @@ impl FileTimesExt for fs::FileTimes {
700714///
701715/// # Examples
702716///
703- /// ```no_run
717+ #[ cfg_attr( windows, doc = "```no_run" ) ]
718+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
704719/// use std::os::windows::fs;
705720///
706721/// fn main() -> std::io::Result<()> {
@@ -739,7 +754,8 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io:
739754///
740755/// # Examples
741756///
742- /// ```no_run
757+ #[ cfg_attr( windows, doc = "```no_run" ) ]
758+ #[ cfg_attr( not( windows) , doc = "```ignore (needs windows)" ) ]
743759/// use std::os::windows::fs;
744760///
745761/// fn main() -> std::io::Result<()> {
0 commit comments