From 4db09695849b3548c94519347ac15900407f17d5 Mon Sep 17 00:00:00 2001 From: Yong Wen Chua Date: Wed, 18 Jul 2018 13:07:31 +0800 Subject: [PATCH] Bump Rocket, Rust version and remove impl trait flag (#40) * Bump Rocket, Rust version and remove impl trait flag * Seems to build now * Ignore Rocket documentation errors * Update travis script * Increase nightly version by a day * Bump again --- .travis.yml | 29 ++++++++++++++++------------- Cargo.toml | 2 +- examples/manual.rs | 2 +- examples/mix.rs | 2 +- src/lib.rs | 16 +++++----------- tests/manual.rs | 2 +- tests/mix.rs | 2 +- 7 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index e3e9966..0d9eb08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,12 @@ sudo: false language: rust rust: -- nightly -# Minimum Rust set by Rocket -- nightly-2018-01-13 + - nightly + # Minimum Rust set by Rocket + - nightly-2018-07-16 +branches: + only: + - master cache: cargo env: global: @@ -19,15 +22,15 @@ addons: - libelf-dev - libdw-dev before_script: -- | - pip install 'travis-cargo<0.2' --user && - export PATH=$HOME/.local/bin:$PATH -# Remove rust-toolchain override for tests -- rm rust-toolchain + - | + pip install 'travis-cargo<0.2' --user && + export PATH=$HOME/.local/bin:$PATH + # Remove rust-toolchain override for tests + - rm rust-toolchain script: -- | - travis-cargo build -- "${CARGO_FLAGS}" && - travis-cargo test -- "${CARGO_FLAGS}" && - travis-cargo --only nightly doc -- --no-deps "${CARGO_FLAGS}" + - | + travis-cargo build -- "${CARGO_FLAGS}" && + travis-cargo test -- "${CARGO_FLAGS}" && + travis-cargo --only nightly doc -- --no-deps "${CARGO_FLAGS}" after_success: -- test $CARGO_FLAGS = "--all-features" && travis-cargo --only nightly doc-upload + - test $CARGO_FLAGS = "--all-features" && travis-cargo --only nightly doc-upload diff --git a/Cargo.toml b/Cargo.toml index 8b3e68d..822d5db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ serialization = ["serde", "serde_derive", "unicase_serde", "url_serde"] [dependencies] log = "0.3" -rocket = "0.3.6" +rocket = "0.3.14" unicase = "2.0" url = "1.5.1" diff --git a/examples/manual.rs b/examples/manual.rs index e61d52c..9bb628e 100644 --- a/examples/manual.rs +++ b/examples/manual.rs @@ -1,4 +1,4 @@ -#![feature(plugin, conservative_impl_trait)] +#![feature(plugin)] #![plugin(rocket_codegen)] extern crate rocket; extern crate rocket_cors; diff --git a/examples/mix.rs b/examples/mix.rs index a5da94d..6b53fcb 100644 --- a/examples/mix.rs +++ b/examples/mix.rs @@ -3,7 +3,7 @@ //! In this example, you typically have an application wide `Cors` struct except for one specific //! `ping` route that you want to allow all Origins to access. -#![feature(plugin, conservative_impl_trait)] +#![feature(plugin)] #![plugin(rocket_codegen)] extern crate rocket; extern crate rocket_cors; diff --git a/src/lib.rs b/src/lib.rs index 2dd05a2..d30e650 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -259,10 +259,6 @@ //! that has any side effects or with an appreciable computation cost inside this handler. //! //! ### Steps to perform: -//! - Your crate will need to enable the -//! [`conservative_impl_trait`](https://github.com/rust-lang/rfcs/blob/master/text/1522-conservative-impl-trait.md) -//! feature. You can use `#![feature(conservative_impl_trait)]` at your crate root. -//! Otherwise, the return type of your routes will be unspecifiable. //! - You will first need to have a `Cors` struct ready. This struct can be borrowed with a lifetime //! at least as long as `'r` which is the lifetime of a Rocket request. `'static` works too. //! In this case, you might as well use the `Guard` method above and place the `Cors` struct in @@ -299,7 +295,7 @@ //! (which you might have put in Rocket's state). //! //! ```rust,no_run -//! #![feature(plugin, conservative_impl_trait)] +//! #![feature(plugin)] //! #![plugin(rocket_codegen)] //! extern crate rocket; //! extern crate rocket_cors; @@ -356,7 +352,7 @@ //! special handling, you might want to use the Guard method instead which has less hassle. //! //! ```rust,no_run -//! #![feature(plugin, conservative_impl_trait)] +//! #![feature(plugin)] //! #![plugin(rocket_codegen)] //! extern crate rocket; //! extern crate rocket_cors; @@ -425,7 +421,7 @@ //! You can run the example code below with `cargo run --example mix`. //! //! ```rust,no_run -//! #![feature(plugin, conservative_impl_trait)] +//! #![feature(plugin)] //! #![plugin(rocket_codegen)] //! extern crate rocket; //! extern crate rocket_cors; @@ -505,8 +501,6 @@ //! - [Supplanted W3C CORS Specification](https://www.w3.org/TR/cors/) //! - [Resource Advice](https://w3c.github.io/webappsec-cors-for-developers/#resources) -#![allow(legacy_directory_ownership, missing_copy_implementations, missing_debug_implementations, - unknown_lints, unsafe_code)] #![deny(const_err, dead_code, deprecated, exceeding_bitshifts, improper_ctypes, missing_docs, mutable_transmutes, no_mangle_const_items, non_camel_case_types, non_shorthand_field_patterns, non_upper_case_globals, overflowing_literals, @@ -517,6 +511,8 @@ unused_imports, unused_import_braces, unused_qualifications, unused_must_use, unused_mut, unused_parens, unused_results, unused_unsafe, unused_variables, variant_size_differences, warnings, while_true)] +#![allow(legacy_directory_ownership, missing_copy_implementations, missing_debug_implementations, + unknown_lints, unsafe_code, intra_doc_link_resolution_failure)] #![cfg_attr(test, feature(plugin))] #![cfg_attr(test, plugin(rocket_codegen))] #![doc(test(attr(allow(unused_variables), deny(warnings))))] @@ -990,8 +986,6 @@ pub struct Cors { /// [Resource Processing Model](https://www.w3.org/TR/cors/#resource-processing-model). /// /// Defaults to `All`. - /// - /// ``` #[cfg_attr(feature = "serialization", serde(default))] pub allowed_origins: AllowedOrigins, /// The list of methods which the allowed origins are allowed to access for diff --git a/tests/manual.rs b/tests/manual.rs index 6d0b189..8c07081 100644 --- a/tests/manual.rs +++ b/tests/manual.rs @@ -1,6 +1,6 @@ //! This crate tests using `rocket_cors` using manual mode -#![feature(plugin, conservative_impl_trait)] +#![feature(plugin)] #![plugin(rocket_codegen)] extern crate hyper; extern crate rocket; diff --git a/tests/mix.rs b/tests/mix.rs index adde71b..81b6cae 100644 --- a/tests/mix.rs +++ b/tests/mix.rs @@ -3,7 +3,7 @@ //! In this example, you typically have an application wide `Cors` struct except for one specific //! `ping` route that you want to allow all Origins to access. -#![feature(plugin, conservative_impl_trait)] +#![feature(plugin)] #![plugin(rocket_codegen)] extern crate hyper; extern crate rocket;