1- //! Module that define a common trait for things that represent a crate definition. 
1+ //! Module that define a common trait for things that represent a crate definition, 
2+ //! such as, a function, a trait, an enum, and any other definitions. 
23
34use  crate :: ty:: Span ; 
45use  crate :: { with,  Crate ,  Symbol } ; 
@@ -7,21 +8,23 @@ use crate::{with, Crate, Symbol};
78#[ derive( Clone ,  Copy ,  PartialEq ,  Eq ,  Hash ) ]  
89pub  struct  DefId ( pub ( crate )  usize ) ; 
910
10- /// A trait for retrieving information about a crate  definition. 
11+ /// A trait for retrieving information about a particular  definition. 
1112/// 
1213/// Implementors must provide the implementation of `def_id` which will be used to retrieve 
13- /// information about its  definition. 
14+ /// information about a crate's  definition. 
1415pub  trait  CrateDef  { 
15-     /// Retrieve the unique identifier for the given  definition. 
16+     /// Retrieve the unique identifier for the current  definition. 
1617fn  def_id ( & self )  -> DefId ; 
1718
18-     /// Return the fully qualified name of the given  definition. 
19+     /// Return the fully qualified name of the current  definition. 
1920fn  name ( & self )  -> Symbol  { 
2021        let  def_id = self . def_id ( ) ; 
2122        with ( |cx| cx. def_name ( def_id,  false ) ) 
2223    } 
2324
24-     /// Return a trimmed name of the given definition. 
25+     /// Return a trimmed name of this definition. 
26+ /// 
27+ /// This can be used to print more user friendly diagnostic messages. 
2528/// 
2629/// If a symbol name can only be imported from one place for a type, and as 
2730/// long as it was not glob-imported anywhere in the current crate, we trim its 
0 commit comments