11#![ feature( rustc_private) ]
22#![ feature( once_cell) ]
3- // allow us to match on Box<T>s:
3+ // Allow us to match on Box<T>s:
44#![ feature( box_patterns) ]
55#![ feature( let_else) ]
66#![ feature( iter_zip) ]
7- // allow us to get file prefix
7+ // Allow us to get file prefix
88#![ feature( path_file_prefix) ]
99extern crate rustc_ast;
1010extern crate rustc_ast_pretty;
@@ -329,7 +329,7 @@ pub enum FunctionType {
329329 Ptr ,
330330 Null ,
331331 Complex ,
332- This , // self in struct method
332+ This , // Self in struct method
333333}
334334
335335impl fmt:: Display for FunctionType {
@@ -374,11 +374,11 @@ pub struct Attribute {
374374pub struct Class {
375375 name : String ,
376376 constructor : Option < Function > ,
377- destructor : Option < Function > , // maybe we don't need destructor. just drop the variable
377+ destructor : Option < Function > , // TODO: Maybe we don't need destructor, just drop the variable (review)
378378 methods : Vec < Function > ,
379379 static_methods : Vec < Function > ,
380380 attributes : Vec < Attribute > ,
381- // static_attributes: Vec<Attribute>, // we don't handle static attrs in rust
381+ // static_attributes: Vec<Attribute>, // We don't handle static attrs in rust
382382}
383383#[ derive( Clone , Debug ) ]
384384pub struct CompilerState {
@@ -430,28 +430,28 @@ impl CompilerCallbacks {
430430 . expect ( "Unable to get global ctxt" )
431431 . peek_mut ( )
432432 . enter ( |ctxt| {
433- // since we are loading a package, input_path should be lib<crate_name>.rlib
433+ // Since we are loading a package, input_path should be lib<crate_name>.rlib
434434 let crate_name = & self
435435 . source
436436 . input_path
437437 . file_prefix ( )
438438 . expect ( "Unable to get file prefix." )
439439 . to_str ( )
440440 . expect ( "Unable to cast OsStr to str" ) [ 3 ..] ;
441- // find our krate
441+ // Find our crate
442442 let crate_num = krates
443443 . iter ( )
444444 . find ( |& & x| {
445445 ctxt. crate_name ( x) == rustc_span:: Symbol :: intern ( crate_name)
446446 } )
447447 . or_else ( || krates. iter ( ) . next ( ) )
448448 . expect ( "unable to find crate" ) ;
449- // parse public functions and structs
449+ // Parse public functions and structs
450450 for child in ctxt. item_children ( crate_num. as_def_id ( ) ) {
451451 let Export {
452452 ident, res, vis, ..
453453 } = child;
454- // skip non-public items
454+ // Skip non-public items
455455 if !matches ! ( vis, Visibility :: Public ) {
456456 continue ;
457457 }
@@ -499,7 +499,7 @@ impl CompilerCallbacks {
499499 _ => { }
500500 }
501501 }
502- // after parsing all structs, parse tarit implementations.
502+ // After parsing all structs, parse tarit implementations
503503 for trait_impl in ctxt. all_trait_implementations ( * crate_num) {
504504 use rustc_middle:: ty:: fast_reject:: SimplifiedTypeGen :: AdtSimplifiedType ;
505505 if let Some ( AdtSimplifiedType ( def_id) ) = trait_impl. 1 {
@@ -710,7 +710,7 @@ impl<'a> visit::Visitor<'a> for ItemVisitor {
710710 let name = item. ident . to_string ( ) ;
711711 match & item. kind {
712712 rustc_ast:: AssocItemKind :: Fn ( box rustc_ast:: Fn { sig, .. } ) => {
713- // function has self in parameters
713+ // Function has self in parameters
714714 if sig. decl . has_self ( ) {
715715 match impl_kind {
716716 ImplKind :: Drop => {
@@ -721,7 +721,7 @@ impl<'a> visit::Visitor<'a> for ItemVisitor {
721721 }
722722 }
723723 } else {
724- // static method
724+ // Static method
725725 match & sig. decl . output {
726726 rustc_ast:: FnRetTy :: Ty ( p) => match & * * p {
727727 rustc_ast:: Ty { kind, .. } => match kind {
0 commit comments