Issue 5967 rvalue immutability

Simpler version of PR #5974 based on new borrowck.