This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Description
Expected Behaviour
Codes that uses core::mem::swap
#![ cfg_attr(
target_arch = "spirv" ,
no_std,
feature( register_attr) ,
register_attr( spirv)
) ]
#[ cfg( not( target_arch = "spirv" ) ) ]
use spirv_std:: macros:: spirv;
use spirv_std as _;
#[ spirv( vertex) ]
pub fn test_vs ( ) {
let mut x1 = 0.0f32 ;
let mut x2 = 1.0f32 ;
core:: mem:: swap ( & mut x1, & mut x2) ;
}
will compile. it's OK in previous version at least b9867d0 .
Example & Steps To Reproduce
Clone https://github.com/hatoo/rust-gpu-issue/tree/swap-fail (note: swap-fail branch)
cargo build and error
> cargo build
Compiling builder v0.1.0 (C:\Users\hato2\Desktop\rust-gpu-issue\builder)
error: failed to run custom build command for `builder v0.1.0 (C:\Users\hato2\Desktop\rust-gpu-issue\builder)`
Caused by:
process didn't exit successfully: `C:\Users\hato2\Desktop\rust-gpu-issue\target\debug\build\builder-caf084bc583adeed\build-script-build` (exit code: 1)
--- stderr
Compiling shader v0.1.0 (C:\Users\hato2\Desktop\rust-gpu-issue\shader)
error: Cannot memcpy dynamically sized data
--> C:\Users\hato2\.rustup\toolchains\nightly-2021-10-26-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\intrinsics.rs:2057:14
|
2057 | unsafe { copy_nonoverlapping(src, dst, count) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: could not compile `shader` due to previous error
Error: BuildFailed
It's OK in the previous version. Please see https://github.com/hatoo/rust-gpu-issue/tree/swap-succ .
System Info
Rust: rustc 1.58.0-nightly (29b124802 2021-10-25)
OS: Windows 11
GPU: RTX2080ti
SPIR-V: SPIRV-Tools v2021.3 v2021.3
Backtrace
Backtrace
Reactions are currently unavailable
Expected Behaviour
Codes that uses
core::mem::swapwill compile. it's OK in previous version at least b9867d0.
Example & Steps To Reproduce
It's OK in the previous version. Please see https://github.com/hatoo/rust-gpu-issue/tree/swap-succ.
System Info
Backtrace
Backtrace