diff --git a/codegen/build.rs b/codegen/build.rs index 8b5c311b..cd097465 100644 --- a/codegen/build.rs +++ b/codegen/build.rs @@ -8,8 +8,8 @@ use yansi::Color::{Red, Yellow, Blue, White}; use version_check::{supports_features, is_min_version, is_min_date}; // Specifies the minimum nightly version needed to compile Rocket's codegen. -const MIN_DATE: &'static str = "2017-07-09"; -const MIN_VERSION: &'static str = "1.20.0-nightly"; +const MIN_DATE: &'static str = "2017-08-10"; +const MIN_VERSION: &'static str = "1.21.0-nightly"; fn main() { let ok_channel = supports_features(); diff --git a/codegen/src/lints/mod.rs b/codegen/src/lints/mod.rs index 802625e2..559b8aca 100644 --- a/codegen/src/lints/mod.rs +++ b/codegen/src/lints/mod.rs @@ -7,7 +7,7 @@ use ::{ROUTE_ATTR, ROUTE_INFO_ATTR}; use std::mem::transmute; use std::collections::HashMap; -use rustc::lint::{Level, LateContext, LintContext, LintPass, LateLintPass, LintArray}; +use rustc::lint::{Level, LateContext, LintPass, LateLintPass, LintArray}; use rustc::hir::{Item, Expr, Crate, Decl, FnDecl, Body, QPath, PatKind}; use rustc::hir::def_id::DefId; use rustc::ty::Ty; @@ -249,13 +249,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RocketLint { // Add this to the list of declared routes to check for mounting later // unless unmounted routes were explicitly allowed for this function. - if cx.current_level(UNMOUNTED_ROUTE) != Level::Allow { + if cx.tcx.lint_level_at_node(UNMOUNTED_ROUTE, fn_id).0 != Level::Allow { self.declared.push((fn_name, fn_sp, def_id.clone())); } // If unmanaged state was explicitly allowed for this function, don't // record any additional information. Just return now. - if cx.current_level(UNMANAGED_STATE) == Level::Allow { + if cx.tcx.lint_level_at_node(UNMANAGED_STATE, fn_id).0 == Level::Allow { return; } diff --git a/lib/src/rocket.rs b/lib/src/rocket.rs index 1fdf58c1..197182b4 100644 --- a/lib/src/rocket.rs +++ b/lib/src/rocket.rs @@ -138,7 +138,7 @@ impl Rocket { hyp_res.headers_mut().set(header::ContentLength(0)); hyp_res.start()?.end() } - Some(Body::Sized(mut body, size)) => { + Some(Body::Sized(body, size)) => { hyp_res.headers_mut().set(header::ContentLength(size)); let mut stream = hyp_res.start()?; io::copy(body, &mut stream)?;