From 41dd8e674144f208d36790a781011f9ea63e20f1 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Mon, 30 Sep 2019 16:57:16 +0200 Subject: Forbid unsafe code (#332) * Forbid unsafe code * Add badge advertising that unsafe code is forbidden * Revert "Add badge advertising that unsafe code is forbidden" This reverts commit e8d35d20d016a341d37969b975463588d3143528. * Comment on #![forbid(unsafe_code)] * Run rustfmt --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index fb04984..4a32d71 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -147,6 +147,11 @@ #![doc(html_root_url = "https://docs.rs/toml/0.5")] #![deny(missing_docs)] #![warn(rust_2018_idioms)] +// Makes rustc abort compilation if there are any unsafe blocks in the crate. +// Presence of this annotation is picked up by tools such as cargo-geiger +// and lets them ensure that there is indeed no unsafe code as opposed to +// something they couldn't detect (e.g. unsafe added via macro expansion, etc). +#![forbid(unsafe_code)] pub mod map; pub mod value; -- cgit v1.2.3