@@ -359,7 +359,7 @@ impl<'a, 'tcx> Folder for StaticInliner<'a, 'tcx> {
359359 fn fold_pat ( & mut self , pat : P < Pat > ) -> P < Pat > {
360360 match pat. node {
361361 PatIdent ( ..) | PatEnum ( ..) => {
362- let def = self . tcx . def_map . borrow ( ) . find_copy ( & pat. id ) ;
362+ let def = self . tcx . def_map . borrow ( ) . get ( & pat. id ) . cloned ( ) ;
363363 match def {
364364 Some ( DefConst ( did) ) => match lookup_const_by_id ( self . tcx , did) {
365365 Some ( const_expr) => {
@@ -749,7 +749,7 @@ pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat],
749749 Some ( Vec :: from_elem ( arity, DUMMY_WILD_PAT ) ) ,
750750
751751 & PatIdent ( _, _, _) => {
752- let opt_def = cx. tcx . def_map . borrow ( ) . find_copy ( & pat_id) ;
752+ let opt_def = cx. tcx . def_map . borrow ( ) . get ( & pat_id) . cloned ( ) ;
753753 match opt_def {
754754 Some ( DefConst ( ..) ) =>
755755 cx. tcx . sess . span_bug ( pat_span, "const pattern should've \
@@ -764,7 +764,7 @@ pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat],
764764 }
765765
766766 & PatEnum ( _, ref args) => {
767- let def = cx. tcx . def_map . borrow ( ) . get_copy ( & pat_id ) ;
767+ let def = cx. tcx . def_map . borrow ( ) [ pat_id ] . clone ( ) ;
768768 match def {
769769 DefConst ( ..) =>
770770 cx. tcx . sess . span_bug ( pat_span, "const pattern should've \
@@ -782,7 +782,7 @@ pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat],
782782
783783 & PatStruct ( _, ref pattern_fields, _) => {
784784 // Is this a struct or an enum variant?
785- let def = cx. tcx . def_map . borrow ( ) . get_copy ( & pat_id ) ;
785+ let def = cx. tcx . def_map . borrow ( ) [ pat_id ] . clone ( ) ;
786786 let class_id = match def {
787787 DefConst ( ..) =>
788788 cx. tcx . sess . span_bug ( pat_span, "const pattern should've \
0 commit comments