We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
PassMode::Direct
1 parent 3b1ad48 commit 6a9ea3bCopy full SHA for 6a9ea3b
1 file changed
crates/rustc_codegen_spirv/src/abi.rs
@@ -69,6 +69,15 @@ pub(crate) fn provide(providers: &mut Providers) {
69
// <https://github.com/rust-lang/rust/commit/eaaa03faf77b157907894a4207d8378ecaec7b45>
70
arg.make_direct_deprecated();
71
72
+ // FIXME(eddyb) detect `#[rust_gpu::vector::v1]` more specifically,
73
+ // to avoid affecting anything should actually be passed as a pair.
74
+ if let PassMode::Pair(..) = arg.mode {
75
+ // HACK(eddyb) this avoids breaking e.g. `&[T]` pairs.
76
+ if let TyKind::Adt(..) = arg.layout.ty.kind() {
77
+ arg.mode = PassMode::Direct(ArgAttributes::new());
78
+ }
79
80
+
81
// Avoid pointlessly passing ZSTs, just like the official Rust ABI.
82
if arg.layout.is_zst() {
83
arg.mode = PassMode::Ignore;
0 commit comments