Unwind safety of `rc::Weak` and unwind safety in general

Is there anything special about Weak that doesn't let it to be UnwindSafe and RefUnwindSafe like Rc?

I know the whole unwind safety is more of a lint than a real contract, but I feel that its present form isn't really useful (as it doesn't seem to be consistent even in std).

As far as I know, Weak is only different from Rc because no one has bothered to manually declare the UnwindSafe/RefUnwindSafe impls.

I absolutely agree that unwind safety isn't useful - I'd recommend just applying AssertUnwindSafe whenever necessary and ignoring it as much as possible.

4 Likes

That's what I tought. I don't think fixing it via PR makes sense, I'd rather use this example as an argument for deprecating.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.