@@ -2,7 +2,7 @@ use core::cell::UnsafeCell;
22use core:: ffi:: c_void;
33use core:: fmt;
44use core:: marker:: PhantomData ;
5- #[ cfg( all( debug_assertions, not( feature = "unstable_autoreleasesafe " ) ) ) ]
5+ #[ cfg( all( debug_assertions, not( feature = "unstable-autoreleasesafe " ) ) ) ]
66use std:: { cell:: RefCell , thread_local, vec:: Vec } ;
77
88use 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 " ) ) ) ]
2929thread_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 " ) ) ]
163163macro_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 " ) ]
171171macro_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 " ) ) ]
202202unsafe impl < T : ?Sized > AutoreleaseSafe for T { }
203203
204- #[ cfg( feature = "unstable_autoreleasesafe " ) ]
204+ #[ cfg( feature = "unstable-autoreleasesafe " ) ]
205205impl !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 " ) ) ]
304304mod tests {
305305 use super :: AutoreleaseSafe ;
306306 use crate :: runtime:: Object ;
0 commit comments