Tweak mem categorization of upvar mutability
Tweak mem categorization of upvar mutability

- Correctly categorize env pointer deref for `FnMut` as declared
  rather than inherited.  This fixes an assert in borrowck.
  Closes #18238
- Categorize env pointer deref as mutable only if the closure is
  `FnMut` *and* the original variable is declared mutable.  This
  disallows capture-by-value `FnMut` closures from mutating captured
  variables that aren't declared mutable.  This is a difference
  from the equivalent desugared code which would permit it, but
  it is consistent with the behavior of procs.  Closes #18335
- Avoid computing info about the env pointer if there isn't one.

omasanori/rust,ktossell/rust,nwin/rust,carols10cents/rust,TheNeikos/rust,aidancully/rust,KokaKiwi/rust,rprichard/rust,mdinger/rust,carols10cents/rust,krzysz00/rust,XMPPwocky/rust,jashank/rust,cllns/rust,miniupnp/rust,cllns/rust,gifnksm/rust,untitaker/rust,jashank/rust,jroesch/rust,richo/rust,mvdnes/rust,dwillmer/rust,miniupnp/rust,reem/rust,kwantam/rust,dinfuehr/rust,pshc/rust,cllns/rust,jashank/rust,avdi/rust,victorvde/rust,kwantam/rust,avdi/rust,reem/rust,ruud-v-a/rust,jroesch/rust,sae-bom/rust,jashank/rust,kimroen/rust,philyoon/rust,sae-bom/rust,victorvde/rust,jroesch/rust,ebfull/rust,krzysz00/rust,aepsil0n/rust,philyoon/rust,mdinger/rust,mdinger/rust,aneeshusa/rust,robertg/rust,aepsil0n/rust,cllns/rust,0x73/rust,ktossell/rust,defuz/rust,aneeshusa/rust,omasanori/rust,gifnksm/rust,dwillmer/rust,aidancully/rust,jroesch/rust,dwillmer/rust,emk/rust,XMPPwocky/rust,jashank/rust,jroesch/rust,untitaker/rust,AerialX/rust-rt-minimal,ruud-v-a/rust,avdi/rust,dwillmer/rust,avdi/rust,graydon/rust,kwantam/rust,ktossell/rust,TheNeikos/rust,rprichard/rust,miniupnp/rust,ejjeong/rust,jroesch/rust,kimroen/rust,bombless/rust,victorvde/rust,jroesch/rust,carols10cents/rust,rohitjoshi/rust,seanrivera/rust,untitaker/rust,dinfuehr/rust,barosl/rust,miniupnp/rust,KokaKiwi/rust,rprichard/rust,vhbit/rust,sae-bom/rust,mdinger/rust,vhbit/rust,GBGamer/rust,dinfuehr/rust,graydon/rust,emk/rust,ebfull/rust,mdinger/rust,pelmers/rust,mihneadb/rust,nwin/rust,philyoon/rust,zachwick/rust,pshc/rust,pshc/rust,ktossell/rust,dinfuehr/rust,rprichard/rust,barosl/rust,sae-bom/rust,vhbit/rust,ebfull/rust,vhbit/rust,mahkoh/rust,XMPPwocky/rust,zaeleus/rust,KokaKiwi/rust,krzysz00/rust,defuz/rust,zachwick/rust,kimroen/rust,jroesch/rust,pshc/rust,aidancully/rust,jashank/rust,AerialX/rust,graydon/rust,untitaker/rust,l0kod/rust,miniupnp/rust,AerialX/rust-rt-minimal,reem/rust,GBGamer/rust,l0kod/rust,zachwick/rust,cllns/rust,TheNeikos/rust,gifnksm/rust,mihneadb/rust,aidancully/rust,dinfuehr/rust,omasanori/rust,hauleth/rust,krzysz00/rust,mvdnes/rust,ejjeong/rust,pelmers/rust,richo/rust,philyoon/rust,mvdnes/rust,andars/rust,GBGamer/rust,AerialX/rust-rt-minimal,aneeshusa/rust,pelmers/rust,0x73/rust,cllns/rust,hauleth/rust,pelmers/rust,gifnksm/rust,dwillmer/rust,aneeshusa/rust,robertg/rust,carols10cents/rust,pshc/rust,avdi/rust,reem/rust,vhbit/rust,bombless/rust,zubron/rust,zachwick/rust,dwillmer/rust,ejjeong/rust,l0kod/rust,krzysz00/rust,mihneadb/rust,seanrivera/rust,omasanori/rust,seanrivera/rust,carols10cents/rust,ktossell/rust,krzysz00/rust,quornian/rust,andars/rust,dwillmer/rust,l0kod/rust,pelmers/rust,hauleth/rust,TheNeikos/rust,philyoon/rust,TheNeikos/rust,mihneadb/rust,AerialX/rust,mahkoh/rust,mihneadb/rust,kimroen/rust,0x73/rust,0x73/rust,defuz/rust,ktossell/rust,rprichard/rust,robertg/rust,emk/rust,nwin/rust,XMPPwocky/rust,rohitjoshi/rust,AerialX/rust,barosl/rust,aneeshusa/rust,kwantam/rust,kimroen/rust,zaeleus/rust,0x73/rust,graydon/rust,miniupnp/rust,hauleth/rust,ejjeong/rust,mihneadb/rust,jashank/rust,defuz/rust,kimroen/rust,seanrivera/rust,zaeleus/rust,GBGamer/rust,zaeleus/rust,AerialX/rust,richo/rust,emk/rust,reem/rust,zubron/rust,graydon/rust,nwin/rust,avdi/rust,victorvde/rust,aepsil0n/rust,l0kod/rust,AerialX/rust,l0kod/rust,quornian/rust,nwin/rust,ruud-v-a/rust,bombless/rust-docs-chinese,untitaker/rust,emk/rust,ruud-v-a/rust,robertg/rust,vhbit/rust,aepsil0n/rust,carols10cents/rust,GBGamer/rust,emk/rust,ebfull/rust,jashank/rust,reem/rust,kimroen/rust,quornian/rust,gifnksm/rust,seanrivera/rust,barosl/rust,omasanori/rust,AerialX/rust-rt-minimal,AerialX/rust-rt-minimal,aneeshusa/rust,pshc/rust,miniupnp/rust,aidancully/rust,vhbit/rust,GBGamer/rust,bombless/rust,nwin/rust,victorvde/rust,mahkoh/rust,KokaKiwi/rust,zubron/rust,mdinger/rust,kwantam/rust,graydon/rust,zubron/rust,rohitjoshi/rust,ktossell/rust,ejjeong/rust,nwin/rust,quornian/rust,barosl/rust,quornian/rust,pelmers/rust,miniupnp/rust,l0kod/rust,ebfull/rust,aepsil0n/rust,pshc/rust,GBGamer/rust,rprichard/rust,hauleth/rust,aidancully/rust,zubron/rust,zubron/rust,XMPPwocky/rust,robertg/rust,sae-bom/rust,quornian/rust,AerialX/rust-rt-minimal,mahkoh/rust,zachwick/rust,barosl/rust,bombless/rust,rohitjoshi/rust,mahkoh/rust,gifnksm/rust,zubron/rust,rohitjoshi/rust,andars/rust,andars/rust,bombless/rust,rohitjoshi/rust,ruud-v-a/rust,GBGamer/rust,KokaKiwi/rust,KokaKiwi/rust,defuz/rust,kwantam/rust,emk/rust,0x73/rust,richo/rust,zubron/rust,ejjeong/rust,TheNeikos/rust,l0kod/rust,dwillmer/rust,vhbit/rust,robertg/rust,victorvde/rust,XMPPwocky/rust,andars/rust,seanrivera/rust,AerialX/rust,philyoon/rust,mvdnes/rust,richo/rust,sae-bom/rust,defuz/rust,zaeleus/rust,zachwick/rust,ebfull/rust,0x73/rust,andars/rust,nwin/rust,ruud-v-a/rust,hauleth/rust,untitaker/rust,dinfuehr/rust,pshc/rust,mahkoh/rust,mvdnes/rust,zaeleus/rust,quornian/rust,aepsil0n/rust,omasanori/rust,mvdnes/rust,barosl/rust,bombless/rust,richo/rust