Update codegen lints for latest nightly.

This commit is contained in:
Sergio Benitez 2017-06-01 21:59:40 -07:00
parent f1ec552ac5
commit 614297eb9b
2 changed files with 6 additions and 13 deletions

View File

@ -8,7 +8,7 @@ use ansi_term::Color::{Red, Yellow, Blue, White};
use version_check::{is_nightly, is_min_version, is_min_date};
// Specifies the minimum nightly version needed to compile Rocket's codegen.
const MIN_DATE: &'static str = "2017-05-26";
const MIN_DATE: &'static str = "2017-06-01";
const MIN_VERSION: &'static str = "1.19.0-nightly";
// Convenience macro for writing to stderr.

View File

@ -46,18 +46,11 @@ pub fn match_def_path(tcx: ty::TyCtxt, def_id: DefId, path: &[&str]) -> bool {
/// Check if the method call given in `expr` belongs to given type.
pub fn is_impl_method(cx: &LateContext, expr: &Expr, path: &[&str]) -> bool {
let method_call = ty::MethodCall::expr(expr.id);
let trt_id = cx.tables
.method_map
.get(&method_call)
.and_then(|callee| cx.tcx.impl_of_method(callee.def_id));
if let Some(trt_id) = trt_id {
match_def_path(cx.tcx, trt_id, path)
} else {
false
}
cx.tables.type_dependent_defs
.get(&expr.id)
.and_then(|callee| cx.tcx.impl_of_method(callee.def_id()))
.map(|trt_id| match_def_path(cx.tcx, trt_id, path))
.unwrap_or(false)
}
pub fn find_initial_receiver<'e>(cx: &LateContext,