Add more descriptive details
This commit is contained in:
parent
2da7f084fe
commit
bc4c3b6ff1
@ -12,6 +12,14 @@ use rustc::{declare_tool_lint, lint_array};
|
|||||||
/// `Drop::drop`, and that function is by fiat not callable in user code.
|
/// `Drop::drop`, and that function is by fiat not callable in user code.
|
||||||
/// So there is really no use case for using `Drop` in trait bounds.
|
/// So there is really no use case for using `Drop` in trait bounds.
|
||||||
///
|
///
|
||||||
|
/// The most likely use case of a drop bound is to distinguish between types
|
||||||
|
/// that have destructors and types that don't. Combined with specialization,
|
||||||
|
/// a naive coder would write an implementation that assumed a type could be
|
||||||
|
/// trivially dropped, then write a specialization for `T: Drop` that actually
|
||||||
|
/// calls the destructor. Except that doing so is not correct; String, for
|
||||||
|
/// example, doesn't actually implement Drop, but because String contains a
|
||||||
|
/// Vec, assuming it can be trivially dropped will leak memory.
|
||||||
|
///
|
||||||
/// **Known problems:** None.
|
/// **Known problems:** None.
|
||||||
///
|
///
|
||||||
/// **Example:**
|
/// **Example:**
|
||||||
|
Loading…
Reference in New Issue
Block a user