Skip to content

Commit

Permalink
Documentation and error message improvements related to PassMode::Dir…
Browse files Browse the repository at this point in the history
…ect assert

Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
  • Loading branch information
kjetilkjeka and workingjubilee committed Oct 26, 2023
1 parent 84c9c4a commit 1a17f0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
// shouldn't let any more targets do that.
// (Also see <https://github.com/rust-lang/rust/issues/115666>.)
//
// The unstable api `PtxKernel` also uses Direct for now.
// The unstable abi `PtxKernel` also uses Direct for now.
// It needs to switch to something else before stabilization can happen.
// (Tracking issue abi_ptx: https://github.com/rust-lang/rust/issues/38788)
assert!(
matches!(&*cx.tcx.sess.target.arch, "wasm32" | "wasm64")
|| self.conv == Conv::PtxKernel,
"`PassMode::Direct` for aggregates only allowed on wasm targets\nProblematic type: {:#?}",
"`PassMode::Direct` for aggregates only allowed on wasm and `extern "ptx-kernel"` fns\nProblematic type: {:#?}",
arg.layout,
);
}
Expand Down

0 comments on commit 1a17f0b

Please sign in to comment.