Skip to content

Commit 5a51d22

Browse files
committed
Update no_std_swap test
Add `#![crate_type="lib"]` annotation to test and remove `panic_handler`
1 parent bde1b9b commit 5a51d22

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![no_std]
22
#![feature(lang_items, start, libc)]
3+
#![crate_type = "lib"]
34

45
use core::panic::PanicInfo;
56

@@ -12,12 +13,3 @@ fn main() {
1213
a = b;
1314
b = a;
1415
}
15-
16-
#[allow(clippy::empty_loop)]
17-
#[panic_handler]
18-
fn panic(_info: &PanicInfo) -> ! {
19-
loop {}
20-
}
21-
22-
#[lang = "eh_personality"]
23-
extern "C" fn eh_personality() {}

tests/ui/crate_level_checks/no_std_swap.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this looks like you are trying to swap `a` and `b`
2-
--> $DIR/no_std_swap.rs:12:5
2+
--> $DIR/no_std_swap.rs:13:5
33
|
44
LL | / a = b;
55
LL | | b = a;

0 commit comments

Comments
 (0)