Skip to content

Commit 3aec8d4

Browse files
committed
Remove unused from_method symbol
1 parent fd68a6d commit 3aec8d4

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

compiler/rustc_span/src/symbol.rs

-1
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,6 @@ symbols! {
759759
from_desugaring,
760760
from_fn,
761761
from_iter,
762-
from_method,
763762
from_output,
764763
from_residual,
765764
from_size_align_unchecked,

compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ pub trait TypeErrCtxtExt<'tcx> {
4141
static ALLOWED_FORMAT_SYMBOLS: &[Symbol] = &[
4242
kw::SelfUpper,
4343
sym::ItemContext,
44-
sym::from_method,
4544
sym::from_desugaring,
4645
sym::direct,
4746
sym::cause,
@@ -172,23 +171,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
172171
}
173172
}
174173

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-
192174
if let Some(k) = obligation.cause.span.desugaring_kind() {
193175
flags.push((sym::from_desugaring, None));
194176
flags.push((sym::from_desugaring, Some(format!("{:?}", k))));
@@ -672,7 +654,7 @@ impl<'tcx> OnUnimplementedFormatString {
672654
None => {
673655
if let Some(val) = options.get(&s) {
674656
val
675-
} else if s == sym::from_desugaring || s == sym::from_method {
657+
} else if s == sym::from_desugaring {
676658
// don't break messages using these two arguments incorrectly
677659
&empty_string
678660
} else if s == sym::ItemContext {

0 commit comments

Comments
 (0)