diff options
| author | Jubilee Young <workingjubilee@gmail.com> | 2024-09-21 08:48:28 -0700 |
|---|---|---|
| committer | Jubilee Young <workingjubilee@gmail.com> | 2024-09-21 08:59:52 -0700 |
| commit | 93993c77f55047cc1774fdfee4bcca9d43592c2a (patch) | |
| tree | 7db1b8df2f7eea04f4325249cae9ab24fd5a3690 /tests | |
| parent | f48c99a0041bb82a750b34cf2570e0e73d6d801c (diff) | |
| download | rust-93993c77f55047cc1774fdfee4bcca9d43592c2a.tar.gz rust-93993c77f55047cc1774fdfee4bcca9d43592c2a.zip | |
compiler: Accept "improper" ctypes in extern "rust-cold" fn
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/lint/rust-cold-fn-accept-improper-ctypes.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/lint/rust-cold-fn-accept-improper-ctypes.rs b/tests/ui/lint/rust-cold-fn-accept-improper-ctypes.rs new file mode 100644 index 00000000000..dc929e14527 --- /dev/null +++ b/tests/ui/lint/rust-cold-fn-accept-improper-ctypes.rs @@ -0,0 +1,14 @@ +//@ check-pass +#![feature(rust_cold_cc)] + +// extern "rust-cold" is a "Rust" ABI so we accept `repr(Rust)` types as arg/ret without warnings. + +pub extern "rust-cold" fn f(_: ()) -> Result<(), ()> { + Ok(()) +} + +extern "rust-cold" { + pub fn g(_: ()) -> Result<(), ()>; +} + +fn main() {} |
