Auto merge of #26846 - P1start:print-maybe-styled-macro, r=pnkfelix
Auto merge of #26846 - P1start:print-maybe-styled-macro, r=pnkfelix

`EmitterWriter::print_maybe_styled` was basically always used with `format!`, so this macro makes some code cleaner. It should also remove some unnecessary allocations (most `print_maybe_styled` invocations allocated a `String` previously, whereas the new macro uses `write_fmt` to write the formatted string directly to the terminal).

This probably could have been part of #26838, but it’s too late now. It’s also rebased on #26838’s branch because otherwise pretty much all of the changes in this PR would conflict with the other PR’s changes.

graydon/rust,aidancully/rust,vhbit/rust,dwillmer/rust,graydon/rust,jroesch/rust,zubron/rust,dwillmer/rust,GBGamer/rust,pshc/rust,pshc/rust,zubron/rust,jroesch/rust,pshc/rust,l0kod/rust,dwillmer/rust,vhbit/rust,GBGamer/rust,jashank/rust,jashank/rust,l0kod/rust,pshc/rust,zubron/rust,GBGamer/rust,zubron/rust,graydon/rust,l0kod/rust,jashank/rust,vhbit/rust,GBGamer/rust,aidancully/rust,jashank/rust,jroesch/rust,jroesch/rust,jroesch/rust,l0kod/rust,zubron/rust,graydon/rust,zubron/rust,jashank/rust,GBGamer/rust,vhbit/rust,aidancully/rust,l0kod/rust,pshc/rust,aidancully/rust,zubron/rust,graydon/rust,dwillmer/rust,pshc/rust,jashank/rust,pshc/rust,jroesch/rust,GBGamer/rust,aidancully/rust,dwillmer/rust,l0kod/rust,dwillmer/rust,aidancully/rust,GBGamer/rust,jashank/rust,vhbit/rust,l0kod/rust,l0kod/rust,jroesch/rust,dwillmer/rust,GBGamer/rust,vhbit/rust,zubron/rust,pshc/rust,dwillmer/rust,vhbit/rust,jashank/rust,vhbit/rust,graydon/rust,jroesch/rust