@@ -403,7 +403,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
403403 libc::c_uint or libc::c_ulong should be used") ;
404404 }
405405 def:: DefTy ( ..) => {
406- let tty = match self . cx . tcx . ast_ty_to_ty_cache . borrow ( ) . find ( & ty_id) {
406+ let tty = match self . cx . tcx . ast_ty_to_ty_cache . borrow ( ) . get ( & ty_id) {
407407 Some ( & ty:: atttce_resolved( t) ) => t,
408408 _ => panic ! ( "ast_ty_to_ty_cache was incomplete after typeck!" )
409409 } ;
@@ -994,7 +994,7 @@ impl LintPass for NonSnakeCase {
994994 fn check_pat ( & mut self , cx : & Context , p : & ast:: Pat ) {
995995 match & p. node {
996996 & ast:: PatIdent ( _, ref path1, _) => {
997- match cx. tcx . def_map . borrow ( ) . find ( & p. id ) {
997+ match cx. tcx . def_map . borrow ( ) . get ( & p. id ) {
998998 Some ( & def:: DefLocal ( _) ) => {
999999 self . check_snake_case ( cx, "variable" , path1. node , p. span ) ;
10001000 }
@@ -1051,7 +1051,7 @@ impl LintPass for NonUpperCaseGlobals {
10511051
10521052 fn check_pat ( & mut self , cx : & Context , p : & ast:: Pat ) {
10531053 // Lint for constants that look like binding identifiers (#7526)
1054- match ( & p. node , cx. tcx . def_map . borrow ( ) . find ( & p. id ) ) {
1054+ match ( & p. node , cx. tcx . def_map . borrow ( ) . get ( & p. id ) ) {
10551055 ( & ast:: PatIdent ( _, ref path1, _) , Some ( & def:: DefConst ( ..) ) ) => {
10561056 let s = token:: get_ident ( path1. node ) ;
10571057 if s. get ( ) . chars ( ) . any ( |c| c. is_lowercase ( ) ) {
@@ -1211,7 +1211,7 @@ impl LintPass for NonShorthandFieldPatterns {
12111211 ast:: PatStruct ( _, ref v, _) => {
12121212 for fieldpat in v. iter ( )
12131213 . filter ( |fieldpat| !fieldpat. node . is_shorthand )
1214- . filter ( |fieldpat| def_map. find ( & fieldpat. node . pat . id )
1214+ . filter ( |fieldpat| def_map. get ( & fieldpat. node . pat . id )
12151215 == Some ( & def:: DefLocal ( fieldpat. node . pat . id ) ) ) {
12161216 match fieldpat. node . pat . node {
12171217 ast:: PatIdent ( _, ident, None ) if ident. node . as_str ( )
@@ -1368,7 +1368,7 @@ impl LintPass for UnusedAllocation {
13681368 _ => return
13691369 }
13701370
1371- match cx. tcx . adjustments . borrow ( ) . find ( & e. id ) {
1371+ match cx. tcx . adjustments . borrow ( ) . get ( & e. id ) {
13721372 Some ( adjustment) => {
13731373 match * adjustment {
13741374 ty:: AdjustDerefRef ( ty:: AutoDerefRef { ref autoref, .. } ) => {
@@ -1637,15 +1637,15 @@ impl LintPass for Stability {
16371637
16381638 let id = match e. node {
16391639 ast:: ExprPath ( ..) | ast:: ExprStruct ( ..) => {
1640- match cx. tcx . def_map . borrow ( ) . find ( & e. id ) {
1640+ match cx. tcx . def_map . borrow ( ) . get ( & e. id ) {
16411641 Some ( & def) => def. def_id ( ) ,
16421642 None => return
16431643 }
16441644 }
16451645 ast:: ExprMethodCall ( i, _, _) => {
16461646 span = i. span ;
16471647 let method_call = typeck:: MethodCall :: expr ( e. id ) ;
1648- match cx. tcx . method_map . borrow ( ) . find ( & method_call) {
1648+ match cx. tcx . method_map . borrow ( ) . get ( & method_call) {
16491649 Some ( method) => {
16501650 match method. origin {
16511651 typeck:: MethodStatic ( def_id) => {
0 commit comments