File: want-abort-got-unwind2.rs

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (23 lines) | stat: -rw-r--r-- 1,042 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// ignore-tidy-linelength
//@ build-fail
//@ dont-check-compiler-stderr
//@ aux-build:panic-runtime-unwind.rs
//@ aux-build:wants-panic-runtime-unwind.rs
//@ compile-flags:-C panic=abort

// Like `want-abort-got-unwind.rs`, this version checks that if the root binary wants abort panic
// runtime, that the compiler rejects a setup where a dependency crate in the dependency DAG
// transitively provides an unwind panic runtime (which also is built with `-Cpanic=unwind`, making
// that potentially-unwinding).

// NOTE: similar to `want-abort-got-unwind.rs`, there can be additional errors if the target default
// panic strategy is unwind, because then the precompiled `panic_unwind` would also be linked in,
// duplicating `panic_runtime_unwind` (transitively). But those additional errors are not important
// to test intention.
//@ dont-require-annotations: ERROR

extern crate wants_panic_runtime_unwind;

fn main() {}

//~? ERROR the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort`