about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2022-10-01 19:53:14 -0400
committerAntoni Boucher <bouanto@zoho.com>2022-10-01 19:53:14 -0400
commita28618d2efbbc903c66689e12d47f6f341c6c0f8 (patch)
treeb5b7f385a31a82ea767d8bf1f3c764fe2cf8a6cb
parent6f1adbd9e33a6e9d6d79dfbee0f682a4ef2b4124 (diff)
downloadrust-a28618d2efbbc903c66689e12d47f6f341c6c0f8.tar.gz
rust-a28618d2efbbc903c66689e12d47f6f341c6c0f8.zip
Fix warnings
-rw-r--r--example/alloc_example.rs8
-rw-r--r--example/mini_core_hello_world.rs1
-rw-r--r--example/mod_bench.rs6
-rw-r--r--example/std_example.rs1
4 files changed, 6 insertions, 10 deletions
diff --git a/example/alloc_example.rs b/example/alloc_example.rs
index 74ea7ec4ede..c327b93f1bb 100644
--- a/example/alloc_example.rs
+++ b/example/alloc_example.rs
@@ -18,16 +18,12 @@ extern "C" {
 
 #[panic_handler]
 fn panic_handler(_: &core::panic::PanicInfo) -> ! {
-    unsafe {
-        core::intrinsics::abort();
-    }
+    core::intrinsics::abort();
 }
 
 #[alloc_error_handler]
 fn alloc_error_handler(_: alloc::alloc::Layout) -> ! {
-    unsafe {
-        core::intrinsics::abort();
-    }
+    core::intrinsics::abort();
 }
 
 #[start]
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index 14fd9eeffa6..7b10425e800 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -228,6 +228,7 @@ fn main() {
     } as Box<dyn SomeTrait>;
 
     const FUNC_REF: Option<fn()> = Some(main);
+    #[allow(unreachable_code)]
     match FUNC_REF {
         Some(_) => {},
         None => assert!(false),
diff --git a/example/mod_bench.rs b/example/mod_bench.rs
index 2e2b0052dee..95bcad2cd17 100644
--- a/example/mod_bench.rs
+++ b/example/mod_bench.rs
@@ -6,9 +6,7 @@ extern {}
 
 #[panic_handler]
 fn panic_handler(_: &core::panic::PanicInfo) -> ! {
-    unsafe {
-        core::intrinsics::abort();
-    }
+    core::intrinsics::abort();
 }
 
 #[lang="eh_personality"]
@@ -32,6 +30,6 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize {
 #[inline(never)]
 fn black_box(i: u32) {
     if i != 1 {
-        unsafe { core::intrinsics::abort(); }
+        core::intrinsics::abort();
     }
 }
diff --git a/example/std_example.rs b/example/std_example.rs
index 31069058aea..5c171c49fd1 100644
--- a/example/std_example.rs
+++ b/example/std_example.rs
@@ -1,5 +1,6 @@
 #![feature(core_intrinsics, generators, generator_trait, is_sorted)]
 
+#[cfg(feature="master")]
 use std::arch::x86_64::*;
 use std::io::Write;
 use std::ops::Generator;