rust/src/doc
Alex Crichton 3b13b9c2b4 rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops
Reject specialized Drop impls.

See Issue #8142 for discussion.

This makes it illegal for a Drop impl to be more specialized than the original item.

So for example, all of the following are now rejected (when they would have been blindly accepted before):

```rust
struct S<A> { ... };
impl Drop for S<i8> { ... } // error: specialized to concrete type

struct T<'a> { ... };
impl Drop for T<'static> { ... } // error: specialized to concrete region

struct U<A> { ... };
impl<A:Clone> Drop for U<A> { ... } // error: added extra type requirement

struct V<'a,'b>;
impl<'a,'b:a> Drop for V<'a,'b> { ... } // error: added extra region requirement
```

Due to examples like the above, this is a [breaking-change].

(The fix is to either remove the specialization from the `Drop` impl, or to transcribe the requirements into the struct/enum definition; examples of both are shown in the PR's fixed to `libstd`.)

----

This is likely to be the last thing blocking the removal of the `#[unsafe_destructor]` attribute.

Fix #8142
Fix #23584
2015-03-24 15:27:14 -07:00
..
style doc: Fix extraneous as_slice()'s in docstrings 2015-03-09 07:54:19 -07:00
trpl rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
complement-design-faq.md Add note about pre/post increment to the design FAQ. 2015-03-09 16:49:19 -04:00
complement-lang-faq.md
complement-project-faq.md
favicon.inc
footer.inc
full-toc.inc
grammar.md Strip trailing whitespace 2015-03-15 11:25:43 -07:00
guide-crates.md
guide-error-handling.md
guide-ffi.md
guide-macros.md
guide-ownership.md
guide-plugins.md
guide-pointers.md
guide-strings.md
guide-tasks.md Fix broken link in old rust guide 2015-03-04 23:18:24 +00:00
guide-testing.md
guide-unsafe.md
guide.md
index.md Fix "How to submit a bug report" link 2015-02-24 23:26:25 +01:00
intro.md Re-word explanation on closures in intro 2015-03-22 15:40:46 -04:00
not_found.md Strip all leading/trailing newlines 2015-03-15 09:08:21 -07:00
README.md
reference.md rollup merge of #23662: steveklabnik/gh23421 2015-03-24 14:50:48 -07:00
rust.css Enforce a white background for the docs 2015-02-23 18:04:51 -05:00
rust.md
rustdoc.md Move rustdoc.md into the book 2015-01-21 14:59:25 -05:00
tutorial.md
uptack.tex
version_info.html.template

Rust documentations

Dependencies

Pandoc, a universal document converter, is required to generate docs as HTML from Rust's source code.

Building

To generate all the docs, just run make docs from the root of the repository. This will convert the distributed Markdown docs to HTML and generate HTML doc for the 'std' and 'extra' libraries.

To generate HTML documentation from one source file/crate, do something like:

rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs

(This, of course, requires a working build of the rustdoc tool.)

Additional notes

To generate an HTML version of a doc from Markdown manually, you can do something like:

pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md

(reference.md being the Rust Reference Manual.)

The syntax for pandoc flavored markdown can be found at:

A nice quick reference (for non-pandoc markdown) is at: