Auto merge of #25015 - alexcrichton:rwlock-check-ret, r=aturon
Auto merge of #25015 - alexcrichton:rwlock-check-ret, r=aturon

Apparently implementations are allowed to return EDEADLK instead of blocking
forever, in which case this can lead to unsafety in the `RwLock` primitive
exposed by the standard library. A debug-build of the standard library would
have caught this error (due to the debug assert), but we don't ship debug
builds right now.

This commit adds explicit checks for the EDEADLK error code and triggers a panic
to ensure the call does not succeed.

Closes #25012

andars/rust,zubron/rust,ejjeong/rust,sae-bom/rust,ejjeong/rust,graydon/rust,cllns/rust,KokaKiwi/rust,zubron/rust,sae-bom/rust,TheNeikos/rust,l0kod/rust,l0kod/rust,mdinger/rust,XMPPwocky/rust,cllns/rust,sae-bom/rust,carols10cents/rust,jroesch/rust,KokaKiwi/rust,aepsil0n/rust,KokaKiwi/rust,zachwick/rust,carols10cents/rust,jroesch/rust,mihneadb/rust,krzysz00/rust,victorvde/rust,seanrivera/rust,aidancully/rust,vhbit/rust,seanrivera/rust,l0kod/rust,zachwick/rust,reem/rust,jroesch/rust,sae-bom/rust,rohitjoshi/rust,l0kod/rust,pelmers/rust,kwantam/rust,mvdnes/rust,sae-bom/rust,philyoon/rust,rohitjoshi/rust,TheNeikos/rust,gifnksm/rust,nwin/rust,dwillmer/rust,mvdnes/rust,graydon/rust,ejjeong/rust,aneeshusa/rust,robertg/rust,nwin/rust,dwillmer/rust,l0kod/rust,XMPPwocky/rust,gifnksm/rust,zubron/rust,jroesch/rust,aneeshusa/rust,ejjeong/rust,aepsil0n/rust,vhbit/rust,omasanori/rust,GBGamer/rust,zubron/rust,pshc/rust,aepsil0n/rust,pelmers/rust,jashank/rust,victorvde/rust,nwin/rust,andars/rust,seanrivera/rust,reem/rust,nwin/rust,jroesch/rust,ejjeong/rust,kwantam/rust,zubron/rust,graydon/rust,seanrivera/rust,reem/rust,dwillmer/rust,jashank/rust,mvdnes/rust,robertg/rust,pshc/rust,kwantam/rust,nwin/rust,pelmers/rust,l0kod/rust,pshc/rust,jashank/rust,robertg/rust,krzysz00/rust,pshc/rust,reem/rust,graydon/rust,TheNeikos/rust,zubron/rust,rohitjoshi/rust,nwin/rust,aepsil0n/rust,aneeshusa/rust,vhbit/rust,pshc/rust,reem/rust,nwin/rust,omasanori/rust,XMPPwocky/rust,dwillmer/rust,andars/rust,zubron/rust,graydon/rust,dwillmer/rust,kwantam/rust,omasanori/rust,dwillmer/rust,rohitjoshi/rust,sae-bom/rust,rohitjoshi/rust,GBGamer/rust,gifnksm/rust,vhbit/rust,jroesch/rust,seanrivera/rust,robertg/rust,XMPPwocky/rust,robertg/rust,jroesch/rust,pshc/rust,mdinger/rust,mihneadb/rust,pshc/rust,mdinger/rust,krzysz00/rust,victorvde/rust,nwin/rust,zachwick/rust,aepsil0n/rust,victorvde/rust,XMPPwocky/rust,GBGamer/rust,philyoon/rust,seanrivera/rust,GBGamer/rust,andars/rust,omasanori/rust,mvdnes/rust,KokaKiwi/rust,TheNeikos/rust,aidancully/rust,carols10cents/rust,aneeshusa/rust,victorvde/rust,carols10cents/rust,zubron/rust,kwantam/rust,andars/rust,KokaKiwi/rust,zachwick/rust,krzysz00/rust,carols10cents/rust,robertg/rust,omasanori/rust,pelmers/rust,vhbit/rust,jashank/rust,mvdnes/rust,mihneadb/rust,vhbit/rust,philyoon/rust,l0kod/rust,andars/rust,KokaKiwi/rust,GBGamer/rust,cllns/rust,gifnksm/rust,omasanori/rust,reem/rust,aepsil0n/rust,jashank/rust,jashank/rust,cllns/rust,gifnksm/rust,pelmers/rust,mihneadb/rust,rohitjoshi/rust,cllns/rust,mdinger/rust,kwantam/rust,jroesch/rust,TheNeikos/rust,graydon/rust,aneeshusa/rust,cllns/rust,philyoon/rust,aidancully/rust,krzysz00/rust,aneeshusa/rust,GBGamer/rust,gifnksm/rust,mihneadb/rust,dwillmer/rust,zachwick/rust,GBGamer/rust,philyoon/rust,l0kod/rust,victorvde/rust,philyoon/rust,mdinger/rust,zachwick/rust,pshc/rust,TheNeikos/rust,XMPPwocky/rust,carols10cents/rust,mdinger/rust,vhbit/rust,krzysz00/rust,ejjeong/rust,mvdnes/rust,jashank/rust,pelmers/rust,aidancully/rust,vhbit/rust,dwillmer/rust,aidancully/rust,aidancully/rust,jashank/rust,GBGamer/rust,mihneadb/rust