@@ -403,7 +403,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
403
403
libc::c_uint or libc::c_ulong should be used") ;
404
404
}
405
405
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) {
407
407
Some ( & ty:: atttce_resolved( t) ) => t,
408
408
_ => panic ! ( "ast_ty_to_ty_cache was incomplete after typeck!" )
409
409
} ;
@@ -994,7 +994,7 @@ impl LintPass for NonSnakeCase {
994
994
fn check_pat ( & mut self , cx : & Context , p : & ast:: Pat ) {
995
995
match & p. node {
996
996
& ast:: PatIdent ( _, ref path1, _) => {
997
- match cx. tcx . def_map . borrow ( ) . find ( & p. id ) {
997
+ match cx. tcx . def_map . borrow ( ) . get ( & p. id ) {
998
998
Some ( & def:: DefLocal ( _) ) => {
999
999
self . check_snake_case ( cx, "variable" , path1. node , p. span ) ;
1000
1000
}
@@ -1051,7 +1051,7 @@ impl LintPass for NonUpperCaseGlobals {
1051
1051
1052
1052
fn check_pat ( & mut self , cx : & Context , p : & ast:: Pat ) {
1053
1053
// 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 ) ) {
1055
1055
( & ast:: PatIdent ( _, ref path1, _) , Some ( & def:: DefConst ( ..) ) ) => {
1056
1056
let s = token:: get_ident ( path1. node ) ;
1057
1057
if s. get ( ) . chars ( ) . any ( |c| c. is_lowercase ( ) ) {
@@ -1211,7 +1211,7 @@ impl LintPass for NonShorthandFieldPatterns {
1211
1211
ast:: PatStruct ( _, ref v, _) => {
1212
1212
for fieldpat in v. iter ( )
1213
1213
. 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 )
1215
1215
== Some ( & def:: DefLocal ( fieldpat. node . pat . id ) ) ) {
1216
1216
match fieldpat. node . pat . node {
1217
1217
ast:: PatIdent ( _, ident, None ) if ident. node . as_str ( )
@@ -1368,7 +1368,7 @@ impl LintPass for UnusedAllocation {
1368
1368
_ => return
1369
1369
}
1370
1370
1371
- match cx. tcx . adjustments . borrow ( ) . find ( & e. id ) {
1371
+ match cx. tcx . adjustments . borrow ( ) . get ( & e. id ) {
1372
1372
Some ( adjustment) => {
1373
1373
match * adjustment {
1374
1374
ty:: AdjustDerefRef ( ty:: AutoDerefRef { ref autoref, .. } ) => {
@@ -1637,15 +1637,15 @@ impl LintPass for Stability {
1637
1637
1638
1638
let id = match e. node {
1639
1639
ast:: ExprPath ( ..) | ast:: ExprStruct ( ..) => {
1640
- match cx. tcx . def_map . borrow ( ) . find ( & e. id ) {
1640
+ match cx. tcx . def_map . borrow ( ) . get ( & e. id ) {
1641
1641
Some ( & def) => def. def_id ( ) ,
1642
1642
None => return
1643
1643
}
1644
1644
}
1645
1645
ast:: ExprMethodCall ( i, _, _) => {
1646
1646
span = i. span ;
1647
1647
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) {
1649
1649
Some ( method) => {
1650
1650
match method. origin {
1651
1651
typeck:: MethodStatic ( def_id) => {
0 commit comments