str is a dynamically sized type (DST). Those can only be used behind some sort of indirection, like a reference in your case, or some other pointer type, like Box or Arc. You can make your Book struct a DST to by putting name as the last field of the struct.
Edit: after playing around with this and trying to construct a Book with a str as the last field using unsized coercion (currently the only way to construct a DST), I'm not exactly sure how to unsize something into a str. You can unsize an array into a slice, but I don't know what we can unsize into str.
Your answer got me interested in whether a str with non-valid utf-8 is UB or not and interestingly enough, miri did not complain. But beware of trying to print a non utf-8 str, it will kill your playground