Skip to content

Commit 9cbb7eb

Browse files
bors[bot]rtzoeller
andauthored
Merge #1806
1806: Remove MSRV-related workaround for doc aliases r=asomers a=rtzoeller Remove the MSRV-related workaround added by #1693, since we now can use doc aliases in all supported versions of Rust. Closes #1674. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2 parents 82fe82a + e479e8f commit 9cbb7eb

File tree

7 files changed

+21
-31
lines changed

7 files changed

+21
-31
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ pin-utils = { version = "0.1.0", optional = true }
3535
[target.'cfg(not(target_os = "redox"))'.dependencies]
3636
memoffset = { version = "0.6.3", optional = true }
3737

38-
[build-dependencies]
39-
autocfg = "1.1.0"
40-
4138
[features]
4239
default = [
4340
"acct", "aio", "dir", "env", "event", "feature", "fs",

build.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl Dir {
5555
}
5656

5757
/// Converts from a file descriptor, closing it on success or failure.
58-
#[cfg_attr(has_doc_alias, doc(alias("fdopendir")))]
58+
#[doc(alias("fdopendir"))]
5959
pub fn from_fd(fd: RawFd) -> Result<Self> {
6060
let d = ptr::NonNull::new(unsafe { libc::fdopendir(fd) }).ok_or_else(|| {
6161
let e = Error::last();

src/sys/signal.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ pub struct SigSet {
475475

476476
impl SigSet {
477477
/// Initialize to include all signals.
478-
#[cfg_attr(has_doc_alias, doc(alias("sigfillset")))]
478+
#[doc(alias("sigfillset"))]
479479
pub fn all() -> SigSet {
480480
let mut sigset = mem::MaybeUninit::uninit();
481481
let _ = unsafe { libc::sigfillset(sigset.as_mut_ptr()) };
@@ -484,7 +484,7 @@ impl SigSet {
484484
}
485485

486486
/// Initialize to include nothing.
487-
#[cfg_attr(has_doc_alias, doc(alias("sigemptyset")))]
487+
#[doc(alias("sigemptyset"))]
488488
pub fn empty() -> SigSet {
489489
let mut sigset = mem::MaybeUninit::uninit();
490490
let _ = unsafe { libc::sigemptyset(sigset.as_mut_ptr()) };
@@ -493,25 +493,25 @@ impl SigSet {
493493
}
494494

495495
/// Add the specified signal to the set.
496-
#[cfg_attr(has_doc_alias, doc(alias("sigaddset")))]
496+
#[doc(alias("sigaddset"))]
497497
pub fn add(&mut self, signal: Signal) {
498498
unsafe { libc::sigaddset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) };
499499
}
500500

501501
/// Remove all signals from this set.
502-
#[cfg_attr(has_doc_alias, doc(alias("sigemptyset")))]
502+
#[doc(alias("sigemptyset"))]
503503
pub fn clear(&mut self) {
504504
unsafe { libc::sigemptyset(&mut self.sigset as *mut libc::sigset_t) };
505505
}
506506

507507
/// Remove the specified signal from this set.
508-
#[cfg_attr(has_doc_alias, doc(alias("sigdelset")))]
508+
#[doc(alias("sigdelset"))]
509509
pub fn remove(&mut self, signal: Signal) {
510510
unsafe { libc::sigdelset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) };
511511
}
512512

513513
/// Return whether this set includes the specified signal.
514-
#[cfg_attr(has_doc_alias, doc(alias("sigismember")))]
514+
#[doc(alias("sigismember"))]
515515
pub fn contains(&self, signal: Signal) -> bool {
516516
let res = unsafe { libc::sigismember(&self.sigset as *const libc::sigset_t, signal as libc::c_int) };
517517

src/sys/timer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub struct Timer(libc::timer_t);
7070
impl Timer {
7171
/// Creates a new timer based on the clock defined by `clockid`. The details
7272
/// of the signal and its handler are defined by the passed `sigevent`.
73-
#[cfg_attr(has_doc_alias, doc(alias("timer_create")))]
73+
#[doc(alias("timer_create"))]
7474
pub fn new(clockid: ClockId, mut sigevent: SigEvent) -> Result<Self> {
7575
let mut timer_id: mem::MaybeUninit<libc::timer_t> = mem::MaybeUninit::uninit();
7676
Errno::result(unsafe {
@@ -123,7 +123,7 @@ impl Timer {
123123
///
124124
/// Note: Setting a one shot alarm with a 0s TimeSpec disable the alarm
125125
/// altogether.
126-
#[cfg_attr(has_doc_alias, doc(alias("timer_settime")))]
126+
#[doc(alias("timer_settime"))]
127127
pub fn set(&mut self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> {
128128
let timerspec: TimerSpec = expiration.into();
129129
Errno::result(unsafe {
@@ -138,7 +138,7 @@ impl Timer {
138138
}
139139

140140
/// Get the parameters for the alarm currently set, if any.
141-
#[cfg_attr(has_doc_alias, doc(alias("timer_gettime")))]
141+
#[doc(alias("timer_gettime"))]
142142
pub fn get(&self) -> Result<Option<Expiration>> {
143143
let mut timerspec = TimerSpec::none();
144144
Errno::result(unsafe { libc::timer_gettime(self.0, timerspec.as_mut()) }).map(|_| {
@@ -161,7 +161,7 @@ impl Timer {
161161
/// 'overrun'. This function returns how many times that has happened to
162162
/// this timer, up to `libc::DELAYTIMER_MAX`. If more than the maximum
163163
/// number of overruns have happened the return is capped to the maximum.
164-
#[cfg_attr(has_doc_alias, doc(alias("timer_getoverrun")))]
164+
#[doc(alias("timer_getoverrun"))]
165165
pub fn overruns(&self) -> i32 {
166166
unsafe { libc::timer_getoverrun(self.0) }
167167
}

src/sys/timerfd.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl TimerFd {
9292
/// Creates a new timer based on the clock defined by `clockid`. The
9393
/// underlying fd can be assigned specific flags with `flags` (CLOEXEC,
9494
/// NONBLOCK). The underlying fd will be closed on drop.
95-
#[cfg_attr(has_doc_alias, doc(alias("timerfd_create")))]
95+
#[doc(alias("timerfd_create"))]
9696
pub fn new(clockid: ClockId, flags: TimerFlags) -> Result<Self> {
9797
Errno::result(unsafe { libc::timerfd_create(clockid as i32, flags.bits()) })
9898
.map(|fd| Self { fd })
@@ -134,7 +134,7 @@ impl TimerFd {
134134
///
135135
/// Note: Setting a one shot alarm with a 0s TimeSpec disables the alarm
136136
/// altogether.
137-
#[cfg_attr(has_doc_alias, doc(alias("timerfd_settime")))]
137+
#[doc(alias("timerfd_settime"))]
138138
pub fn set(&self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> {
139139
let timerspec: TimerSpec = expiration.into();
140140
Errno::result(unsafe {
@@ -149,7 +149,7 @@ impl TimerFd {
149149
}
150150

151151
/// Get the parameters for the alarm currently set, if any.
152-
#[cfg_attr(has_doc_alias, doc(alias("timerfd_gettime")))]
152+
#[doc(alias("timerfd_gettime"))]
153153
pub fn get(&self) -> Result<Option<Expiration>> {
154154
let mut timerspec = TimerSpec::none();
155155
Errno::result(unsafe { libc::timerfd_gettime(self.fd, timerspec.as_mut()) }).map(|_| {
@@ -166,7 +166,7 @@ impl TimerFd {
166166
}
167167

168168
/// Remove the alarm if any is set.
169-
#[cfg_attr(has_doc_alias, doc(alias("timerfd_settime")))]
169+
#[doc(alias("timerfd_settime"))]
170170
pub fn unset(&self) -> Result<()> {
171171
Errno::result(unsafe {
172172
libc::timerfd_settime(

src/unistd.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ impl Uid {
7979
}
8080

8181
/// Returns Uid of calling process. This is practically a more Rusty alias for `getuid`.
82-
#[cfg_attr(has_doc_alias, doc(alias("getuid")))]
82+
#[doc(alias("getuid"))]
8383
pub fn current() -> Self {
8484
getuid()
8585
}
8686

8787
/// Returns effective Uid of calling process. This is practically a more Rusty alias for `geteuid`.
88-
#[cfg_attr(has_doc_alias, doc(alias("geteuid")))]
88+
#[doc(alias("geteuid"))]
8989
pub fn effective() -> Self {
9090
geteuid()
9191
}
@@ -136,13 +136,13 @@ impl Gid {
136136
}
137137

138138
/// Returns Gid of calling process. This is practically a more Rusty alias for `getgid`.
139-
#[cfg_attr(has_doc_alias, doc(alias("getgid")))]
139+
#[doc(alias("getgid"))]
140140
pub fn current() -> Self {
141141
getgid()
142142
}
143143

144144
/// Returns effective Gid of calling process. This is practically a more Rusty alias for `getegid`.
145-
#[cfg_attr(has_doc_alias, doc(alias("getegid")))]
145+
#[doc(alias("getegid"))]
146146
pub fn effective() -> Self {
147147
getegid()
148148
}
@@ -188,13 +188,13 @@ impl Pid {
188188
}
189189

190190
/// Returns PID of calling process
191-
#[cfg_attr(has_doc_alias, doc(alias("getpid")))]
191+
#[doc(alias("getpid"))]
192192
pub fn this() -> Self {
193193
getpid()
194194
}
195195

196196
/// Returns PID of parent of calling process
197-
#[cfg_attr(has_doc_alias, doc(alias("getppid")))]
197+
#[doc(alias("getppid"))]
198198
pub fn parent() -> Self {
199199
getppid()
200200
}

0 commit comments

Comments
 (0)