-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for impl UnwindSafe
/RefUnwindSafe
for Condvar
#121690
Comments
We don't use tracking issues for impls exactly because they are insta stable. Tracking issues are for tracking the state of merged unstable features. |
So how do I resolve this error:
In other words: how do I submit a PR that isn't broken if I don't have a tracking feature name for this impl block? Or do you disagree that this is the way it should be implemented? |
In case it wasn't clear how I was suggesting the change, it's simply to add the two impls side-by-side with the other synchronization primitives: index 3728d5b64b8..6b4105bd91d 100644
--- a/library/std/src/panic.rs
+++ b/library/std/src/panic.rs
@@ -6,7 +6,7 @@
use crate::collections;
use crate::panicking;
use crate::sync::atomic::{AtomicU8, Ordering};
-use crate::sync::{Mutex, RwLock};
+use crate::sync::{Condvar, Mutex, RwLock};
use crate::thread::Result;
#[doc(hidden)]
@@ -67,11 +67,15 @@ pub fn panic_any<M: 'static + Any + Send>(msg: M) -> ! {
impl<T: ?Sized> UnwindSafe for Mutex<T> {}
#[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T: ?Sized> UnwindSafe for RwLock<T> {}
+#[unstable(feature = "unwindsafe_condvar", issue = "118009")]
+impl UnwindSafe for Condvar {}
#[stable(feature = "unwind_safe_lock_refs", since = "1.12.0")]
impl<T: ?Sized> RefUnwindSafe for Mutex<T> {}
#[stable(feature = "unwind_safe_lock_refs", since = "1.12.0")]
impl<T: ?Sized> RefUnwindSafe for RwLock<T> {}
+#[unstable(feature = "unwindsafe_condvar", issue = "118009")]
+impl RefUnwindSafe for Condvar {}
// https://github.com/rust-lang/rust/issues/62301
#[stable(feature = "hashbrown", since = "1.36.0")] Without the
|
You cannot use |
I understand that. What details do I put in the |
Stable only requires a name and version (which I'd just copy from Mutex and RwLock) |
Last question: Wouldn't that cause the documentation to say that |
🤷 I don't think it really matters, I would call it a bug before and this is fixing the bug of it always being supposed to inpelem the traits |
Implement unwind safety for Condvar on all platforms Closes rust-lang#118009 This commit adds unwind safety consistency to Condvar. Previously, only select platforms implemented unwind safety through auto traits. Known by this committer: On Linux, `Condvar` implemented `UnwindSafe` but on Mac and Windows, it did not. This change changes the implementation from auto to explicit. In rust-lang#118009, it was suggested that the platform differences were a bug and that a simple PR could address this. In trying to determine the best information to put in the `#[stable]` attribute, it [was suggested](rust-lang#121690 (comment)) I copy the stability information from the previous unwind safety implementations.
Implement unwind safety for Condvar on all platforms Closes rust-lang#118009 This commit adds unwind safety consistency to Condvar. Previously, only select platforms implemented unwind safety through auto traits. Known by this committer: On Linux, `Condvar` implemented `UnwindSafe` but on Mac and Windows, it did not. This change changes the implementation from auto to explicit. In rust-lang#118009, it was suggested that the platform differences were a bug and that a simple PR could address this. In trying to determine the best information to put in the `#[stable]` attribute, it [was suggested](rust-lang#121690 (comment)) I copy the stability information from the previous unwind safety implementations.
Rollup merge of rust-lang#121768 - ecton:condvar-unwindsafe, r=m-ou-se Implement unwind safety for Condvar on all platforms Closes rust-lang#118009 This commit adds unwind safety consistency to Condvar. Previously, only select platforms implemented unwind safety through auto traits. Known by this committer: On Linux, `Condvar` implemented `UnwindSafe` but on Mac and Windows, it did not. This change changes the implementation from auto to explicit. In rust-lang#118009, it was suggested that the platform differences were a bug and that a simple PR could address this. In trying to determine the best information to put in the `#[stable]` attribute, it [was suggested](rust-lang#121690 (comment)) I copy the stability information from the previous unwind safety implementations.
The feature gate for the issue is
#![feature(unwindsafe_condvar)]
.This is a tracking issue for implementing
core::panic::UnwindSafe
andcore::panic::RefUnwindSafe
forstd::sync::Condvar
.Currently,
UnwindSafe
andRefUnwindSafe
are only implemented for some targets (See #118009). It was suggested a PR could be submitted to fix this inconsistency. However, in looking at howMutex
andRwLock
get their unwind safety, I decided the best course of action would be to add the impl right next to those similar implementations:rust/library/std/src/panic.rs
Lines 66 to 74 in 9afdb8d
By adding the implementation this way, my understanding is that the first step is submitting this tracking issue because impls are insta-stable.
Steps
Unresolved Questions
The text was updated successfully, but these errors were encountered: