Skip to content

Commit 36fd046

Browse files
committed
Rename unstable_autoreleasesafe feature to unstable-autoreleasesafe
1 parent 4b70749 commit 36fd046

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
RUSTDOCFLAGS: "-D warnings"
1616
CARGO_TERM_VERBOSE: true
1717
FEATURES: malloc,block,exception,catch_all,verify_message
18-
UNSTABLE_FEATURES: unstable_autoreleasesafe
18+
UNSTABLE_FEATURES: unstable-autoreleasesafe
1919
MACOSX_DEPLOYMENT_TARGET: 10.7
2020
IPHONEOS_DEPLOYMENT_TARGET: 7.0
2121
# We only support compiling Objective-C code with clang

objc2/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ verify_message = ["malloc"] # TODO: Remove malloc feature here
3838
malloc = ["malloc_buf"]
3939

4040
# Uses nightly features to make AutoreleasePool zero-cost even in debug mode
41-
unstable_autoreleasesafe = []
41+
unstable-autoreleasesafe = []
4242

4343
# Runtime selection. See `objc-sys` for details.
4444
apple = ["objc-sys/apple"]

objc2/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
123123
#![no_std]
124124
#![cfg_attr(
125-
feature = "unstable_autoreleasesafe",
125+
feature = "unstable-autoreleasesafe",
126126
feature(negative_impls, auto_traits)
127127
)]
128128
#![warn(elided_lifetimes_in_paths)]

objc2/src/rc/autorelease.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use core::cell::UnsafeCell;
22
use core::ffi::c_void;
33
use core::fmt;
44
use core::marker::PhantomData;
5-
#[cfg(all(debug_assertions, not(feature = "unstable_autoreleasesafe")))]
5+
#[cfg(all(debug_assertions, not(feature = "unstable-autoreleasesafe")))]
66
use std::{cell::RefCell, thread_local, vec::Vec};
77

88
use crate::ffi;
@@ -25,7 +25,7 @@ pub struct AutoreleasePool {
2525
p: PhantomData<*mut UnsafeCell<c_void>>,
2626
}
2727

