Skip to content

Commit 43349e6

Browse files
authored
Upgrade some comments to doc comments
1 parent fb6f845 commit 43349e6

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

src/librustc/ty/sty.rs

+23-24
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ pub enum BoundRegion {
6767
/// Fresh bound identifiers created during GLB computations.
6868
BrFresh(u32),
6969

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
7272
BrEnv,
7373
}
7474

@@ -95,8 +95,8 @@ pub struct Issue32330 {
9595
pub region_name: ast::Name,
9696
}
9797

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.
100100
#[derive(Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
101101
pub enum TypeVariants<'tcx> {
102102
/// The primitive boolean type. Written as `bool`.
@@ -283,11 +283,11 @@ impl<'a, 'gcx, 'acx, 'tcx> ClosureSubsts<'tcx> {
283283

284284
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
285285
pub enum ExistentialPredicate<'tcx> {
286-
// e.g. Iterator
286+
/// e.g. Iterator
287287
Trait(ExistentialTraitRef<'tcx>),
288-
// e.g. Iterator::Item = T
288+
/// e.g. Iterator::Item = T
289289
Projection(ExistentialProjection<'tcx>),
290-
// e.g. Send
290+
/// e.g. Send
291291
AutoTrait(DefId),
292292
}
293293

@@ -683,8 +683,8 @@ impl<'a, 'gcx, 'tcx> ParamTy {
683683
/// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index
684684
#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Debug, Copy)]
685685
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`.
688688
pub depth: u32,
689689
}
690690

@@ -908,7 +908,7 @@ impl DebruijnIndex {
908908
}
909909
}
910910

911-
// Region utilities
911+
/// Region utilities
912912
impl<'tcx> RegionKind<'tcx> {
913913
pub fn is_bound(&self) -> bool {
914914
match *self {
@@ -972,7 +972,7 @@ impl<'tcx> RegionKind<'tcx> {
972972
}
973973
}
974974

975-
// Type utilities
975+
/// Type utilities
976976
impl<'a, 'gcx, 'tcx> TyS<'tcx> {
977977
pub fn as_opt_param_ty(&self) -> Option<ty::ParamTy> {
978978
match self.sty {
@@ -995,8 +995,8 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
995995
}
996996
}
997997

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.
10001000
pub fn is_defaulted_unit(&self) -> bool {
10011001
match self.sty {
10021002
TyTuple(_, true) => true,
@@ -1171,18 +1171,17 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
11711171
}
11721172
}
11731173

1174+
/// panics if called on any type other than `Box<T>`
11741175
pub fn boxed_ty(&self) -> Ty<'tcx> {
11751176
match self.sty {
11761177
TyAdt(def, substs) if def.is_box() => substs.type_at(0),
11771178
_ => bug!("`boxed_ty` is called on non-box type {:?}", self),
11781179
}
11791180
}
11801181

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.)
11861185
pub fn is_scalar(&self) -> bool {
11871186
match self.sty {
11881187
TyBool | TyChar | TyInt(_) | TyFloat(_) | TyUint(_) |
@@ -1278,10 +1277,10 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
12781277
}
12791278
}
12801279

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.
12851284
pub fn builtin_deref(&self, explicit: bool, pref: ty::LvaluePreference)
12861285
-> Option<TypeAndMut<'tcx>>
12871286
{
@@ -1302,7 +1301,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
13021301
}
13031302
}
13041303

1305-
// Returns the type of ty[i]
1304+
/// Returns the type of ty[i]
13061305
pub fn builtin_index(&self) -> Option<Ty<'tcx>> {
13071306
match self.sty {
13081307
TyArray(ty, _) | TySlice(ty) => Some(ty),
@@ -1317,7 +1316,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
13171316
}
13181317
}
13191318

1320-
// Type accessors for substructures of types
1319+
/// Type accessors for substructures of types
13211320
pub fn fn_args(&self) -> ty::Binder<&'tcx [Ty<'tcx>]> {
13221321
self.fn_sig().inputs()
13231322
}

0 commit comments

Comments
 (0)