From 51d588e091eeb31d3634659b0f580062836b894e Mon Sep 17 00:00:00 2001 From: Sunli Date: Fri, 29 May 2020 17:33:19 +0800 Subject: [PATCH] Add #![forbid(unsafe_code)] to all sub crates --- README.md | 4 ++++ async-graphql-actix-web/src/lib.rs | 1 + async-graphql-derive/src/lib.rs | 1 + async-graphql-lambda/src/lib.rs | 4 ++++ async-graphql-parser/src/lib.rs | 2 ++ async-graphql-tide/src/lib.rs | 1 + async-graphql-warp/src/lib.rs | 1 + 7 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 5d8fb8e8..3c8bdb2d 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ * [Cargo package](https://crates.io/crates/async-graphql) * Minimum supported Rust version: 1.42 or later +## Safety + +This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% Safe Rust. + ## Stability: Unstable & Experimental __This project doesn't currently follow SemVer, and there can be breaking changes on any version numbers. We will begin following SemVer once the project reaches v2.0.0__ diff --git a/async-graphql-actix-web/src/lib.rs b/async-graphql-actix-web/src/lib.rs index f14a6382..cae16872 100644 --- a/async-graphql-actix-web/src/lib.rs +++ b/async-graphql-actix-web/src/lib.rs @@ -1,6 +1,7 @@ //! Async-graphql integration with Actix-web #![warn(missing_docs)] +#![forbid(unsafe_code)] mod subscription; diff --git a/async-graphql-derive/src/lib.rs b/async-graphql-derive/src/lib.rs index 0f171478..a6ee9961 100644 --- a/async-graphql-derive/src/lib.rs +++ b/async-graphql-derive/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::cognitive_complexity)] +#![forbid(unsafe_code)] extern crate proc_macro; diff --git a/async-graphql-lambda/src/lib.rs b/async-graphql-lambda/src/lib.rs index 96973d77..348df25a 100644 --- a/async-graphql-lambda/src/lib.rs +++ b/async-graphql-lambda/src/lib.rs @@ -1,3 +1,7 @@ +//! Async-graphql integration with AWS lambda +//! +#![forbid(unsafe_code)] + use async_graphql::{IntoQueryBuilder, IntoQueryBuilderOpts, ParseRequestError, QueryBuilder}; use futures::io::AllowStdIo; use lambda_http::Request; diff --git a/async-graphql-parser/src/lib.rs b/async-graphql-parser/src/lib.rs index d7727d26..bc7a76dd 100644 --- a/async-graphql-parser/src/lib.rs +++ b/async-graphql-parser/src/lib.rs @@ -1,3 +1,5 @@ +#![forbid(unsafe_code)] + #[macro_use] extern crate pest_derive; #[macro_use] diff --git a/async-graphql-tide/src/lib.rs b/async-graphql-tide/src/lib.rs index 582372e1..2e10af7e 100644 --- a/async-graphql-tide/src/lib.rs +++ b/async-graphql-tide/src/lib.rs @@ -3,6 +3,7 @@ #![warn(missing_docs)] #![allow(clippy::type_complexity)] #![allow(clippy::needless_doctest_main)] +#![forbid(unsafe_code)] use async_graphql::http::{multipart_stream, GQLRequest, GQLResponse, StreamBody}; use async_graphql::{ diff --git a/async-graphql-warp/src/lib.rs b/async-graphql-warp/src/lib.rs index 09593afd..ce57d7da 100644 --- a/async-graphql-warp/src/lib.rs +++ b/async-graphql-warp/src/lib.rs @@ -3,6 +3,7 @@ #![warn(missing_docs)] #![allow(clippy::type_complexity)] #![allow(clippy::needless_doctest_main)] +#![forbid(unsafe_code)] use async_graphql::http::StreamBody; use async_graphql::{