}
pub fn method_context(cx: &LateContext, id: ast::NodeId, span: Span) -> MethodLateContext {
- let def_id = cx.tcx.map.local_def_id(id);
+ let def_id = cx.tcx.hir.local_def_id(id);
match cx.tcx.associated_items.borrow().get(&def_id) {
None => span_bug!(span, "missing method descriptor?!"),
Some(item) => {
fn check_pat(&mut self, cx: &LateContext, p: &hir::Pat) {
// Lint for constants that look like binding identifiers (#7526)
if let PatKind::Path(hir::QPath::Resolved(None, ref path)) = p.node {
- if path.segments.len() == 1 && path.segments[0].parameters.is_empty() {
- if let Def::Const(..) = path.def {
+ if let Def::Const(..) = path.def {
+ if path.segments.len() == 1 {
NonUpperCaseGlobals::check_upper_case(cx,
"constant in pattern",
path.segments[0].name,