@@ -41,7 +41,6 @@ pub trait TypeErrCtxtExt<'tcx> {
41
41
static ALLOWED_FORMAT_SYMBOLS : & [ Symbol ] = & [
42
42
kw:: SelfUpper ,
43
43
sym:: ItemContext ,
44
- sym:: from_method,
45
44
sym:: from_desugaring,
46
45
sym:: direct,
47
46
sym:: cause,
@@ -172,23 +171,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
172
171
}
173
172
}
174
173
175
- if let ObligationCauseCode :: ItemObligation ( item)
176
- | ObligationCauseCode :: BindingObligation ( item, _)
177
- | ObligationCauseCode :: ExprItemObligation ( item, ..)
178
- | ObligationCauseCode :: ExprBindingObligation ( item, ..) = * obligation. cause . code ( )
179
- {
180
- // FIXME: maybe also have some way of handling methods
181
- // from other traits? That would require name resolution,
182
- // which we might want to be some sort of hygienic.
183
- //
184
- // Currently I'm leaving it for what I need for `try`.
185
- if self . tcx . trait_of_item ( item) == Some ( trait_ref. def_id ) {
186
- let method = self . tcx . item_name ( item) ;
187
- flags. push ( ( sym:: from_method, None ) ) ;
188
- flags. push ( ( sym:: from_method, Some ( method. to_string ( ) ) ) ) ;
189
- }
190
- }
191
-
192
174
if let Some ( k) = obligation. cause . span . desugaring_kind ( ) {
193
175
flags. push ( ( sym:: from_desugaring, None ) ) ;
194
176
flags. push ( ( sym:: from_desugaring, Some ( format ! ( "{:?}" , k) ) ) ) ;
@@ -672,7 +654,7 @@ impl<'tcx> OnUnimplementedFormatString {
672
654
None => {
673
655
if let Some ( val) = options. get ( & s) {
674
656
val
675
- } else if s == sym:: from_desugaring || s == sym :: from_method {
657
+ } else if s == sym:: from_desugaring {
676
658
// don't break messages using these two arguments incorrectly
677
659
& empty_string
678
660
} else if s == sym:: ItemContext {
0 commit comments