]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #24665: sw17ch/document-complete-slice-syntax
Alex Crichton [Tue, 21 Apr 2015 22:23:15 +0000 (15:23 -0700)]
rollup merge of #24665: sw17ch/document-complete-slice-syntax

The documentation doesn't appear to describe the `&foo[..]` syntax.

I tried looking in `primitive-types.html#slices` and `std/primitive.slice.html`.

There's an example of partially slicing an array in trpl and a mention of `&foo[..]` in [the standard library documentation](https://doc.rust-lang.org/std/primitive.slice.html), but neither place, from what I can see, actually describes the behavior of `&foo[..]`.

+r? @steveklabnik

9 years agorollup merge of #24663: steveklabnik/gh24639
Alex Crichton [Tue, 21 Apr 2015 22:23:14 +0000 (15:23 -0700)]
rollup merge of #24663: steveklabnik/gh24639

Fixes #24639

9 years agorollup merge of #24661: SimonSapin/fmt-write-char
Alex Crichton [Tue, 21 Apr 2015 22:23:13 +0000 (15:23 -0700)]
rollup merge of #24661: SimonSapin/fmt-write-char

as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md).

Note that this brand new method is marked as **stable**. I judged this safe enough: it’s simple enough that it’s very unlikely to change. Still, I can mark it unstable instead if you prefer.

r? @alexcrichton

9 years agorollup merge of #24654: mdinger/patch-2
Alex Crichton [Tue, 21 Apr 2015 22:23:12 +0000 (15:23 -0700)]
rollup merge of #24654: mdinger/patch-2

This just fixes some comments made on https://github.com/rust-lang/rust/pull/24632 . The second I think is better unless @steveklabnik actually meant something else.

9 years agorollup merge of #24651: tamird/old-references
Alex Crichton [Tue, 21 Apr 2015 22:23:11 +0000 (15:23 -0700)]
rollup merge of #24651: tamird/old-references

r? @alexcrichton

9 years agorollup merge of #24640: steveklabnik/new_unsafe_guide
Alex Crichton [Tue, 21 Apr 2015 22:23:10 +0000 (15:23 -0700)]
rollup merge of #24640: steveklabnik/new_unsafe_guide

https://github.com/rust-lang/rust/pull/24631 is related, as it will delete this from the TOC, but I want to keep it here.

9 years agorollup merge of #24635: tamird/llvm-3.5
Alex Crichton [Tue, 21 Apr 2015 22:23:10 +0000 (15:23 -0700)]
rollup merge of #24635: tamird/llvm-3.5

r? @alexcrichton

9 years agorollup merge of #24611: doomsplayer/doomsplayer-patch-1
Alex Crichton [Tue, 21 Apr 2015 22:23:09 +0000 (15:23 -0700)]
rollup merge of #24611: doomsplayer/doomsplayer-patch-1

as dependency for #24594

9 years agorollup merge of #24563: kwantam/rfc_1054
Alex Crichton [Tue, 21 Apr 2015 22:23:08 +0000 (15:23 -0700)]
rollup merge of #24563: kwantam/rfc_1054

For now, words() is left in (but deprecated), and Words is a type alias for
struct SplitWhitespace.

Also cleaned up references to str.words() throughout codebase.

Closes #15628

9 years agorollup merge of #24487: erickt/syntax
Alex Crichton [Tue, 21 Apr 2015 22:23:07 +0000 (15:23 -0700)]
rollup merge of #24487: erickt/syntax

