@@ -22,8 +22,8 @@ use std::fmt;
2222use std:: fmt:: Debug ;
2323
2424use self :: ty:: {
25- GenericPredicates , Generics , ImplDef , ImplTrait , IndexedVal , Span , TraitDecl , TraitDef , Ty ,
26- TyKind ,
25+ GenericPredicates , Generics , ImplDef , ImplTrait , IndexedVal , LineInfo , Span , TraitDecl ,
26+ TraitDef , Ty , TyKind ,
2727} ;
2828
2929#[ macro_use]
@@ -108,6 +108,7 @@ pub struct Crate {
108108}
109109
110110pub type DefKind = Opaque ;
111+ pub type Filename = Opaque ;
111112
112113/// Holds information about an item in the crate.
113114/// For now, it only stores the item DefId. Use functions inside `rustc_internal` module to
@@ -196,13 +197,19 @@ pub trait Context {
196197 /// Find a crate with the given name.
197198 fn find_crates ( & self , name : & str ) -> Vec < Crate > ;
198199
199- /// Prints the name of given `DefId`
200+ /// Returns the name of given `DefId`
200201 fn name_of_def_id ( & self , def_id : DefId ) -> String ;
201202
202- /// Prints a human readable form of `Span`
203+ /// Returns printable, human readable form of `Span`
203204 fn print_span ( & self , span : Span ) -> String ;
204205
205- /// Prints the kind of given `DefId`
206+ /// Return filename from given `Span`, for diagnostic purposes
207+ fn get_filename ( & self , span : & Span ) -> Filename ;
208+
209+ /// Return lines corresponding to this `Span`
210+ fn get_lines ( & self , span : & Span ) -> Vec < LineInfo > ;
211+
212+ /// Returns the `kind` of given `DefId`
206213 fn def_kind ( & mut self , def_id : DefId ) -> DefKind ;
207214
208215 /// `Span` of an item
0 commit comments