@@ -70,7 +70,9 @@ use rustc_data_structures::ptr_key::PtrKey;
70
70
use rustc_data_structures:: sync:: Lrc ;
71
71
use smallvec:: SmallVec ;
72
72
73
- use diagnostics:: { find_span_of_binding_until_next_binding, extend_span_to_previous_binding} ;
73
+ use diagnostics:: {
74
+ find_span_of_binding_until_next_binding, extend_span_to_previous_binding, CurrentScope ,
75
+ } ;
74
76
use resolve_imports:: { ImportDirective , ImportDirectiveSubclass , NameResolution , ImportResolver } ;
75
77
use macros:: { InvocationData , LegacyBinding , ParentScope } ;
76
78
@@ -194,39 +196,6 @@ enum ResolutionError<'a> {
194
196
ConstParamDependentOnTypeParam ,
195
197
}
196
198
197
- #[ derive( Clone , Copy ) ]
198
- enum CurrentScope {
199
- Const ,
200
- Static ,
201
- Type ,
202
- Other ,
203
- }
204
-
205
- impl CurrentScope {
206
- fn is_other ( & self ) -> bool {
207
- match self {
208
- CurrentScope :: Other => true ,
209
- _ => false ,
210
- }
211
- }
212
-
213
- fn description ( & self ) -> & ' static str {
214
- match self {
215
- Self :: Const => "`const` associated item" ,
216
- Self :: Static => "`static` associated item" ,
217
- Self :: Type => "associated type" ,
218
- Self :: Other => "outer function" ,
219
- }
220
- }
221
-
222
- fn generic_param_resolution_error_message ( & self ) -> String {
223
- match self {
224
- Self :: Other => format ! ( "from {}" , self . description( ) ) ,
225
- _ => format ! ( "in {}" , self . description( ) ) ,
226
- }
227
- }
228
- }
229
-
230
199
/// Combines an error with provided span and emits it.
231
200
///
232
201
/// This takes the error provided, combines it with the span and any additional spans inside the
0 commit comments