@@ -147,7 +147,7 @@ pub trait RefRecoverSafe {}
147147/// // });
148148///
149149/// // This, however, will compile due to the `AssertRecoverSafe` wrapper
150- /// let result = panic::recover(AssertRecoverSafe::new (|| {
150+ /// let result = panic::recover(AssertRecoverSafe(|| {
151151/// variable += 3;
152152/// }));
153153/// // ...
@@ -171,15 +171,15 @@ pub trait RefRecoverSafe {}
171171/// let other_capture = 3;
172172///
173173/// let result = {
174- /// let mut wrapper = AssertRecoverSafe::new (&mut variable);
174+ /// let mut wrapper = AssertRecoverSafe(&mut variable);
175175/// panic::recover(move || {
176176/// **wrapper += other_capture;
177177/// })
178178/// };
179179/// // ...
180180/// ```
181181#[ unstable( feature = "recover" , reason = "awaiting feedback" , issue = "27719" ) ]
182- pub struct AssertRecoverSafe < T > ( T ) ;
182+ pub struct AssertRecoverSafe < T > ( pub T ) ;
183183
184184// Implementations of the `RecoverSafe` trait:
185185//
@@ -216,12 +216,14 @@ impl<T> RefRecoverSafe for AssertRecoverSafe<T> {}
216216impl < T > AssertRecoverSafe < T > {
217217 /// Creates a new `AssertRecoverSafe` wrapper around the provided type.
218218 #[ unstable( feature = "recover" , reason = "awaiting feedback" , issue = "27719" ) ]
219+ #[ rustc_deprecated( reason = "the type's field is now public, construct it directly" ) ]
219220 pub fn new ( t : T ) -> AssertRecoverSafe < T > {
220221 AssertRecoverSafe ( t)
221222 }
222223
223224 /// Consumes the `AssertRecoverSafe`, returning the wrapped value.
224225 #[ unstable( feature = "recover" , reason = "awaiting feedback" , issue = "27719" ) ]
226+ #[ rustc_deprecated( reason = "the type's field is now public, access it directly" ) ]
225227 pub fn into_inner ( self ) -> T {
226228 self . 0
227229 }
0 commit comments