Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion library/std/src/os/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
//!
//! # Examples
//!
//! ```no_run
#![cfg_attr(target_os = "wasi", doc = "```no_run")]
#![cfg_attr(not(target_os = "wasi"), doc = "```ignore (needs wasi)")]
//! use std::fs::File;
//! use std::os::wasi::prelude::*;
//!
Expand Down
6 changes: 4 additions & 2 deletions library/std/src/os/windows/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ pub impl(self) trait OsStringExt {
///
/// # Examples
///
/// ```
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::ffi::OsString;
/// use std::os::windows::prelude::*;
///
Expand Down Expand Up @@ -104,7 +105,8 @@ pub impl(self) trait OsStrExt {
///
/// # Examples
///
/// ```
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::ffi::OsString;
/// use std::os::windows::prelude::*;
///
Expand Down
48 changes: 32 additions & 16 deletions library/std/src/os/windows/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ pub trait FileExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::io;
/// use std::fs::File;
/// use std::os::windows::prelude::*;
Expand Down Expand Up @@ -59,7 +60,8 @@ pub trait FileExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(core_io_borrowed_buf)]
/// #![feature(read_buf_at)]
///
Expand Down Expand Up @@ -104,7 +106,8 @@ pub trait FileExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::fs::File;
/// use std::os::windows::prelude::*;
///
Expand Down Expand Up @@ -151,7 +154,8 @@ pub trait OpenOptionsExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::fs::OpenOptions;
/// use std::os::windows::prelude::*;
///
Expand All @@ -176,7 +180,8 @@ pub trait OpenOptionsExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::fs::OpenOptions;
/// use std::os::windows::prelude::*;
///
Expand All @@ -202,7 +207,8 @@ pub trait OpenOptionsExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// # #![allow(unexpected_cfgs)]
/// # #[cfg(for_demonstration_only)]
/// extern crate winapi;
Expand Down Expand Up @@ -240,7 +246,8 @@ pub trait OpenOptionsExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// # #![allow(unexpected_cfgs)]
/// # #[cfg(for_demonstration_only)]
/// extern crate winapi;
Expand Down Expand Up @@ -282,7 +289,8 @@ pub trait OpenOptionsExt {

/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// # #![allow(unexpected_cfgs)]
/// # #[cfg(for_demonstration_only)]
/// extern crate winapi;
Expand Down Expand Up @@ -377,7 +385,8 @@ impl OpenOptionsExt2 for OpenOptions {
///
/// # Example
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_permissions_ext)]
/// use std::fs::Permissions;
/// use std::os::windows::fs::PermissionsExt;
Expand Down Expand Up @@ -440,7 +449,8 @@ pub trait MetadataExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::io;
/// use std::fs;
/// use std::os::windows::prelude::*;
Expand Down Expand Up @@ -470,7 +480,8 @@ pub trait MetadataExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::io;
/// use std::fs;
/// use std::os::windows::prelude::*;
Expand Down Expand Up @@ -505,7 +516,8 @@ pub trait MetadataExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::io;
/// use std::fs;
/// use std::os::windows::prelude::*;
Expand Down Expand Up @@ -538,7 +550,8 @@ pub trait MetadataExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::io;
/// use std::fs;
/// use std::os::windows::prelude::*;
Expand All @@ -561,7 +574,8 @@ pub trait MetadataExt {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::io;
/// use std::fs;
/// use std::os::windows::prelude::*;
Expand Down Expand Up @@ -700,7 +714,8 @@ impl FileTimesExt for fs::FileTimes {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::os::windows::fs;
///
/// fn main() -> std::io::Result<()> {
Expand Down Expand Up @@ -739,7 +754,8 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io:
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::os::windows::fs;
///
/// fn main() -> std::io::Result<()> {
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/os/windows/io/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ pub trait AsHandle {
///
/// # Example
///
/// ```rust,no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// use std::fs::File;
/// # use std::io;
/// use std::os::windows::io::{AsHandle, BorrowedHandle};
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/os/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
//!
//! # Examples
//!
//! ```no_run
#![cfg_attr(windows, doc = "```no_run")]
#![cfg_attr(not(windows), doc = "```ignore (needs windows)")]
//! use std::fs::File;
//! use std::os::windows::prelude::*;
//!
Expand Down
12 changes: 8 additions & 4 deletions library/std/src/os/windows/net/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ impl SocketAddr {
///
/// With a pathname:
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
/// use std::path::Path;
Expand All @@ -104,7 +105,8 @@ impl SocketAddr {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::SocketAddr;
/// use std::path::Path;
Expand All @@ -118,7 +120,8 @@ impl SocketAddr {
///
/// Creating a `SocketAddr` with a NULL byte results in an error.
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::SocketAddr;
///
Expand Down Expand Up @@ -151,7 +154,8 @@ impl SocketAddr {
///
/// A named address:
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
Expand Down
30 changes: 20 additions & 10 deletions library/std/src/os/windows/net/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ use crate::{fmt, io};
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::thread;
/// use std::os::windows::net::{UnixStream, UnixListener};
Expand Down Expand Up @@ -61,7 +62,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
Expand All @@ -84,7 +86,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::{UnixListener};
///
Expand Down Expand Up @@ -122,7 +125,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
Expand All @@ -148,7 +152,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
Expand All @@ -170,7 +175,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
Expand All @@ -194,7 +200,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
Expand All @@ -212,7 +219,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
Expand All @@ -236,7 +244,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::thread;
/// use std::os::windows::net::{UnixStream, UnixListener};
Expand Down Expand Up @@ -272,7 +281,8 @@ impl UnixListener {
///
/// # Examples
///
/// ```no_run
#[cfg_attr(windows, doc = "```no_run")]
#[cfg_attr(not(windows), doc = "```ignore (needs windows)")]
/// #![feature(windows_unix_domain_sockets)]
/// use std::thread;
/// use std::os::windows::net::{UnixStream, UnixListener};
Expand Down
Loading
Loading