Add RingBuf::as_slices as per collections reform v2.

See: https://github.com/rust-lang/rfcs/pull/509

Not sure if this is allowed to land before the RFC. Either way,
it's here for review.

r? @Gankro
cc: @bfops
auto merge of #19903 : cgaebel/rust/ringbuf-as-slice, r=Gankro

See: https://github.com/rust-lang/rfcs/pull/509

Not sure if this is allowed to land before the RFC. Either way,
it's here for review.

r? @Gankro
cc: @bfops
Fix error message on invalid field names for a struct variant

Fixes #19922.