forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#130667 - workingjubilee:she-is-c-c-c-cold, …
…r=compiler-errors compiler: Accept "improper" ctypes in extern "rust-cold" fn
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |