mirror of https://github.com/rwf2/Rocket.git
Update codegen lints for latest nightly.
This commit is contained in:
parent
f1ec552ac5
commit
614297eb9b
|
@ -8,7 +8,7 @@ use ansi_term::Color::{Red, Yellow, Blue, White};
|
||||||
use version_check::{is_nightly, is_min_version, is_min_date};
|
use version_check::{is_nightly, is_min_version, is_min_date};
|
||||||
|
|
||||||
// Specifies the minimum nightly version needed to compile Rocket's codegen.
|
// 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";
|
const MIN_VERSION: &'static str = "1.19.0-nightly";
|
||||||
|
|
||||||
// Convenience macro for writing to stderr.
|
// Convenience macro for writing to stderr.
|
||||||
|
|
|
@ -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.
|
/// Check if the method call given in `expr` belongs to given type.
|
||||||
pub fn is_impl_method(cx: &LateContext, expr: &Expr, path: &[&str]) -> bool {
|
pub fn is_impl_method(cx: &LateContext, expr: &Expr, path: &[&str]) -> bool {
|
||||||
let method_call = ty::MethodCall::expr(expr.id);
|
cx.tables.type_dependent_defs
|
||||||
|
.get(&expr.id)
|
||||||
let trt_id = cx.tables
|
.and_then(|callee| cx.tcx.impl_of_method(callee.def_id()))
|
||||||
.method_map
|
.map(|trt_id| match_def_path(cx.tcx, trt_id, path))
|
||||||
.get(&method_call)
|
.unwrap_or(false)
|
||||||
.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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn find_initial_receiver<'e>(cx: &LateContext,
|
pub fn find_initial_receiver<'e>(cx: &LateContext,
|
||||||
|
|
Loading…
Reference in New Issue