@@ -294,7 +294,7 @@ impl Visibility {
294
294
}
295
295
}
296
296
297
- /// Returns true if an item with this visibility is accessible from the given block.
297
+ /// Returns ` true` if an item with this visibility is accessible from the given block.
298
298
pub fn is_accessible_from < T : DefIdTree > ( self , module : DefId , tree : T ) -> bool {
299
299
let restriction = match self {
300
300
// Public items are visible everywhere.
@@ -309,7 +309,7 @@ impl Visibility {
309
309
tree. is_descendant_of ( module, restriction)
310
310
}
311
311
312
- /// Returns true if this visibility is at least as accessible as the given visibility
312
+ /// Returns ` true` if this visibility is at least as accessible as the given visibility
313
313
pub fn is_at_least < T : DefIdTree > ( self , vis : Visibility , tree : T ) -> bool {
314
314
let vis_restriction = match vis {
315
315
Visibility :: Public => return self == Visibility :: Public ,
@@ -320,7 +320,7 @@ impl Visibility {
320
320
self . is_accessible_from ( vis_restriction, tree)
321
321
}
322
322
323
- // Returns true if this item is visible anywhere in the local crate.
323
+ // Returns ` true` if this item is visible anywhere in the local crate.
324
324
pub fn is_visible_locally ( self ) -> bool {
325
325
match self {
326
326
Visibility :: Public => true ,
@@ -451,7 +451,7 @@ bitflags! {
451
451
// FIXME: Rename this to the actual property since it's used for generators too
452
452
const HAS_TY_CLOSURE = 1 << 9 ;
453
453
454
- // true if there are "names" of types and regions and so forth
454
+ // ` true` if there are "names" of types and regions and so forth
455
455
// that are local to a particular fn
456
456
const HAS_FREE_LOCAL_NAMES = 1 << 10 ;
457
457
@@ -953,7 +953,7 @@ impl<'a, 'gcx, 'tcx> Generics {
953
953
_ => bug ! ( "expected lifetime parameter, but found another generic parameter" )
954
954
}
955
955
} else {
956
- tcx. generics_of ( self . parent . expect ( "parent_count> 0 but no parent?" ) )
956
+ tcx. generics_of ( self . parent . expect ( "parent_count > 0 but no parent?" ) )
957
957
. region_param ( param, tcx)
958
958
}
959
959
}
@@ -970,7 +970,7 @@ impl<'a, 'gcx, 'tcx> Generics {
970
970
_ => bug ! ( "expected type parameter, but found another generic parameter" )
971
971
}
972
972
} else {
973
- tcx. generics_of ( self . parent . expect ( "parent_count> 0 but no parent?" ) )
973
+ tcx. generics_of ( self . parent . expect ( "parent_count > 0 but no parent?" ) )
974
974
. type_param ( param, tcx)
975
975
}
976
976
}
@@ -993,6 +993,7 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> {
993
993
self . instantiate_into ( tcx, & mut instantiated, substs) ;
994
994
instantiated
995
995
}
996
+
996
997
pub fn instantiate_own ( & self , tcx : TyCtxt < ' a , ' gcx , ' tcx > , substs : & Substs < ' tcx > )
997
998
-> InstantiatedPredicates < ' tcx > {
998
999
InstantiatedPredicates {
@@ -1256,14 +1257,14 @@ pub struct ProjectionPredicate<'tcx> {
1256
1257
pub type PolyProjectionPredicate < ' tcx > = Binder < ProjectionPredicate < ' tcx > > ;
1257
1258
1258
1259
impl < ' tcx > PolyProjectionPredicate < ' tcx > {
1259
- /// Returns the def-id of the associated item being projected.
1260
+ /// Returns the `DefId` of the associated item being projected.
1260
1261
pub fn item_def_id ( & self ) -> DefId {
1261
1262
self . skip_binder ( ) . projection_ty . item_def_id
1262
1263
}
1263
1264
1264
1265
pub fn to_poly_trait_ref ( & self , tcx : TyCtxt < ' _ , ' _ , ' _ > ) -> PolyTraitRef < ' tcx > {
1265
- // Note: unlike with TraitRef::to_poly_trait_ref(),
1266
- // self.0.trait_ref is permitted to have escaping regions.
1266
+ // Note: unlike with ` TraitRef::to_poly_trait_ref()` ,
1267
+ // ` self.0.trait_ref` is permitted to have escaping regions.
1267
1268
// This is because here `self` has a `Binder` and so does our
1268
1269
// return value, so we are preserving the number of binding
1269
1270
// levels.
@@ -1274,12 +1275,12 @@ impl<'tcx> PolyProjectionPredicate<'tcx> {
1274
1275
self . map_bound ( |predicate| predicate. ty )
1275
1276
}
1276
1277
1277
- /// The DefId of the TraitItem for the associated type.
1278
+ /// The ` DefId` of the ` TraitItem` for the associated type.
1278
1279
///
1279
- /// Note that this is not the DefId of the TraitRef containing this
1280
- /// associated type, which is in tcx.associated_item(projection_def_id()).container.
1280
+ /// Note that this is not the ` DefId` of the ` TraitRef` containing this
1281
+ /// associated type, which is in ` tcx.associated_item(projection_def_id()).container` .
1281
1282
pub fn projection_def_id ( & self ) -> DefId {
1282
- // ok to skip binder since trait def-id does not care about regions
1283
+ // okay to skip binder since trait def-id does not care about regions
1283
1284
self . skip_binder ( ) . projection_ty . item_def_id
1284
1285
}
1285
1286
}
@@ -1515,14 +1516,14 @@ impl UniverseIndex {
1515
1516
UniverseIndex :: from_u32 ( self . private . checked_add ( 1 ) . unwrap ( ) )
1516
1517
}
1517
1518
1518
- /// True if `self` can name a name from `other` -- in other words,
1519
+ /// `true` if `self` can name a name from `other` -- in other words,
1519
1520
/// if the set of names in `self` is a superset of those in
1520
1521
/// `other` (`self >= other`).
1521
1522
pub fn can_name ( self , other : UniverseIndex ) -> bool {
1522
1523
self . private >= other. private
1523
1524
}
1524
1525
1525
- /// True if `self` cannot name some names from `other` -- in other
1526
+ /// `true` if `self` cannot name some names from `other` -- in other
1526
1527
/// words, if the set of names in `self` is a strict subset of
1527
1528
/// those in `other` (`self < other`).
1528
1529
pub fn cannot_name ( self , other : UniverseIndex ) -> bool {
@@ -1574,7 +1575,7 @@ impl<'tcx> ParamEnv<'tcx> {
1574
1575
/// are revealed. This is suitable for monomorphized, post-typeck
1575
1576
/// environments like codegen or doing optimizations.
1576
1577
///
1577
- /// NB . If you want to have predicates in scope, use `ParamEnv::new`,
1578
+ /// N.B . If you want to have predicates in scope, use `ParamEnv::new`,
1578
1579
/// or invoke `param_env.with_reveal_all()`.
1579
1580
pub fn reveal_all ( ) -> Self {
1580
1581
Self :: new ( List :: empty ( ) , Reveal :: All )
@@ -1979,14 +1980,14 @@ impl ReprOptions {
1979
1980
self . int . unwrap_or ( attr:: SignedInt ( ast:: IntTy :: Isize ) )
1980
1981
}
1981
1982
1982
- /// Returns true if this `#[repr()]` should inhabit "smart enum
1983
+ /// Returns ` true` if this `#[repr()]` should inhabit "smart enum
1983
1984
/// layout" optimizations, such as representing `Foo<&T>` as a
1984
1985
/// single pointer.
1985
1986
pub fn inhibit_enum_layout_opt ( & self ) -> bool {
1986
1987
self . c ( ) || self . int . is_some ( )
1987
1988
}
1988
1989
1989
- /// Returns true if this `#[repr()]` should inhibit struct field reordering
1990
+ /// Returns ` true` if this `#[repr()]` should inhibit struct field reordering
1990
1991
/// optimizations, such as with repr(C) or repr(packed(1)).
1991
1992
pub fn inhibit_struct_field_reordering_opt ( & self ) -> bool {
1992
1993
!( self . flags & ReprFlags :: IS_UNOPTIMISABLE ) . is_empty ( ) || ( self . pack == 1 )
@@ -2089,7 +2090,7 @@ impl<'a, 'gcx, 'tcx> AdtDef {
2089
2090
self . flags . intersects ( AdtFlags :: IS_FUNDAMENTAL )
2090
2091
}
2091
2092
2092
- /// Returns true if this is PhantomData<T>.
2093
+ /// Returns ` true` if this is PhantomData<T>.
2093
2094
#[ inline]
2094
2095
pub fn is_phantom_data ( & self ) -> bool {
2095
2096
self . flags . intersects ( AdtFlags :: IS_PHANTOM_DATA )
@@ -2105,7 +2106,7 @@ impl<'a, 'gcx, 'tcx> AdtDef {
2105
2106
self . flags . intersects ( AdtFlags :: IS_RC )
2106
2107
}
2107
2108
2108
- /// Returns true if this is Box<T>.
2109
+ /// Returns ` true` if this is Box<T>.
2109
2110
#[ inline]
2110
2111
pub fn is_box ( & self ) -> bool {
2111
2112
self . flags . intersects ( AdtFlags :: IS_BOX )
@@ -2422,7 +2423,7 @@ impl<'a, 'tcx> ClosureKind {
2422
2423
}
2423
2424
}
2424
2425
2425
- /// True if this a type that impls this closure kind
2426
+ /// Returns `true` if this a type that impls this closure kind
2426
2427
/// must also implement `other`.
2427
2428
pub fn extends ( self , other : ty:: ClosureKind ) -> bool {
2428
2429
match ( self , other) {
@@ -2678,7 +2679,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2678
2679
as Box < dyn Iterator < Item = AssociatedItem > + ' a >
2679
2680
}
2680
2681
2681
- /// Returns true if the impls are the same polarity and the trait either
2682
+ /// Returns ` true` if the impls are the same polarity and the trait either
2682
2683
/// has no items or is annotated #[marker] and prevents item overrides.
2683
2684
pub fn impls_are_allowed_to_overlap ( self , def_id1 : DefId , def_id2 : DefId ) -> bool {
2684
2685
if self . features ( ) . overlapping_marker_traits {
@@ -2802,7 +2803,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2802
2803
attr:: contains_name ( & self . get_attrs ( did) , attr)
2803
2804
}
2804
2805
2805
- /// Returns true if this is an `auto trait`.
2806
+ /// Returns ` true` if this is an `auto trait`.
2806
2807
pub fn trait_is_auto ( self , trait_def_id : DefId ) -> bool {
2807
2808
self . trait_def ( trait_def_id) . has_auto_impl
2808
2809
}
0 commit comments