@@ -67,8 +67,8 @@ pub enum BoundRegion {
67
67
/// Fresh bound identifiers created during GLB computations.
68
68
BrFresh ( u32 ) ,
69
69
70
- // Anonymous region for the implicit env pointer parameter
71
- // to a closure
70
+ /// Anonymous region for the implicit env pointer parameter
71
+ /// to a closure
72
72
BrEnv ,
73
73
}
74
74
@@ -95,8 +95,8 @@ pub struct Issue32330 {
95
95
pub region_name : ast:: Name ,
96
96
}
97
97
98
- // NB: If you change this, you'll probably want to change the corresponding
99
- // AST structure in libsyntax/ast.rs as well.
98
+ /// NB: If you change this, you'll probably want to change the corresponding
99
+ /// AST structure in libsyntax/ast.rs as well.
100
100
#[ derive( Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
101
101
pub enum TypeVariants < ' tcx > {
102
102
/// The primitive boolean type. Written as `bool`.
@@ -283,11 +283,11 @@ impl<'a, 'gcx, 'acx, 'tcx> ClosureSubsts<'tcx> {
283
283
284
284
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
285
285
pub enum ExistentialPredicate < ' tcx > {
286
- // e.g. Iterator
286
+ /// e.g. Iterator
287
287
Trait ( ExistentialTraitRef < ' tcx > ) ,
288
- // e.g. Iterator::Item = T
288
+ /// e.g. Iterator::Item = T
289
289
Projection ( ExistentialProjection < ' tcx > ) ,
290
- // e.g. Send
290
+ /// e.g. Send
291
291
AutoTrait ( DefId ) ,
292
292
}
293
293
@@ -683,8 +683,8 @@ impl<'a, 'gcx, 'tcx> ParamTy {
683
683
/// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index
684
684
#[ derive( Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable , Debug , Copy ) ]
685
685
pub struct DebruijnIndex {
686
- // We maintain the invariant that this is never 0. So 1 indicates
687
- // the innermost binder. To ensure this, create with `DebruijnIndex::new`.
686
+ /// We maintain the invariant that this is never 0. So 1 indicates
687
+ /// the innermost binder. To ensure this, create with `DebruijnIndex::new`.
688
688
pub depth : u32 ,
689
689
}
690
690
@@ -908,7 +908,7 @@ impl DebruijnIndex {
908
908
}
909
909
}
910
910
911
- // Region utilities
911
+ /// Region utilities
912
912
impl < ' tcx > RegionKind < ' tcx > {
913
913
pub fn is_bound ( & self ) -> bool {
914
914
match * self {
@@ -972,7 +972,7 @@ impl<'tcx> RegionKind<'tcx> {
972
972
}
973
973
}
974
974
975
- // Type utilities
975
+ /// Type utilities
976
976
impl < ' a , ' gcx , ' tcx > TyS < ' tcx > {
977
977
pub fn as_opt_param_ty ( & self ) -> Option < ty:: ParamTy > {
978
978
match self . sty {
@@ -995,8 +995,8 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
995
995
}
996
996
}
997
997
998
- // Test whether this is a `()` which was produced by defaulting a
999
- // diverging type variable with feature(never_type) disabled.
998
+ /// Test whether this is a `()` which was produced by defaulting a
999
+ /// diverging type variable with feature(never_type) disabled.
1000
1000
pub fn is_defaulted_unit ( & self ) -> bool {
1001
1001
match self . sty {
1002
1002
TyTuple ( _, true ) => true ,
@@ -1171,18 +1171,17 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
1171
1171
}
1172
1172
}
1173
1173
1174
+ /// panics if called on any type other than `Box<T>`
1174
1175
pub fn boxed_ty ( & self ) -> Ty < ' tcx > {
1175
1176
match self . sty {
1176
1177
TyAdt ( def, substs) if def. is_box ( ) => substs. type_at ( 0 ) ,
1177
1178
_ => bug ! ( "`boxed_ty` is called on non-box type {:?}" , self ) ,
1178
1179
}
1179
1180
}
1180
1181
1181
- /*
1182
- A scalar type is one that denotes an atomic datum, with no sub-components.
1183
- (A TyRawPtr is scalar because it represents a non-managed pointer, so its
1184
- contents are abstract to rustc.)
1185
- */
1182
+ /// A scalar type is one that denotes an atomic datum, with no sub-components.
1183
+ /// (A TyRawPtr is scalar because it represents a non-managed pointer, so its
1184
+ /// contents are abstract to rustc.)
1186
1185
pub fn is_scalar ( & self ) -> bool {
1187
1186
match self . sty {
1188
1187
TyBool | TyChar | TyInt ( _) | TyFloat ( _) | TyUint ( _) |
@@ -1278,10 +1277,10 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
1278
1277
}
1279
1278
}
1280
1279
1281
- // Returns the type and mutability of *ty.
1282
- //
1283
- // The parameter `explicit` indicates if this is an *explicit* dereference.
1284
- // Some types---notably unsafe ptrs---can only be dereferenced explicitly.
1280
+ /// Returns the type and mutability of *ty.
1281
+ ///
1282
+ /// The parameter `explicit` indicates if this is an *explicit* dereference.
1283
+ /// Some types---notably unsafe ptrs---can only be dereferenced explicitly.
1285
1284
pub fn builtin_deref ( & self , explicit : bool , pref : ty:: LvaluePreference )
1286
1285
-> Option < TypeAndMut < ' tcx > >
1287
1286
{
@@ -1302,7 +1301,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
1302
1301
}
1303
1302
}
1304
1303
1305
- // Returns the type of ty[i]
1304
+ /// Returns the type of ty[i]
1306
1305
pub fn builtin_index ( & self ) -> Option < Ty < ' tcx > > {
1307
1306
match self . sty {
1308
1307
TyArray ( ty, _) | TySlice ( ty) => Some ( ty) ,
@@ -1317,7 +1316,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
1317
1316
}
1318
1317
}
1319
1318
1320
- // Type accessors for substructures of types
1319
+ /// Type accessors for substructures of types
1321
1320
pub fn fn_args ( & self ) -> ty:: Binder < & ' tcx [ Ty < ' tcx > ] > {
1322
1321
self . fn_sig ( ) . inputs ( )
1323
1322
}
0 commit comments