Fix compiler docs
This commit is contained in:
parent
3416fa1882
commit
adc24d1b5e
10 changed files with 32 additions and 16 deletions
|
@ -66,13 +66,13 @@ impl<'tcx> AutoTraitFinder<'tcx> {
|
|||
/// struct Foo<T> { data: Box<T> }
|
||||
/// ```
|
||||
///
|
||||
/// then this might return that Foo<T>: Send if T: Send (encoded in the AutoTraitResult type).
|
||||
/// The analysis attempts to account for custom impls as well as other complex cases. This
|
||||
/// result is intended for use by rustdoc and other such consumers.
|
||||
/// then this might return that `Foo<T>: Send` if `T: Send` (encoded in the AutoTraitResult
|
||||
/// type). The analysis attempts to account for custom impls as well as other complex cases.
|
||||
/// This result is intended for use by rustdoc and other such consumers.
|
||||
///
|
||||
/// (Note that due to the coinductive nature of Send, the full and correct result is actually
|
||||
/// quite simple to generate. That is, when a type has no custom impl, it is Send iff its field
|
||||
/// types are all Send. So, in our example, we might have that Foo<T>: Send if Box<T>: Send.
|
||||
/// types are all Send. So, in our example, we might have that `Foo<T>: Send` if `Box<T>: Send`.
|
||||
/// But this is often not the best way to present to the user.)
|
||||
///
|
||||
/// Warning: The API should be considered highly unstable, and it may be refactored or removed
|
||||
|
|
|
@ -62,7 +62,8 @@ enum ProjectionCandidate<'tcx> {
|
|||
/// From a where-clause in the env or object type
|
||||
ParamEnv(ty::PolyProjectionPredicate<'tcx>),
|
||||
|
||||
/// From the definition of `Trait` when you have something like <<A as Trait>::B as Trait2>::C
|
||||
/// From the definition of `Trait` when you have something like
|
||||
/// `<<A as Trait>::B as Trait2>::C`.
|
||||
TraitDef(ty::PolyProjectionPredicate<'tcx>),
|
||||
|
||||
/// Bounds specified on an object type
|
||||
|
@ -1367,7 +1368,7 @@ fn assemble_candidates_from_param_env<'cx, 'tcx>(
|
|||
);
|
||||
}
|
||||
|
||||
/// In the case of a nested projection like <<A as Foo>::FooT as Bar>::BarT, we may find
|
||||
/// In the case of a nested projection like `<<A as Foo>::FooT as Bar>::BarT`, we may find
|
||||
/// that the definition of `Foo` has some clues:
|
||||
///
|
||||
/// ```ignore (illustrative)
|
||||
|
|
|
@ -826,7 +826,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
/// must be met of course). One obvious case this comes up is
|
||||
/// marker traits like `Send`. Think of a linked list:
|
||||
///
|
||||
/// struct List<T> { data: T, next: Option<Box<List<T>>> }
|
||||
/// struct List<T> { data: T, next: Option<Box<List<T>>> }
|
||||
///
|
||||
/// `Box<List<T>>` will be `Send` if `T` is `Send` and
|
||||
/// `Option<Box<List<T>>>` is `Send`, and in turn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue