Update lints for latest nightly, '2017-08-10'.

This commit is contained in:
Sergio Benitez 2017-08-11 09:14:54 -07:00
parent 9108e79fb9
commit 721f6204ea
3 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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;
}

View File

@ -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)?;