]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_lint/bad_style.rs
rustc: always include elidable lifetimes in HIR types.
[rust.git] / src / librustc_lint / bad_style.rs
index 2baef47c214c28ae54b17906a0be338afc8e2253..05ba262ef90c08eae406ba8ebe6f3b6642cb3afc 100644 (file)
@@ -28,7 +28,7 @@ pub enum MethodLateContext {
 }
 
 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) => {
@@ -377,8 +377,8 @@ fn check_impl_item(&mut self, cx: &LateContext, ii: &hir::ImplItem) {
     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,