]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/wasm-panic-small/foo.rs
Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup
[rust.git] / src / test / run-make / wasm-panic-small / foo.rs
1 #![crate_type = "cdylib"]
2
3 #[no_mangle]
4 #[cfg(a)]
5 pub fn foo() {
6     panic!("test");
7 }
8
9 #[no_mangle]
10 #[cfg(b)]
11 pub fn foo() {
12     panic!("{}", 1);
13 }
14
15 #[no_mangle]
16 #[cfg(c)]
17 pub fn foo() {
18     panic!("{}", "a");
19 }
20
21 #[no_mangle]
22 #[cfg(d)]
23 pub fn foo() -> usize {
24     use std::cell::Cell;
25     thread_local!(static A: Cell<Vec<u32>> = Cell::new(Vec::new()));
26     A.try_with(|x| x.take().len()).unwrap_or(0)
27 }