Skip to content

Commit b60c771

Browse files
authored
Unrolled build for rust-lang#130667
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
2 parents 1d68e6d + 93993c7 commit b60c771

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

compiler/rustc_lint/src/types.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,10 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
13201320
}
13211321

13221322
fn is_internal_abi(&self, abi: SpecAbi) -> bool {
1323-
matches!(abi, SpecAbi::Rust | SpecAbi::RustCall | SpecAbi::RustIntrinsic)
1323+
matches!(
1324+
abi,
1325+
SpecAbi::Rust | SpecAbi::RustCall | SpecAbi::RustCold | SpecAbi::RustIntrinsic
1326+
)
13241327
}
13251328

13261329
/// Find any fn-ptr types with external ABIs in `ty`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ check-pass
2+
#![feature(rust_cold_cc)]
3+
4+
// extern "rust-cold" is a "Rust" ABI so we accept `repr(Rust)` types as arg/ret without warnings.
5+
6+
pub extern "rust-cold" fn f(_: ()) -> Result<(), ()> {
7+
Ok(())
8+
}
9+
10+
extern "rust-cold" {
11+
pub fn g(_: ()) -> Result<(), ()>;
12+
}
13+
14+
fn main() {}

0 commit comments

Comments
 (0)