@@ -165,7 +165,7 @@ pub fn check_pat_variant(pcx: &pat_ctxt, pat: &ast::Pat, path: &ast::Path,
165
165
// See [Note-Type-error-reporting] in middle/typeck/infer/mod.rs
166
166
fcx. infcx ( ) . type_error_message_str_with_expected ( pat. span ,
167
167
|expected, actual| {
168
- expected. map_default ( ~"", |e| {
168
+ expected. map_or ( ~"", |e| {
169
169
format ! ( "mismatched types: expected `{}` but found {}" ,
170
170
e, actual) } ) } ,
171
171
Some ( expected) , ~"a structure pattern",
@@ -214,7 +214,7 @@ pub fn check_pat_variant(pcx: &pat_ctxt, pat: &ast::Pat, path: &ast::Path,
214
214
// See [Note-Type-error-reporting] in middle/typeck/infer/mod.rs
215
215
fcx. infcx ( ) . type_error_message_str_with_expected ( pat. span ,
216
216
|expected, actual| {
217
- expected. map_default ( ~"", |e| {
217
+ expected. map_or ( ~"", |e| {
218
218
format ! ( "mismatched types: expected `{}` but found {}" ,
219
219
e, actual) } ) } ,
220
220
Some ( expected) , ~"an enum or structure pattern",
@@ -530,7 +530,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
530
530
// See [Note-Type-error-reporting] in middle/typeck/infer/mod.rs
531
531
fcx.infcx().type_error_message_str_with_expected(pat.span,
532
532
|expected, actual| {
533
- expected.map_default (~" ", |e| {
533
+ expected.map_or (~" ", |e| {
534
534
format!(" mismatched types: expected `{ } ` but found { } ",
535
535
e, actual)})},
536
536
Some(expected), ~" a structure pattern",
@@ -578,7 +578,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
578
578
};
579
579
// See [Note-Type-error-reporting] in middle/typeck/infer/mod.rs
580
580
fcx.infcx().type_error_message_str_with_expected(pat.span, |expected, actual| {
581
- expected.map_default (~" ", |e| {
581
+ expected.map_or (~" ", |e| {
582
582
format!(" mismatched types: expected `{ } ` but found { } ",
583
583
e, actual)})}, Some(expected), ~" tuple", Some(&type_error));
584
584
fcx.write_error(pat.id);
@@ -628,7 +628,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
628
628
fcx.infcx().type_error_message_str_with_expected(
629
629
pat.span,
630
630
|expected, actual| {
631
- expected.map_default (~" ", |e| {
631
+ expected.map_or (~" ", |e| {
632
632
format!(" mismatched types: expected `{ } ` but found { } ",
633
633
e, actual)})},
634
634
Some(expected),
@@ -687,7 +687,7 @@ pub fn check_pointer_pat(pcx: &pat_ctxt,
687
687
fcx.infcx().type_error_message_str_with_expected(
688
688
span,
689
689
|expected, actual| {
690
- expected.map_default (~" ", |e| {
690
+ expected.map_or (~" ", |e| {
691
691
format!(" mismatched types: expected `{ } ` but found { } ",
692
692
e, actual)})},
693
693
Some(expected),
0 commit comments