adapt to current HEAD of rustc by adding #[fixed_stack_segment] and removing unsafe where rustc complained