rust/src/doc/trpl
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
..
advanced-macros.md Add AST to the glossary 2015-03-20 10:55:51 -04:00
advanced.md Fix typo in documentation. 2015-01-09 22:35:18 -08:00
arrays-vectors-and-slices.md Strip trailing whitespace 2015-03-15 11:25:43 -07:00
associated-types.md Add basic information about associated types 2015-03-24 12:10:01 -04:00
basic.md Fix dead links in the guide and reorganize 2015-01-08 10:27:03 -08:00
closures.md Concurrency is now in the "Concurrency" chapter 2015-03-14 14:05:59 -06:00
comments.md Example -> Examples 2015-03-11 21:11:40 -04:00
compound-data-types.md guide: Improvements to language covering enums 2015-03-21 05:32:26 +07:00
conclusion.md Update Conclusion of The Rust Programming Language 2015-01-09 19:48:27 +01:00
concurrency.md rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
crates-and-modules.md rollup merge of #23401: tshepang/crates-and-modules-doc-nits 2015-03-23 15:08:01 -07:00
documentation.md Test fixes and rebase conflicts, round 2 2015-03-23 17:10:19 -07:00
error-handling.md Mention try macro in error chapter 2015-02-24 12:31:46 -05:00
ffi.md Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
functions.md Rename should_fail to should_panic in docs 2015-03-19 08:24:38 +05:30
generics.md Small fix in TRPL 3.9 2015-01-20 11:36:29 -05:00
glossary.md Add AST to the glossary 2015-03-20 10:55:51 -04:00
hello-cargo.md Fixed several grammar errors and broke up very long line. 2015-03-12 17:00:35 -04:00
hello-world.md book: link to a file with configs links 2015-02-15 14:38:47 +03:00
if.md Add documentation for else if to trpl 2015-02-18 16:26:39 -08:00
installing-rust.md Add note about local documentation installation 2015-03-11 13:45:55 -04:00
intermediate.md Fix dead links in the guide and reorganize 2015-01-08 10:27:03 -08:00
iterators.md Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
looping.md Fix type inference problems in tests and docs 2015-01-21 11:16:00 -08:00
macros.md Rollup merge of #22635 - kmcallister:macros-chapter, r=steveklabnik 2015-02-25 10:27:03 +05:30
match.md Tiny typo changes (per discussion in pull request #22027) 2015-02-16 23:13:58 +01:00
method-syntax.md Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
more-strings.md rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
ownership.md Improve the wording of the example section description on the ownership page 2015-03-23 21:19:54 -04:00
patterns.md Replace all uses of &foo[] with &foo[..] en masse. 2015-02-18 17:36:03 -05:00
plugins.md Fix #23166. Get the Compiler Plugins example compiling again. 2015-03-07 22:58:28 -08:00
pointers.md Don't conflate regions and affine types 2015-03-23 14:47:14 -04:00
README.md Link to sections in the book's README.md 2015-01-12 10:59:21 -05:00
standard-input.md rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
static-and-dynamic-dispatch.md Strip trailing whitespace 2015-03-15 11:25:43 -07:00
strings.md book: Minor clarifications about strings 2015-02-19 18:39:38 -08:00
SUMMARY.md rollup merge of #23573: steveklabnik/doc_associated_types 2015-03-24 14:50:44 -07:00
testing.md Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
traits.md Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
unsafe.md Reject specialized Drop impls. 2015-03-24 22:27:23 +01:00
variable-bindings.md Added explanation to trpl of integer types. 2015-02-15 13:51:36 -05:00

% The Rust Programming Language

Welcome! This book will teach you about the Rust Programming Language. Rust is a modern systems programming language focusing on safety and speed. It accomplishes these goals by being memory safe without using garbage collection.

"The Rust Programming Language" is split into three sections, which you can navigate through the menu on the left.

Basics

This section is a linear introduction to the basic syntax and semantics of Rust. It has individual sections on each part of Rust's syntax, and culminates in a small project: a guessing game.

After reading "Basics," you will have a good foundation to learn more about Rust, and can write very simple programs.

Intermediate

This section contains individual chapters, which are self-contained. They focus on specific topics, and can be read in any order.

After reading "Intermediate," you will have a solid understanding of Rust, and will be able to understand most Rust code and write more complex programs.

Advanced

In a similar fashion to "Intermediate," this section is full of individual, deep-dive chapters, which stand alone and can be read in any order. These chapters focus on the most complex features, as well as some things that are only available in upcoming versions of Rust.

After reading "Advanced," you'll be a Rust expert!