@@ -70,7 +70,9 @@ use rustc_data_structures::ptr_key::PtrKey;
7070use rustc_data_structures:: sync:: Lrc ;
7171use smallvec:: SmallVec ;
7272
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+ } ;
7476use resolve_imports:: { ImportDirective , ImportDirectiveSubclass , NameResolution , ImportResolver } ;
7577use macros:: { InvocationData , LegacyBinding , ParentScope } ;
7678
@@ -194,39 +196,6 @@ enum ResolutionError<'a> {
194196 ConstParamDependentOnTypeParam ,
195197}
196198
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-
230199/// Combines an error with provided span and emits it.
231200///
232201/// This takes the error provided, combines it with the span and any additional spans inside the
0 commit comments