This removes the usage of `#[feature(into_cow, slice_patterns, box_syntax, box_patterns, quote, unsafe_destructor)]` from being used in libsyntax. My main desire for this is that it brings me one step closer to letting [syntex](https://github.com/erickt/rust-syntex) compile with stable rust. Hopefully this doesn't inconvenience rust development.

9 years agorollup merge of #24439: alexcrichton/fix-archive-assembler
Alex Crichton [Tue, 21 Apr 2015 22:23:06 +0000 (15:23 -0700)]
rollup merge of #24439: alexcrichton/fix-archive-assembler

When linking an archive statically to an rlib, the compiler will extract all
contents of the archive and add them all to the rlib being generated. The
current method of extraction is to run `ar x`, dumping all files into a
temporary directory. Object archives, however, are allowed to have multiple
entries with the same file name, so there is no method for them to extract their
contents into a directory in a lossless fashion.

This commit adds iterator support to the `ArchiveRO` structure which hooks into
LLVM's support for reading object archives. This iterator is then used to
inspect each object in turn and extract it to a unique location for later
assembly.

9 years agorollup merge of #24222: lambda/rename-soft-link-to-symlink
Alex Crichton [Tue, 21 Apr 2015 22:23:06 +0000 (15:23 -0700)]
rollup merge of #24222: lambda/rename-soft-link-to-symlink

Implement [RFC #1048][rfc].

On Windows, when you create a symbolic link you must specify whether it
points to a directory or a file, even if it is created dangling, while
on Unix, the same symbolic link could point to a directory, a file, or
nothing at all.  Furthermore, on Windows special privilege is necessary
to use a symbolic link, while on Unix, you can generally create a
symbolic link in any directory you have write privileges to.

This means that it is unlikely to be able to use symbolic links purely
portably; anyone who uses them will need to think about the cross
platform implications.  This means that using platform-specific APIs
will make it easier to see where code will need to differ between the
platforms, rather than trying to provide some kind of compatibility
wrapper.

Furthermore, `soft_link` has no precedence in any other API, so to avoid
confusion, move back to the more standard `symlink` terminology.

Create a `std::os::unix::symlink` for the Unix version that is
destination type agnostic, as well as `std::os::windows::{symlink_file,
symlink_dir}` for Windows.

Because this is a stable API, leave a compatibility wrapper in
`std::fs::soft_link`, which calls `symlink` on Unix and `symlink_file`
on Windows, preserving the existing behavior of `soft_link`.

[rfc]: https://github.com/rust-lang/rfcs/pull/1048

9 years agorollup merge of #24162: pnkfelix/fsk-detect-duplicate-loop-labels
Alex Crichton [Tue, 21 Apr 2015 22:23:05 +0000 (15:23 -0700)]
rollup merge of #24162: pnkfelix/fsk-detect-duplicate-loop-labels

Check for duplicate loop labels in function bodies.

See also: http://internals.rust-lang.org/t/psa-rejecting-duplicate-loop-labels/1833

The change, which we are putting in as future-proofing in preparation for future potential additions to the language (namely labeling arbitrary blocks and using those labels in borrow expressions), means that code like this will start emitting warnings:

```rust
fn main() {
    { 'a: loop { break; } }
    { 'a: loop { break; } }
}
```

To make the above code compile without warnings, write this instead:

```rust
fn main() {
    { 'a: loop { break; } }
    { 'b: loop { break; } }
}
```

Since this change is only introducing a new warnings, this change is non-breaking.

Fix #21633

9 years agoDocument functional update syntax
Steve Klabnik [Tue, 21 Apr 2015 15:18:33 +0000 (11:18 -0400)]
Document functional update syntax

Fixes #24639

9 years agoimplement rfc 1054: split_whitespace() fn, deprecate words()
kwantam [Sat, 18 Apr 2015 17:49:51 +0000 (13:49 -0400)]
implement rfc 1054: split_whitespace() fn, deprecate words()

For now, words() is left in (but deprecated), and Words is a type alias for
struct SplitWhitespace.

Also cleaned up references to s.words() throughout codebase.

Closes #15628

9 years agounstabilize Words struct
kwantam [Tue, 21 Apr 2015 19:24:50 +0000 (15:24 -0400)]
unstabilize Words struct

Words struct was stabilied by mistake. Unstabilize.

9 years agorustc: Handle duplicate names merging archives
Alex Crichton [Tue, 14 Apr 2015 23:28:50 +0000 (16:28 -0700)]
rustc: Handle duplicate names merging archives

When linking an archive statically to an rlib, the compiler will extract all
contents of the archive and add them all to the rlib being generated. The
current method of extraction is to run `ar x`, dumping all files into a
temporary directory. Object archives, however, are allowed to have multiple
entries with the same file name, so there is no method for them to extract their
contents into a directory in a lossless fashion.

This commit adds iterator support to the `ArchiveRO` structure which hooks into
LLVM's support for reading object archives. This iterator is then used to
inspect each object in turn and extract it to a unique location for later
assembly.

9 years agosyntax: Copy unstable str::char_at into libsyntax
Erick Tryzelaar [Tue, 21 Apr 2015 17:19:53 +0000 (10:19 -0700)]
syntax: Copy unstable str::char_at into libsyntax

9 years agosyntax: Change ExpnId::{from,to}_llvm_cookie to {from,to}_u32
Erick Tryzelaar [Tue, 21 Apr 2015 00:51:10 +0000 (17:51 -0700)]
syntax: Change ExpnId::{from,to}_llvm_cookie to {from,to}_u32

9 years agosyntax: Remove #[feature(path_ext)]
Erick Tryzelaar [Sun, 19 Apr 2015 22:41:50 +0000 (15:41 -0700)]
syntax: Remove #[feature(path_ext)]

Replace Path::exists with stable metadata call.

9 years agosyntax: replace Vec::push_all with stable Vec::extend
Erick Tryzelaar [Fri, 17 Apr 2015 04:57:38 +0000 (21:57 -0700)]
syntax: replace Vec::push_all with stable Vec::extend

9 years agosyntax: Replace Vec::map_in_place with stable mut iterator
Erick Tryzelaar [Fri, 17 Apr 2015 04:38:24 +0000 (21:38 -0700)]
syntax: Replace Vec::map_in_place with stable mut iterator

9 years agosyntax: Replace [].tail with the stable [1..] syntax
Erick Tryzelaar [Fri, 17 Apr 2015 04:21:26 +0000 (21:21 -0700)]
syntax: Replace [].tail with the stable [1..] syntax

9 years agosyntax: Replace String::from_str with the stable String::from
Erick Tryzelaar [Fri, 17 Apr 2015 04:19:50 +0000 (21:19 -0700)]
syntax: Replace String::from_str with the stable String::from

9 years agosyntax: remove #[feature(quote, unsafe_destructor)]
Erick Tryzelaar [Fri, 17 Apr 2015 03:38:00 +0000 (20:38 -0700)]
syntax: remove #[feature(quote, unsafe_destructor)]

9 years agosyntax: Don't use unstable fn to convert single element to a slice
Erick Tryzelaar [Fri, 17 Apr 2015 02:56:37 +0000 (19:56 -0700)]
syntax: Don't use unstable fn to convert single element to a slice

9 years agosyntax: Remove use of TraitObject in pretty printer
Erick Tryzelaar [Fri, 17 Apr 2015 02:54:05 +0000 (19:54 -0700)]
syntax: Remove use of TraitObject in pretty printer

9 years agosyntax: remove uses of `.into_cow()`
Erick Tryzelaar [Thu, 16 Apr 2015 05:15:50 +0000 (22:15 -0700)]
syntax: remove uses of `.into_cow()`

9 years agosyntax: Remove uses of #[feature(slice_patterns)]
Erick Tryzelaar [Thu, 16 Apr 2015 05:12:12 +0000 (22:12 -0700)]
syntax: Remove uses of #[feature(slice_patterns)]

9 years agosyntax: remove #![feature(box_syntax, box_patterns)]
Erick Tryzelaar [Thu, 16 Apr 2015 03:56:16 +0000 (20:56 -0700)]
syntax: remove #![feature(box_syntax, box_patterns)]

9 years agoAdd an example of completely slicing an object.
John Van Enk [Tue, 21 Apr 2015 16:21:52 +0000 (09:21 -0700)]
Add an example of completely slicing an object.

9 years agoPick a feature name for write_char
Simon Sapin [Tue, 21 Apr 2015 16:16:08 +0000 (18:16 +0200)]
Pick a feature name for write_char

9 years agoDeprecate std::fs::soft_link in favor of platform-specific versions
Brian Campbell [Thu, 9 Apr 2015 07:22:44 +0000 (03:22 -0400)]
Deprecate std::fs::soft_link in favor of platform-specific versions

On Windows, when you create a symbolic link you must specify whether it
points to a directory or a file, even if it is created dangling, while
on Unix, the same symbolic link could point to a directory, a file, or
nothing at all.  Furthermore, on Windows special privilege is necessary
to use a symbolic link, while on Unix, you can generally create a
symbolic link in any directory you have write privileges to.

This means that it is unlikely to be able to use symbolic links purely
portably; anyone who uses them will need to think about the cross
platform implications.  This means that using platform-specific APIs
will make it easier to see where code will need to differ between the
platforms, rather than trying to provide some kind of compatibility
wrapper.

Furthermore, `soft_link` has no precedence in any other API, so to avoid
confusion, move back to the more standard `symlink` terminology.

Create a `std::os::unix::symlink` for the Unix version that is
destination type agnostic, as well as `std::os::windows::{symlink_file,
symlink_dir}` for Windows.

Because this is a stable API, leave a compatibility wrapper in
`std::fs::soft_link`, which calls `symlink` on Unix and `symlink_file`
on Windows, preserving the existing behavior of `soft_link`.

9 years agoadd notes clarifying introduction of warnings for a pair of run-pass tests.
Felix S. Klock II [Tue, 21 Apr 2015 07:58:06 +0000 (09:58 +0200)]
add notes clarifying introduction of warnings for a pair of run-pass tests.

9 years agoTests for shadowing between lifetimes and loop labels within function bodies.
Felix S. Klock II [Wed, 8 Apr 2015 16:37:47 +0000 (18:37 +0200)]
Tests for shadowing between lifetimes and loop labels within function bodies.

9 years agoCheck for shadowing between lifetimes and loop labels in function bodies.
Felix S. Klock II [Fri, 3 Apr 2015 00:51:38 +0000 (02:51 +0200)]
Check for shadowing between lifetimes and loop labels in function bodies.

Note: this Warns rather than error on shadowing problems involving labels.
We took this more conservative option mostly due to issues with
hygiene being broken for labels and/or lifetimes.

Add FIXME regarding non-hygienic comparison.

9 years agowrite_char is unlikely to make it for 1.0, it’ll be 1.1
Simon Sapin [Tue, 21 Apr 2015 16:06:00 +0000 (18:06 +0200)]
write_char is unlikely to make it for 1.0, it’ll be 1.1

9 years agoRemove references to `old_{path,io}`
Tamir Duberstein [Tue, 21 Apr 2015 02:01:20 +0000 (19:01 -0700)]
Remove references to `old_{path,io}`

9 years agoRemove dead test
Tamir Duberstein [Tue, 21 Apr 2015 01:52:28 +0000 (18:52 -0700)]
Remove dead test

This was moved to https://github.com/rust-lang/term/issues/12

9 years agoRemove unused files
Tamir Duberstein [Tue, 21 Apr 2015 01:50:20 +0000 (18:50 -0700)]
Remove unused files

Looks like these were missed in bf4e77d.

9 years agoadd TCP_* consts for linux
Young Wu [Tue, 21 Apr 2015 14:35:02 +0000 (22:35 +0800)]
add TCP_* consts for linux

9 years agoAuto merge of #24620 - pczarn:model-lexer-issues, r=cmr
bors [Tue, 21 Apr 2015 14:37:53 +0000 (14:37 +0000)]
Auto merge of #24620 - pczarn:model-lexer-issues, r=cmr

Fixes #15679
Fixes #15878
Fixes #15882
Closes #15883

9 years agoLLVM < 3.5 is unsupported since bb18a3c
Tamir Duberstein [Mon, 20 Apr 2015 17:19:02 +0000 (10:19 -0700)]
LLVM < 3.5 is unsupported since bb18a3c

9 years agoAdd a `write_char` method to `std::fmt::Write`
Simon Sapin [Tue, 21 Apr 2015 12:51:28 +0000 (14:51 +0200)]
Add a `write_char` method to `std::fmt::Write`

as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md).

9 years agoRefocus unsafe code chapter on unsafe itself.
Steve Klabnik [Mon, 20 Apr 2015 20:37:01 +0000 (16:37 -0400)]
Refocus unsafe code chapter on unsafe itself.

9 years agoAuto merge of #24598 - lfairy:impl-debug-for-file, r=alexcrichton
bors [Tue, 21 Apr 2015 11:46:15 +0000 (11:46 +0000)]
Auto merge of #24598 - lfairy:impl-debug-for-file, r=alexcrichton

This patch adds a `Debug` impl for `std::fs::File`.

On all platforms (Unix and Windows) it shows the file descriptor.

On Linux, it displays the path and access mode as well.

Ideally we should show the path/mode for all platforms, not just Linux,
but this will do for now.

cc #24570

9 years agoModel lexer: Fix remaining issues
Piotr Czarnecki [Tue, 21 Apr 2015 10:02:12 +0000 (12:02 +0200)]
Model lexer: Fix remaining issues

9 years agoAuto merge of #24646 - brson:stab, r=alexcrichton
bors [Tue, 21 Apr 2015 07:24:09 +0000 (07:24 +0000)]
Auto merge of #24646 - brson:stab, r=alexcrichton

9 years agoImplement Debug for File
Chris Wong [Sun, 19 Apr 2015 09:27:19 +0000 (21:27 +1200)]
Implement Debug for File

This patch adds a `Debug` impl for `std::fs::File`.

On all platforms (Unix and Windows) it shows the file descriptor.

On Linux, it displays the path and access mode as well.

Ideally we should show the path/mode for all platforms, not just Linux,
but this will do for now.

cc #24570

9 years agoFix typos
mdinger [Tue, 21 Apr 2015 05:05:26 +0000 (01:05 -0400)]
Fix typos

9 years agoAuto merge of #24648 - steveklabnik:rollup, r=steveklabnik
bors [Tue, 21 Apr 2015 01:18:15 +0000 (01:18 +0000)]
Auto merge of #24648 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #24514, #24516, #24571, #24577, #24625, #24627, #24628, #24629, #24630, #24631, #24632, #24642, #24643, #24647
- Failed merges: #24640

9 years agoRefocus unsafe code chapter on unsafe itself.
Steve Klabnik [Mon, 20 Apr 2015 20:37:01 +0000 (16:37 -0400)]
Refocus unsafe code chapter on unsafe itself.

9 years agoRollup merge of #24647 - mbrubeck:doc-edit, r=steveklabnik
Steve Klabnik [Tue, 21 Apr 2015 01:15:55 +0000 (21:15 -0400)]
Rollup merge of #24647 - mbrubeck:doc-edit, r=steveklabnik

None

9 years agoRollup merge of #24643 - steveklabnik:doc_if_let, r=jakub-
Steve Klabnik [Tue, 21 Apr 2015 01:15:54 +0000 (21:15 -0400)]
Rollup merge of #24643 - steveklabnik:doc_if_let, r=jakub-

and while let

9 years agoRollup merge of #24642 - tshepang:why-be-negative, r=huonw
Steve Klabnik [Tue, 21 Apr 2015 01:15:54 +0000 (21:15 -0400)]
Rollup merge of #24642 - tshepang:why-be-negative, r=huonw

9 years agoRollup merge of #24632 - steveklabnik:casting_guide, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:54 +0000 (21:15 -0400)]
Rollup merge of #24632 - steveklabnik:casting_guide, r=alexcrichton

Due to documenting `transmute`, addresses part of #12905

9 years agoRollup merge of #24631 - steveklabnik:unsafe_guide, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:54 +0000 (21:15 -0400)]
Rollup merge of #24631 - steveklabnik:unsafe_guide, r=alexcrichton

Many unsafe features are now in the unstable section, so this section is
really just about raw pointers now. That also makes sense for its place
in the TOC.

This addresses part of #12905.

9 years agoRollup merge of #24630 - steveklabnik:quickfix, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:53 +0000 (21:15 -0400)]
Rollup merge of #24630 - steveklabnik:quickfix, r=alexcrichton

9 years agoRollup merge of #24629 - steveklabnik:gh24511, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:53 +0000 (21:15 -0400)]
Rollup merge of #24629 - steveklabnik:gh24511, r=alexcrichton

Without the `box` keyword, one of these two reasons is not correct, so
let's just eliminate this section and elaborate on the reason for the
legit use case inline.

Fixes #24511

9 years agoRollup merge of #24628 - steveklabnik:gh24173, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:53 +0000 (21:15 -0400)]
Rollup merge of #24628 - steveklabnik:gh24173, r=alexcrichton

Fixes #24173

These docs could all use examples, so for now, let's just remove the bad one, and when I go over this whole module I'll put in better ones.

9 years agoRollup merge of #24627 - steveklabnik:gh24008, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:53 +0000 (21:15 -0400)]
Rollup merge of #24627 - steveklabnik:gh24008, r=alexcrichton

Fixes #24008.

9 years agoRollup merge of #24625 - frewsxcv:patch-16, r=steveklabnik
Steve Klabnik [Tue, 21 Apr 2015 01:15:53 +0000 (21:15 -0400)]
Rollup merge of #24625 - frewsxcv:patch-16, r=steveklabnik

As far as I can tell, this conversion to integer to floating point does not need to happen and is beside the point

9 years agoRollup merge of #24577 - steveklabnik:gh24573, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:52 +0000 (21:15 -0400)]
Rollup merge of #24577 - steveklabnik:gh24573, r=alexcrichton

Fixes #24573

9 years agoRollup merge of #24571 - steveklabnik:editing, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:52 +0000 (21:15 -0400)]
Rollup merge of #24571 - steveklabnik:editing, r=alexcrichton

A bunch of chapters, fixes an issue or two as well.

r? @alexcrichton

9 years agoRollup merge of #24516 - steveklabnik:gh22621, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:52 +0000 (21:15 -0400)]
Rollup merge of #24516 - steveklabnik:gh22621, r=alexcrichton

Fixes #22621

9 years agoRollup merge of #24514 - krzysz00:no-warnings-in-liballoc, r=alexcrichton
Steve Klabnik [Tue, 21 Apr 2015 01:15:52 +0000 (21:15 -0400)]
Rollup merge of #24514 - krzysz00:no-warnings-in-liballoc, r=alexcrichton

When `liballoc` is compiled with `--cfg feature=\"external_features\"`, several `improper_ctypes` warnings are generated. Since these warnings are harmless, I have added a directive to suppress them.

9 years agoUpdate reference to old_io in fmt docs
Matt Brubeck [Tue, 21 Apr 2015 00:51:56 +0000 (17:51 -0700)]
Update reference to old_io in fmt docs

9 years agoMake stability attributes an error. #22830
Brian Anderson [Tue, 21 Apr 2015 00:00:35 +0000 (17:00 -0700)]
Make stability attributes an error. #22830

9 years agoTRPL: if let
Steve Klabnik [Mon, 20 Apr 2015 21:39:38 +0000 (17:39 -0400)]
TRPL: if let

and while let

9 years agolint: explain the non-obvious need for a negative test
Tshepang Lekhonkhobe [Mon, 20 Apr 2015 20:55:36 +0000 (22:55 +0200)]
lint: explain the non-obvious need for a negative test

9 years agoAuto merge of #24606 - bombless:doc-result, r=alexcrichton
bors [Mon, 20 Apr 2015 18:43:34 +0000 (18:43 +0000)]
Auto merge of #24606 - bombless:doc-result, r=alexcrichton

Get rid of the confusion that what does "custom" mean in this context.

9 years agoAdd common macros to TRPL
Steve Klabnik [Fri, 17 Apr 2015 03:46:47 +0000 (23:46 -0400)]
Add common macros to TRPL

Fixes #22621

9 years agoTRPL: unsafe -> raw pointers
Steve Klabnik [Mon, 20 Apr 2015 14:41:49 +0000 (10:41 -0400)]
TRPL: unsafe -> raw pointers

Many unsafe features are now in the unstable section, so this section is
really just about raw pointers now. That also makes sense for its place
in the TOC.

This addresses part of #12905.

9 years agoRemove feature gated examples from the reference.
Steve Klabnik [Mon, 20 Apr 2015 17:33:13 +0000 (13:33 -0400)]
Remove feature gated examples from the reference.

The slice patterns example was nice, so let's put it with the other
slice pattern feature gate documentation.

Fixes #24573

9 years agoTRPL: casting
Steve Klabnik [Mon, 20 Apr 2015 15:55:21 +0000 (11:55 -0400)]
TRPL: casting

Due to documenting `transmute`, addresses part of #12905

9 years agoAuto merge of #24597 - bombless:doc, r=steveklabnik
bors [Mon, 20 Apr 2015 15:23:52 +0000 (15:23 +0000)]
Auto merge of #24597 - bombless:doc, r=steveklabnik

This patch will make links like http://doc.rust-lang.org/std/collections/struct.BTreeMap.html#examples actually playable without modifying the code.

It seems that this patch cannot be tested on test/rustdoc.

And I suggest adding a `&run=1` to those links.

Thank @jorisgio for noticing me this!

r? @steveklabnik

Closes https://github.com/rust-lang/rust/issues/24332

9 years agoFix small typo in TRPL intro
Steve Klabnik [Mon, 20 Apr 2015 14:42:17 +0000 (10:42 -0400)]
Fix small typo in TRPL intro

9 years agoClean up Box documentation.
Steve Klabnik [Mon, 20 Apr 2015 14:05:57 +0000 (10:05 -0400)]
Clean up Box documentation.

Without the `box` keyword, one of these two reasons is not correct, so
let's just eliminate this section and elaborate on the reason for the
legit use case inline.

Fixes #24511

9 years agoremove bad example from PartialEq docs
Steve Klabnik [Mon, 20 Apr 2015 13:59:58 +0000 (09:59 -0400)]
remove bad example from PartialEq docs

Fixes #24173

9 years agoMake iterator struct docs more consistent.
Steve Klabnik [Mon, 20 Apr 2015 13:55:07 +0000 (09:55 -0400)]
Make iterator struct docs more consistent.

Fixes #24008.

9 years agoTRPL edits: generics
Steve Klabnik [Sat, 18 Apr 2015 21:37:49 +0000 (17:37 -0400)]
TRPL edits: generics

9 years agoRemove inverse example from generics part of TRPL
Steve Klabnik [Sat, 18 Apr 2015 21:23:00 +0000 (17:23 -0400)]
Remove inverse example from generics part of TRPL

Fixes #24325.

9 years agoTRPL edits: traits
Steve Klabnik [Sat, 18 Apr 2015 21:21:26 +0000 (17:21 -0400)]
TRPL edits: traits

Let's talk about generics first, since we use traits to bound them
in funtions.

Partially addresses #24325

Fixes #24271

9 years agomove Deref coercions to syntax and semantics
Steve Klabnik [Sat, 18 Apr 2015 20:56:49 +0000 (16:56 -0400)]
move Deref coercions to syntax and semantics

It's a language feature, so it belongs here.

9 years agoTRPL copyedits: strings
Steve Klabnik [Sat, 18 Apr 2015 20:54:27 +0000 (16:54 -0400)]
TRPL copyedits: strings

9 years agoTRPL editing: vectors
Steve Klabnik [Sat, 18 Apr 2015 20:20:56 +0000 (16:20 -0400)]
TRPL editing: vectors

9 years agoMove drop back in TRPL TOC
Steve Klabnik [Sat, 18 Apr 2015 20:02:45 +0000 (16:02 -0400)]
Move drop back in TRPL TOC

It's a trait implementation, so we need traits first.

9 years agoTRPL edits: method syntax
Steve Klabnik [Sat, 18 Apr 2015 20:01:28 +0000 (16:01 -0400)]
TRPL edits: method syntax

9 years agoTRPL editing: structs
Steve Klabnik [Sat, 18 Apr 2015 19:54:33 +0000 (15:54 -0400)]
TRPL editing: structs

9 years agoTRPL editing: move patterns back
Steve Klabnik [Sat, 18 Apr 2015 19:52:44 +0000 (15:52 -0400)]
TRPL editing: move patterns back

We want to talk about how to pattern match on structs, so let's bump
it back one.

9 years agoTRPL editing: patterns
Steve Klabnik [Sat, 18 Apr 2015 19:52:29 +0000 (15:52 -0400)]
TRPL editing: patterns

Partially addresses #24388

9 years agoTRPL editing: match
Steve Klabnik [Sat, 18 Apr 2015 19:32:26 +0000 (15:32 -0400)]
TRPL editing: match

9 years agoTRPL editing: enums
Steve Klabnik [Sat, 18 Apr 2015 19:29:13 +0000 (15:29 -0400)]
TRPL editing: enums

Now that we're not doing the guessing game, a lot of this is irrelevant.

9 years agoAuto merge of #22117 - fhahn:fail-on-errors, r=nikomatsakis
bors [Mon, 20 Apr 2015 13:20:19 +0000 (13:20 +0000)]
Auto merge of #22117 - fhahn:fail-on-errors, r=nikomatsakis

At the moment, when compilation is stopped at a stop point (like `-Z parse-only`), `rustc` does not return an nonzero exit code even if there are errors (expect fatal ones, that cause it to panic immediately). As an example, compiling `src/test/compile-fail/doc-before-semi.rs` with `-Z parse-only` raises an error, but exists with 0.

Note that I could not use `sess.abort_if_errors()` in the macro, because `sess` is passed by value and move at some point.

9 years agoSimplify alloc::arc::Arc example in doc-comment
Corey Farwell [Mon, 20 Apr 2015 12:57:06 +0000 (08:57 -0400)]
Simplify alloc::arc::Arc example in doc-comment

As far as I can tell, this conversion to integer to floating point does not need to happen and is beside the point

9 years agoAuto merge of #24525 - GuillaumeGomez:check-const, r=pnkfelix
bors [Mon, 20 Apr 2015 10:26:17 +0000 (10:26 +0000)]
Auto merge of #24525 - GuillaumeGomez:check-const, r=pnkfelix

Part of #24407.

9 years agoFix typos
Guillaume Gomez [Mon, 20 Apr 2015 10:01:56 +0000 (12:01 +0200)]
Fix typos

9 years agoAuto merge of #24608 - frewsxcv:patch-15, r=alexcrichton
bors [Mon, 20 Apr 2015 02:47:45 +0000 (02:47 +0000)]
Auto merge of #24608 - frewsxcv:patch-15, r=alexcrichton

9 years agoImprove doc for `Result::unwrap()`
York Xiang [Sun, 19 Apr 2015 16:07:23 +0000 (00:07 +0800)]
Improve doc for `Result::unwrap()`

9 years agoAuto merge of #24586 - richo:test-16745, r=jakub-
bors [Mon, 20 Apr 2015 00:43:37 +0000 (00:43 +0000)]
Auto merge of #24586 - richo:test-16745, r=jakub-

closes #16745