@@ -1355,18 +1355,24 @@ mod super_keyword {}
1355
1355
//
1356
1356
/// A common interface for a group of types.
1357
1357
///
1358
- /// A `trait` is an interface that types can implement. It is said they
1359
- /// "implement" the trait or "conform" to the trait.
1358
+ /// A `trait` is like an interface that data types can implement. When a type
1359
+ /// implements a trait it can be treated abstractly as that trait using generics
1360
+ /// or trait objects.
1360
1361
///
1361
- /// This interface is made up of three varieties of items:
1362
+ /// Traits can be made up of three varieties of associated items:
1362
1363
///
1363
- /// - functions
1364
+ /// - functions and methods
1364
1365
/// - types
1365
1366
/// - constants
1366
1367
///
1367
1368
/// Traits may also contain additional type parameters. Those type parameters
1368
1369
/// or the trait itself can be constrained by other traits.
1369
1370
///
1371
+ /// Traits can serve as markers or carry other logical semantics that
1372
+ /// aren't expressed through their items. When a type implements that
1373
+ /// trait it is promising to uphold its contract. [`Send`] and [`Sync`] are two
1374
+ /// such marker traits present in the standard library.
1375
+ ///
1370
1376
/// See the [Reference][Ref-Traits] for a lot more information on traits.
1371
1377
///
1372
1378
/// # Examples
@@ -1525,6 +1531,8 @@ mod super_keyword {}
1525
1531
/// [`for`]: keyword.for.html
1526
1532
/// [`impl`]: keyword.impl.html
1527
1533
/// [`unsafe`]: keyword.unsafe.html
1534
+ /// [`Send`]: marker/trait.Send.html
1535
+ /// [`Sync`]: marker/trait.Sync.html
1528
1536
/// [Ref-Traits]: ../reference/items/traits.html
1529
1537
/// [Ref-Trait-Objects]: ../reference/types/trait-object.html
1530
1538
mod trait_keyword { }
0 commit comments