I just learned about this: https://github.com/rust-lang/rust/pull/64010/
Would this resolve our previous concern about stabilizing the
unwind(abort) attribute, namely, that it couldn't be used on function pointers? (As long as we add
unwind to the list of attributes that can be used in parameter position, of course.)
As far as I can see, attributes are still not useable on local variables.
IIRC the concern is that as implemented the attribute is not part of a function's type.
We can revisit that debate but
I think that the ABI version is kind of "just better" in most ways
I think there is consensus that it should be part of the type, whether the syntax is an ABI string or an attribute is more a syntactic issue, there are certainly other cases where attributes as part of the type make sense (e.g.
#[target_feature] is part of the function ABI, and we currently forbid creating pointers to target feature functions to work around that).
@Kyle Strand those attributes only work on formal params; not types. You'd need https://github.com/rust-lang/rfcs/pull/2602 for attributes on types.
Also, I agree with @nikomatsakis -- I'd also like to see the WG more focused and for it to have less back and forth
I think that the merit in the "noexcept-like feature" is in the idea that we may not want the unwindability of a function to be in the type system, at least not without introducing a real
noexcept feature that can be used independently of
Also, I agree with nikomatsakis -- I'd also like to see the WG more focused and for it to have less back and forth
I'm not sure how to help with that at this point. It seems to me that we do have some genuinely new information being introduced (e.g. from discussion w/ Amanieu).
:frown: -- I was hoping to get the soundness hole closed in a reasonable timeframe
So was I. But I am of the opinion that letting
extern "C" unwind is a perfectly reasonable way to do that.
I've also said that I personally don't have an objection to stabilizing the abort-on-unwind shim.
@Kyle Strand appreciated
@gnzlbg See the PR link up above; such attributes can at least be applied to fn pointers in function params, which may be sufficient for now
It isn't sufficient for statics I think.
static X: Option<#[unwind(aborts)] fn f()> = ...; would need to work
but I don't see any reasons why we can't make that work