-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #123230 - matthiaskrgr:rollup-4twuzj4, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #121573 (unix_sigpipe: Add test for SIGPIPE disposition in child processes) - #123170 (Replace regions in const canonical vars' types with `'static` in next-solver canonicalizer) - #123200 (KCFI: Require -C panic=abort) - #123201 (Improve wording in std::any explanation) - #123224 (compiletest: print reason for failing to read tests) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
20 changed files
with
234 additions
and
79 deletions.
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
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
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
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
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
34 changes: 34 additions & 0 deletions
34
tests/ui/attributes/unix_sigpipe/auxiliary/assert-sigpipe-disposition.rs
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,34 @@ | ||
// It is UB to unwind out of `fn start()` according to | ||
// https://doc.rust-lang.org/beta/unstable-book/language-features/start.html so | ||
// panic with abort to avoid UB: | ||
//@ compile-flags: -Cpanic=abort | ||
//@ no-prefer-dynamic so panic=abort works | ||
|
||
#![feature(start, rustc_private)] | ||
|
||
extern crate libc; | ||
|
||
// Use #[start] so we don't have a runtime that messes with SIGPIPE. | ||
#[start] | ||
fn start(argc: isize, argv: *const *const u8) -> isize { | ||
assert_eq!(argc, 2, "Must pass SIG_IGN or SIG_DFL as first arg"); | ||
let arg1 = unsafe { std::ffi::CStr::from_ptr(*argv.offset(1) as *const libc::c_char) } | ||
.to_str() | ||
.unwrap(); | ||
|
||
let expected = match arg1 { | ||
"SIG_IGN" => libc::SIG_IGN, | ||
"SIG_DFL" => libc::SIG_DFL, | ||
arg => panic!("Must pass SIG_IGN or SIG_DFL as first arg. Got: {}", arg), | ||
}; | ||
|
||
let actual = unsafe { | ||
let mut actual: libc::sigaction = std::mem::zeroed(); | ||
libc::sigaction(libc::SIGPIPE, std::ptr::null(), &mut actual); | ||
actual.sa_sigaction | ||
}; | ||
|
||
assert_eq!(actual, expected, "actual and expected SIGPIPE disposition in child differs"); | ||
|
||
0 | ||
} |
Oops, something went wrong.