28-
#[cfg(all(debug_assertions, not(feature = "unstable_autoreleasesafe")))]
28+
#[cfg(all(debug_assertions, not(feature = "unstable-autoreleasesafe")))]
2929
thread_local! {
3030
/// We track the thread's pools to verify that object lifetimes are only
3131
/// taken from the innermost pool.
@@ -49,7 +49,7 @@ impl AutoreleasePool {
4949
unsafe fn new() -> Self {
5050
// TODO: Make this function pub when we're more certain of the API
5151
let context = unsafe { ffi::objc_autoreleasePoolPush() };
52-
#[cfg(all(debug_assertions, not(feature = "unstable_autoreleasesafe")))]
52+
#[cfg(all(debug_assertions, not(feature = "unstable-autoreleasesafe")))]
5353
POOLS.with(|c| c.borrow_mut().push(context));
5454
Self {
5555
context,
@@ -61,7 +61,7 @@ impl AutoreleasePool {
6161
#[inline]
6262
#[doc(hidden)]
6363
pub fn __verify_is_inner(&self) {
64-
#[cfg(all(debug_assertions, not(feature = "unstable_autoreleasesafe")))]
64+
#[cfg(all(debug_assertions, not(feature = "unstable-autoreleasesafe")))]
6565
POOLS.with(|c| {
6666
assert_eq!(
6767
c.borrow().last(),
@@ -140,7 +140,7 @@ impl Drop for AutoreleasePool {
140140
#[inline]
141141
fn drop(&mut self) {
142142
unsafe { ffi::objc_autoreleasePoolPop(self.context) }
143-
#[cfg(all(debug_assertions, not(feature = "unstable_autoreleasesafe")))]
143+
#[cfg(all(debug_assertions, not(feature = "unstable-autoreleasesafe")))]
144144
POOLS.with(|c| {
145145
assert_eq!(
146146
c.borrow_mut().pop(),
@@ -159,15 +159,15 @@ impl fmt::Pointer for AutoreleasePool {
159159

160160
/// We use a macro here so that the documentation is included whether the
161161
/// feature is enabled or not.
162-
#[cfg(not(feature = "unstable_autoreleasesafe"))]
162+
#[cfg(not(feature = "unstable-autoreleasesafe"))]
163163
macro_rules! auto_trait {
164164
{$(#[$fn_meta:meta])* $v:vis unsafe trait AutoreleaseSafe {}} => {
165165
$(#[$fn_meta])*
166166
$v unsafe trait AutoreleaseSafe {}
167167
}
168168
}
169169

170-
#[cfg(feature = "unstable_autoreleasesafe")]
170+
#[cfg(feature = "unstable-autoreleasesafe")]
171171
macro_rules! auto_trait {
172172
{$(#[$fn_meta:meta])* $v:vis unsafe trait AutoreleaseSafe {}} => {
173173
$(#[$fn_meta])*
@@ -179,7 +179,7 @@ auto_trait! {
179179
/// Marks types that are safe to pass across the closure in an
180180
/// [`autoreleasepool`].
181181
///
182-
/// With the `unstable_autoreleasesafe` feature enabled, this is an auto
182+
/// With the `unstable-autoreleasesafe` feature enabled, this is an auto
183183
/// trait that is implemented for all types except [`AutoreleasePool`].
184184
///
185185
/// Otherwise it is just a dummy trait that is implemented for all types;
@@ -194,14 +194,14 @@ auto_trait! {
194194
/// likewise, this should be negatively implemented for that.
195195
///
196196
/// This can easily be accomplished with an `PhantomData<AutoreleasePool>`
197-
/// if the `unstable_autoreleasesafe` feature is enabled.
197+
/// if the `unstable-autoreleasesafe` feature is enabled.
198198
pub unsafe trait AutoreleaseSafe {}
199199
}
200200

201-
#[cfg(not(feature = "unstable_autoreleasesafe"))]
201+
#[cfg(not(feature = "unstable-autoreleasesafe"))]
202202
unsafe impl<T: ?Sized> AutoreleaseSafe for T {}
203203

204-
#[cfg(feature = "unstable_autoreleasesafe")]
204+
#[cfg(feature = "unstable-autoreleasesafe")]
205205
impl !AutoreleaseSafe for AutoreleasePool {}
206206

207207
/// Execute `f` in the context of a new autorelease pool. The pool is
@@ -216,7 +216,7 @@ impl !AutoreleaseSafe for AutoreleasePool {}
216216
/// The given reference must not be used in an inner `autoreleasepool`,
217217
/// doing so will panic with debug assertions enabled, and be a compile
218218
/// error in a future release. You can test the compile error with the
219-
/// `unstable_autoreleasesafe` crate feature on nightly Rust.
219+
/// `unstable-autoreleasesafe` crate feature on nightly Rust.
220220
///
221221
/// # Examples
222222
///
@@ -266,8 +266,8 @@ impl !AutoreleaseSafe for AutoreleasePool {}
266266
/// Incorrect usage which panics (with debug assertions enabled) because we
267267
/// tried to pass an outer pool to an inner pool:
268268
///
269-
#[cfg_attr(feature = "unstable_autoreleasesafe", doc = "```compile_fail")]
270-
#[cfg_attr(not(feature = "unstable_autoreleasesafe"), doc = "```should_panic")]
269+
#[cfg_attr(feature = "unstable-autoreleasesafe", doc = "```compile_fail")]
270+
#[cfg_attr(not(feature = "unstable-autoreleasesafe"), doc = "```should_panic")]
271271
/// # use objc2::{class, msg_send};
272272
/// # use objc2::rc::{autoreleasepool, AutoreleasePool};
273273
/// # use objc2::runtime::Object;
@@ -300,7 +300,7 @@ where
300300
f(&pool)
301301
}
302302

303-
#[cfg(all(test, feature = "unstable_autoreleasesafe"))]
303+
#[cfg(all(test, feature = "unstable-autoreleasesafe"))]
304304
mod tests {
305305
use super::AutoreleaseSafe;
306306
use crate::runtime::Object;

0 commit comments

Comments
 (0)