You can technically get this behavior today using /dev/ram0 as a swap device, but it's very awkward and almost certainly a bad idea.