]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoMake `str::as_bytes_mut` private
Tobias Bucher [Fri, 24 Jul 2015 20:10:12 +0000 (22:10 +0200)]
Make `str::as_bytes_mut` private

8 years agoMake `slice::transmute*` private
Tobias Bucher [Fri, 24 Jul 2015 19:02:05 +0000 (21:02 +0200)]
Make `slice::transmute*` private

8 years agoReplace many uses of `mem::transmute` with more specific functions
Tobias Bucher [Fri, 24 Jul 2015 01:04:55 +0000 (03:04 +0200)]
Replace many uses of `mem::transmute` with more specific functions

The replacements are functions that usually use a single `mem::transmute` in
their body and restrict input and output via more concrete types than `T` and
`U`. Worth noting are the `transmute` functions for slices and the `from_utf8*`
family for mutable slices. Additionally, `mem::transmute` was often used for
casting raw pointers, when you can already cast raw pointers just fine with
`as`.

8 years agoMark round_up_to_next as inline
Ariel Ben-Yehuda [Sun, 9 Aug 2015 14:20:12 +0000 (17:20 +0300)]
Mark round_up_to_next as inline

This speeds up rustc on #25916 from 1.36Â0.022s to 1.326Â0.025s

8 years agoAuto merge of #27182 - AlisdairO:diagnostics382, r=Manishearth
bors [Sat, 8 Aug 2015 20:32:27 +0000 (20:32 +0000)]
Auto merge of #27182 - AlisdairO:diagnostics382, r=Manishearth

As title :-)
Part of #24407.

r? @Manishearth

8 years agoadd long diagnostics for E0382
Alisdair Owens [Tue, 21 Jul 2015 11:03:21 +0000 (12:03 +0100)]
add long diagnostics for E0382

8 years agoAuto merge of #27595 - mike-marcacci:patch-1, r=steveklabnik
bors [Sat, 8 Aug 2015 16:27:12 +0000 (16:27 +0000)]
Auto merge of #27595 - mike-marcacci:patch-1, r=steveklabnik

Keeping integer values and integer references in the "value" columns made the examples quite difficult for me to follow. I've added unicode arrows to references to make them more obvious, without using any characters with actual meaning in the rust language (like `&` or previously `~`).

r? @steveklabnik

8 years agoAuto merge of #27596 - tsion:fix-27450, r=arielb1
bors [Sat, 8 Aug 2015 09:55:42 +0000 (09:55 +0000)]
Auto merge of #27596 - tsion:fix-27450, r=arielb1

Fixes #27450.

r? @steveklabnik

8 years agoAdded arrows to references in tables
Mike Marcacci [Sat, 8 Aug 2015 06:13:08 +0000 (23:13 -0700)]
Added arrows to references in tables

Keeping integer values and integer references in the "value" columns made the examples quite difficult for me to follow. I've added unicode arrows to make references more obvious, without using a character with actual meaning in the rust language (like `&` or previously `~`).

8 years agoFix the diagnostic for fat pointer to usize casts.
Scott Olson [Sat, 8 Aug 2015 02:08:28 +0000 (22:08 -0400)]
Fix the diagnostic for fat pointer to usize casts.

Fixes #27450.

8 years agoAuto merge of #27378 - GuillaumeGomez:patch-2, r=brson
bors [Fri, 7 Aug 2015 17:58:17 +0000 (17:58 +0000)]
Auto merge of #27378 - GuillaumeGomez:patch-2, r=brson

Part of #24407.
r? @Manishearth

8 years agoAuto merge of #27582 - pnkfelix:disable-nonzeroing-move-hint-by-default, r=nikomatsakis
bors [Fri, 7 Aug 2015 16:24:22 +0000 (16:24 +0000)]
Auto merge of #27582 - pnkfelix:disable-nonzeroing-move-hint-by-default, r=nikomatsakis

Turn nonzeroing move hints back off by default.

Works around bugs injected by PR #26173.

 * (@pnkfelix is unavailable in the short-term (i.e. for the next week) to fix them.)

 * When the bugs are fixed, we will turn nonzeroing move hints back on by default.

Fix #27401

8 years agoplacate the pretty tests by ignoring my test.
Felix S. Klock II [Fri, 7 Aug 2015 16:23:37 +0000 (18:23 +0200)]
placate the pretty tests by ignoring my test.

8 years agoRegression test for dropflag reinit issue.
Felix S. Klock II [Fri, 7 Aug 2015 14:21:22 +0000 (16:21 +0200)]
Regression test for dropflag reinit issue.

Fix #27401.

8 years agoTurn nonzeroing move hints back off by default.
Felix S. Klock II [Fri, 7 Aug 2015 13:51:25 +0000 (15:51 +0200)]
Turn nonzeroing move hints back off by default.

This is a temporary workaround for the bugs that have been found in
the implementation of PR #26173.

 * pnkfelix is unavailable in the short-term (i.e. for the next week) to fix them.

 * When the bugs are fixed, we will turn this back on by default.

(If you want to play with the known-to-be-buggy optimization in the
meantime, you can opt-back in via the debugging option that this
commit is toggling.)

8 years agoAdd a guard example for E0416
Guillaume Gomez [Fri, 7 Aug 2015 13:23:00 +0000 (15:23 +0200)]
Add a guard example for E0416

8 years agoImprove examples of E0102
Guillaume Gomez [Fri, 7 Aug 2015 13:07:20 +0000 (15:07 +0200)]
Improve examples of E0102

8 years agoAuto merge of #27551 - arielb1:adt-def, r=nikomatsakis
bors [Fri, 7 Aug 2015 12:23:06 +0000 (12:23 +0000)]
Auto merge of #27551 - arielb1:adt-def, r=nikomatsakis

This ended up being a bigger refactoring than I thought, as I also cleaned a few ugly points in rustc. There are still a few areas that need improvements.

Performance numbers:
```
Before:
572.70user 5.52system 7:33.21elapsed 127%CPU (0avgtext+0avgdata 1173368maxresident)k
llvm-time: 385.858

After:
545.27user 5.49system 7:10.22elapsed 128%CPU (0avgtext+0avgdata 1145348maxresident)k
llvm-time: 387.119
```

A good 5% perf improvement. Note that after this patch >70% of the time is spent in LLVM - Amdahl's law is in full effect.

Passes make check locally.

r? @nikomatsakis

8 years agorename ADTDef to AdtDef etc.
Ariel Ben-Yehuda [Fri, 7 Aug 2015 11:41:33 +0000 (14:41 +0300)]
rename ADTDef to AdtDef etc.

8 years agostop using skip_binder
Ariel Ben-Yehuda [Fri, 7 Aug 2015 10:57:39 +0000 (13:57 +0300)]
stop using skip_binder

8 years agoadd documentation
Ariel Ben-Yehuda [Fri, 7 Aug 2015 10:48:29 +0000 (13:48 +0300)]
add documentation

8 years agoAuto merge of #27576 - rust-lang:steveklabnik-patch-1, r=Gankro
bors [Fri, 7 Aug 2015 05:57:24 +0000 (05:57 +0000)]
Auto merge of #27576 - rust-lang:steveklabnik-patch-1, r=Gankro

1. this isn't actually true about diabetes
2. people with diabetes will get *real sad* when reading this
3. it isn't actually necessary.

r? @Gankro

8 years agoAuto merge of #27558 - mlalic:patch-1, r=brson
bors [Fri, 7 Aug 2015 04:21:47 +0000 (04:21 +0000)]
Auto merge of #27558 - mlalic:patch-1, r=brson

r? @steveklabnik

8 years agoAuto merge of #27552 - tshepang:misc, r=brson
bors [Fri, 7 Aug 2015 02:46:43 +0000 (02:46 +0000)]
Auto merge of #27552 - tshepang:misc, r=brson

8 years agoAuto merge of #27574 - brson:cache-staged-api, r=huonw
bors [Fri, 7 Aug 2015 01:12:15 +0000 (01:12 +0000)]
Auto merge of #27574 - brson:cache-staged-api, r=huonw

This search happens a lot! Locally, compiling hyper sees the following improvements:

before

real    0m30.843s
user    0m51.644s
sys     0m2.128s

real    0m30.164s
user    0m53.320s
sys     0m2.208s

after

real    0m28.438s
user    0m51.076s
sys     0m2.276s

real    0m28.612s
user    0m51.560s
sys     0m2.192s

8 years agoRemove reference to diabetes
Steve Klabnik [Fri, 7 Aug 2015 00:18:49 +0000 (20:18 -0400)]
Remove reference to diabetes

1. this isn't actually true about diabetes
2. people with diabetes will get *real sad* when reading this
3. it isn't actually necessary.

8 years agoCache a linear search for the #[staged_api] attribute.
Brian Anderson [Thu, 6 Aug 2015 01:25:33 +0000 (18:25 -0700)]
Cache a linear search for the #[staged_api] attribute.

This search happens a lot! Locally, compiling hyper sees the following improvements:

before

real    0m30.843s
user    0m51.644s
sys     0m2.128s

real    0m30.164s
user    0m53.320s
sys     0m2.208s

after

real    0m28.438s
user    0m51.076s
sys     0m2.276s

real    0m28.612s
user    0m51.560s
sys     0m2.192s

8 years agoAuto merge of #27566 - rubymeow:master, r=steveklabnik
bors [Thu, 6 Aug 2015 20:45:39 +0000 (20:45 +0000)]
Auto merge of #27566 - rubymeow:master, r=steveklabnik

I got a bit confused reading the guide over why all of a sudden there was an asterisk in the code. I was explained what it was there for in the IRC, and I think it should added it to the docs to prevent any further confusion!

8 years agoAuto merge of #27296 - jroesch:type-macros, r=huonw
bors [Thu, 6 Aug 2015 19:11:17 +0000 (19:11 +0000)]
Auto merge of #27296 - jroesch:type-macros, r=huonw

This pull request implements the functionality for [RFC 873](https://github.com/rust-lang/rfcs/blob/master/text/0873-type-macros.md). This is currently just an update of @freebroccolo's branch from January, the corresponding commits are linked in each commit message.

@nikomatsakis and I had talked about updating the macro language to support a lifetime fragment specifier, and it is possible to do that work on this branch as well. If so we can (collectively) talk about it next week during the pre-RustCamp work week.

8 years agoAdd another example for E0412
Guillaume Gomez [Thu, 6 Aug 2015 18:47:10 +0000 (20:47 +0200)]
Add another example for E0412

8 years agofixed the few nits!
Ruby [Thu, 6 Aug 2015 18:55:53 +0000 (19:55 +0100)]
fixed the few nits!

8 years agoExplained asterisk on & and &mut reference
Ruby [Thu, 6 Aug 2015 18:29:03 +0000 (19:29 +0100)]
Explained asterisk on & and &mut reference

8 years agoUpdate E0423 example
Guillaume Gomez [Thu, 6 Aug 2015 13:42:22 +0000 (15:42 +0200)]
Update E0423 example

8 years agoAuto merge of #27556 - taliesinb:tarpl-clarity-2, r=Gankro
bors [Thu, 6 Aug 2015 17:36:21 +0000 (17:36 +0000)]
Auto merge of #27556 - taliesinb:tarpl-clarity-2, r=Gankro

* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.

r? @Gankro

8 years agocache Ty::is_simd
Ariel Ben-Yehuda [Thu, 6 Aug 2015 15:25:15 +0000 (18:25 +0300)]
cache Ty::is_simd

8 years agofix dropck overflow error message
Ariel Ben-Yehuda [Thu, 6 Aug 2015 14:43:08 +0000 (17:43 +0300)]
fix dropck overflow error message

Perf numbers:

Before this patchset:
572.70user 5.52system 7:33.21elapsed 127%CPU (0avgtext+0avgdata 1173368maxresident)k
llvm-time: 385.858

After this patch:
557.84user 5.73system 7:22.10elapsed 127%CPU (0avgtext+0avgdata 1142848maxresident)k
llvm-time: 385.834

nice 2.5% perf improvement

8 years agoAuto merge of #27434 - jeehoonkang:master, r=Gankro
bors [Thu, 6 Aug 2015 15:01:35 +0000 (15:01 +0000)]
Auto merge of #27434 - jeehoonkang:master, r=Gankro

In Section 3.2, TARPL says that "standard allocators (including jemalloc, the one used by default in Rust) generally consider passing in 0 for the size of an allocation as Undefined Behaviour."
However, the C standard and jemalloc manual says allocating zero bytes
should succeed:

- C11 7.22.3 paragraph 1: "If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object."
- [jemalloc manual](http://www.freebsd.org/cgi/man.cgi?query=jemalloc&sektion=3): "The malloc and calloc functions return a pointer to the allocated memory if successful; otherwise a NULL pointer is returned and errno is set to ENOMEM."
    + Note that the description for `allocm` says "Behavior is undefined if size is 0," but it is an experimental API.

r? @Gankro

8 years agohandle associated types correctly in null pointer optimization
Ariel Ben-Yehuda [Thu, 6 Aug 2015 14:00:41 +0000 (17:00 +0300)]
handle associated types correctly in null pointer optimization

Fixes #27532

Thanks @eefriedman for the test.

8 years agoremove ty::{VariantInfo, FieldTy}
Ariel Ben-Yehuda [Wed, 5 Aug 2015 22:55:13 +0000 (01:55 +0300)]
remove ty::{VariantInfo, FieldTy}

8 years agoresolve todo
Ariel Ben-Yehuda [Wed, 5 Aug 2015 22:32:04 +0000 (01:32 +0300)]
resolve todo

8 years agoremove struct_fields & enum_variants from the tcx
Ariel Ben-Yehuda [Wed, 5 Aug 2015 22:29:52 +0000 (01:29 +0300)]
remove struct_fields & enum_variants from the tcx

8 years agouse VariantDef instead of struct_fields
Ariel Ben-Yehuda [Sun, 2 Aug 2015 19:52:50 +0000 (22:52 +0300)]
use VariantDef instead of struct_fields

8 years agoAdd E0416 error explanation
Guillaume Gomez [Thu, 6 Aug 2015 13:30:33 +0000 (15:30 +0200)]
Add E0416 error explanation

8 years agoAdd E0415 error explanation
Guillaume Gomez [Thu, 6 Aug 2015 13:21:25 +0000 (15:21 +0200)]
Add E0415 error explanation

8 years agocreate VariantDef-s (but don't actually use them)
Ariel Ben-Yehuda [Wed, 22 Jul 2015 18:53:52 +0000 (21:53 +0300)]
create VariantDef-s (but don't actually use them)

8 years agoadd variant info to ADTDef, but don't actually use it
Ariel Ben-Yehuda [Wed, 22 Jul 2015 17:10:18 +0000 (20:10 +0300)]
add variant info to ADTDef, but don't actually use it

8 years agointroduce an ADTDef struct for struct/enum definitions
Ariel Ben-Yehuda [Mon, 20 Jul 2015 19:13:36 +0000 (22:13 +0300)]
introduce an ADTDef struct for struct/enum definitions

8 years agoadd an Ivar for write-only variables
Ariel Ben-Yehuda [Mon, 20 Jul 2015 12:48:24 +0000 (15:48 +0300)]
add an Ivar for write-only variables

8 years agoAuto merge of #27555 - dotdash:drop_flag_ty, r=pnkfelix
bors [Thu, 6 Aug 2015 10:46:26 +0000 (10:46 +0000)]
Auto merge of #27555 - dotdash:drop_flag_ty, r=pnkfelix

The drop flags are Lvalue (and thus ByRef) datums that hold a u8 value,
so their value type should be u8, not a pointer to u8.

8 years agoAdd E0419 error explanation
Guillaume Gomez [Thu, 6 Aug 2015 10:07:55 +0000 (12:07 +0200)]
Add E0419 error explanation

8 years agoTRPL/lifetimes.md: Fix typo lifteimes -> lifetimes
Marko Lalic [Thu, 6 Aug 2015 09:57:55 +0000 (11:57 +0200)]
TRPL/lifetimes.md: Fix typo lifteimes -> lifetimes

8 years agoAdd examples in E0412
Guillaume Gomez [Thu, 6 Aug 2015 09:57:53 +0000 (11:57 +0200)]
Add examples in E0412

8 years agoFix expected parse error
Jared Roesch [Wed, 5 Aug 2015 21:18:29 +0000 (14:18 -0700)]
Fix expected parse error

8 years agoAuto merge of #27557 - Manishearth:rollup, r=Manishearth
bors [Thu, 6 Aug 2015 06:59:19 +0000 (06:59 +0000)]
Auto merge of #27557 - Manishearth:rollup, r=Manishearth

- Successful merges: #27546, #27550
- Failed merges:

8 years agoRevise TARPL's description for allocating 0 bytes
Jeehoon Kang [Fri, 31 Jul 2015 14:55:01 +0000 (23:55 +0900)]
Revise TARPL's description for allocating 0 bytes

In Section 3.2, TARPL says that "standard allocators (including jemalloc, the one used by default in Rust) generally consider passing in 0 for the size of an allocation as Undefined Behaviour."
However, the C standard and jemalloc manual says allocating zero bytes
should succeed:

- C11 7.22.3 paragraph 1: "If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object."
- [jemalloc manual](http://www.freebsd.org/cgi/man.cgi?query=jemalloc&sektion=3): "The malloc and calloc functions return a pointer to the allocated memory if successful; otherwise a NULL pointer is returned and errno is set to ENOMEM."
    + Note that the description for `allocm` says "Behavior is undefined if size is 0," but it is an experimental API.

8 years agoRollup merge of #27550 - tshepang:missing-info, r=brson
Manish Goregaokar [Thu, 6 Aug 2015 06:12:57 +0000 (11:42 +0530)]
Rollup merge of #27550 - tshepang:missing-info, r=brson

8 years agoRollup merge of #27546 - steveklabnik:gh26115, r=brson
Manish Goregaokar [Thu, 6 Aug 2015 06:12:56 +0000 (11:42 +0530)]
Rollup merge of #27546 - steveklabnik:gh26115, r=brson

Fixes #26115

8 years agoSome rerp-rust improvements.
Taliesin Beynon [Thu, 6 Aug 2015 06:04:11 +0000 (02:04 -0400)]
Some rerp-rust improvements.

* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.

8 years agoUse the right type for drop flag datums
Björn Steinbrink [Thu, 6 Aug 2015 05:43:46 +0000 (07:43 +0200)]
Use the right type for drop flag datums

The drop flags are Lvalue (and thus ByRef) datums that hold a u8 value,
so their value type should be u8, not a pointer to u8.

8 years agoAuto merge of #27548 - tamird:opaque-ctypes, r=alexcrichton
bors [Thu, 6 Aug 2015 05:19:16 +0000 (05:19 +0000)]
Auto merge of #27548 - tamird:opaque-ctypes, r=alexcrichton

r? @alexcrichton

8 years agoAuto merge of #27545 - apasel422:btree-range, r=Gankro
bors [Thu, 6 Aug 2015 03:40:42 +0000 (03:40 +0000)]
Auto merge of #27545 - apasel422:btree-range, r=Gankro

This permits collections with `String` keys to be ranged over with
`&str` bounds. The `K` defaults for `Min` and `Max` permit the default
type parameter fallback to work with things like

```rust
use std::collections::{BTreeSet, Bound};
let set = BTreeSet::<String>::new();
set.range(Bound::Included("a"), Bound::Unbounded);
```

Without the defaults, the type of the maximum bound would be
unconstrained.

r? @Gankro

8 years agobook: some improvements to Advanced Linking
Tshepang Lekhonkhobe [Thu, 6 Aug 2015 00:31:38 +0000 (02:31 +0200)]
book: some improvements to Advanced Linking

8 years agoAuto merge of #27505 - steveklabnik:exterminate_exterminate, r=brson
bors [Wed, 5 Aug 2015 23:53:48 +0000 (23:53 +0000)]
Auto merge of #27505 - steveklabnik:exterminate_exterminate, r=brson

These are for syntaxes that haven't existed for a long time.

8 years agodoc: add info about the u64 wrapped in Result
Tshepang Lekhonkhobe [Wed, 5 Aug 2015 22:48:57 +0000 (00:48 +0200)]
doc: add info about the u64 wrapped in Result

8 years agoBetter FFI discipline
Tamir Duberstein [Wed, 5 Aug 2015 21:50:18 +0000 (17:50 -0400)]
Better FFI discipline

8 years agoAuto merge of #27544 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 5 Aug 2015 21:34:19 +0000 (21:34 +0000)]
Auto merge of #27544 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #27285, #27524, #27533, #27535, #27538, #27539
- Failed merges:

8 years agoFully generalize `BTree{Map, Set}` range iterators
Andrew Paseltiner [Wed, 5 Aug 2015 19:12:10 +0000 (15:12 -0400)]
Fully generalize `BTree{Map, Set}` range iterators

This permits collections with `String` keys to be ranged over with
`&str` bounds. The `K` defaults for `Min` and `Max` permit the default
type parameter fallback to work with things like

```rust
use std::collections::{BTreeSet, Bound};
let set = BTreeSet::<String>::new();
set.range(Bound::Included("a"), Bound::Unbounded);
```

Without the defaults, the type of the maximum bound would be
unconstrained.

8 years agoAdd an example to Trait section of reference
Steve Klabnik [Wed, 5 Aug 2015 19:31:19 +0000 (15:31 -0400)]
Add an example to Trait section of reference

Fixes #26115

8 years agoRollup merge of #27539 - steveklabnik:gh26746, r=brson
Steve Klabnik [Wed, 5 Aug 2015 19:09:50 +0000 (15:09 -0400)]
Rollup merge of #27539 - steveklabnik:gh26746, r=brson

1. mention them in the function chapter
2. mention their coercion to closures in the closures chapter

Fixes #26746

8 years agoRollup merge of #27538 - steveklabnik:gh26917, r=Gankro
Steve Klabnik [Wed, 5 Aug 2015 19:09:50 +0000 (15:09 -0400)]
Rollup merge of #27538 - steveklabnik:gh26917, r=Gankro

We haven't discussed this syntax yet, so provide a basic explanation
and link up to later chapters.

Fixes #26917

8 years agoRollup merge of #27535 - steveklabnik:for_jhun, r=alexcrichton
Steve Klabnik [Wed, 5 Aug 2015 19:09:50 +0000 (15:09 -0400)]
Rollup merge of #27535 - steveklabnik:for_jhun, r=alexcrichton

'work' can refer to the game itself, ie, 'this compiles but the game isn't finished,'
so 'compile' is a more clear way to describe the problem.

Thanks jhun on irc

8 years agoRollup merge of #27533 - steveklabnik:gh27109, r=Gankro
Steve Klabnik [Wed, 5 Aug 2015 19:09:49 +0000 (15:09 -0400)]
Rollup merge of #27533 - steveklabnik:gh27109, r=Gankro

This should be a bit more prominent.

Fixes #27109

8 years agoRollup merge of #27524 - steveklabnik:gh27523, r=gankro
Steve Klabnik [Wed, 5 Aug 2015 19:09:49 +0000 (15:09 -0400)]
Rollup merge of #27524 - steveklabnik:gh27523, r=gankro

This wording was too strong.

Fixes #27523

8 years agoRollup merge of #27285 - lastorset:trait-operator-impl, r=steveklabnik
Steve Klabnik [Wed, 5 Aug 2015 19:09:49 +0000 (15:09 -0400)]
Rollup merge of #27285 - lastorset:trait-operator-impl, r=steveklabnik

I also included some smaller trait-related changes.

Fixes #26991.

r? @shepmaster
r? @steveklabnik

8 years agoAuto merge of #27534 - alexcrichton:revert-adding-gdb-pp-tests, r=michaelwoerister
bors [Wed, 5 Aug 2015 18:48:53 +0000 (18:48 +0000)]
Auto merge of #27534 - alexcrichton:revert-adding-gdb-pp-tests, r=michaelwoerister

… are not actually broken."

This reverts commit 354cf4b56b8e2af67cc68965eb816deec0e79e4b.

Unfortunately these [tests are failing](http://buildbot.rust-lang.org/builders/nightly-dist-rustc-linux/builds/224/steps/distcheck/logs/stdio) on the snapshot/nightly bots with the [same message](https://gist.github.com/alexcrichton/611705ded07b0d73ded9) found in #27514

8 years agoAdd more infor about function pointers to TRPL
Steve Klabnik [Wed, 5 Aug 2015 17:44:54 +0000 (13:44 -0400)]
Add more infor about function pointers to TRPL

1. mention them in the function chapter
2. mention their coercion to closures in the closures chapter

Fixes #26746

8 years agoClarify claims about PhantomData<T>.
Steve Klabnik [Tue, 4 Aug 2015 20:43:45 +0000 (16:43 -0400)]
Clarify claims about PhantomData<T>.

This wording was too strong.

Fixes #27523

8 years agoExpand further on <> syntax in TRPL.
Steve Klabnik [Wed, 5 Aug 2015 17:23:22 +0000 (13:23 -0400)]
Expand further on <> syntax in TRPL.

We haven't discussed this syntax yet, so provide a basic explanation
and link up to later chapters.

Fixes #26917

8 years agoMake note of Hash in Borrow's docs
Steve Klabnik [Wed, 5 Aug 2015 16:16:37 +0000 (12:16 -0400)]
Make note of Hash in Borrow's docs

This should be a bit more prominent.

Fixes #27109

8 years agowork -> compile in Guessing Game
Steve Klabnik [Wed, 5 Aug 2015 16:30:00 +0000 (12:30 -0400)]
work -> compile in Guessing Game

'work' can refer to the game itself, ie, 'this compiles but the game isn't finished,'
so 'compile' is a more clear way to describe the problem.

Thanks jhun on irc

8 years agoRevert "debuginfo: Bring back some GDB pretty printing autotests that are not actuall...
Alex Crichton [Wed, 5 Aug 2015 16:20:28 +0000 (09:20 -0700)]
Revert "debuginfo: Bring back some GDB pretty printing autotests that are not actually broken."

This reverts commit 354cf4b56b8e2af67cc68965eb816deec0e79e4b.

8 years agoAuto merge of #27529 - dotdash:c_u8, r=eddyb
bors [Wed, 5 Aug 2015 12:08:17 +0000 (12:08 +0000)]
Auto merge of #27529 - dotdash:c_u8, r=eddyb

8 years agoAuto merge of #27458 - mitaa:local_cpath, r=nikomatsakis
bors [Wed, 5 Aug 2015 10:30:41 +0000 (10:30 +0000)]
Auto merge of #27458 - mitaa:local_cpath, r=nikomatsakis

This changes the current behaviour for two cases (that I know of)
```rust
mod foo {
    extern crate bar;
}
// `bar::` changes to `foo::bar::`
```

```rust
extern crate bar as quux;
// `bar::` changes to `quux::`
```
For example:
```rust
mod foo {
    extern crate core;
}

fn assert_clone<T>() where T : Clone { }

fn main() {
    assert_clone::<foo::core::atomic::AtomicBool>();
    // error: the trait `core::clone::Clone` is not implemented for the type `core::atomic::AtomicBool` [E0277]
    // changes to
    // error: the trait `foo::core::clone::Clone` is not implemented for the type `foo::core::atomic::AtomicBool` [E0277]
}
```

Notably the following test case broke:
```rust
 #[bench]
 fn bar(x: isize) { }
 //~^ ERROR mismatched types
 //~| expected `fn(&mut test::Bencher)`
 // changed to
 //~| expected `fn(&mut __test::test::Bencher)`
```
If a crate is linked multiple times the path with the least segments is stored.
Partially addresses #1920. (this doesn't solve the issue raised about re-exports)

r? @nikomatsakis

8 years agoAuto merge of #27530 - Manishearth:rollup, r=Manishearth
bors [Wed, 5 Aug 2015 08:52:06 +0000 (08:52 +0000)]
Auto merge of #27530 - Manishearth:rollup, r=Manishearth

- Successful merges: #27519, #27521, #27525, #27527, #27528
- Failed merges:

8 years agoRollup merge of #27528 - friedm:doc_meta_designator, r=huonw
Manish Goregaokar [Wed, 5 Aug 2015 08:15:39 +0000 (13:45 +0530)]
Rollup merge of #27528 - friedm:doc_meta_designator, r=huonw

For #27471

8 years agoRollup merge of #27527 - aij:tarpl, r=Gankro
Manish Goregaokar [Wed, 5 Aug 2015 08:15:38 +0000 (13:45 +0530)]
Rollup merge of #27527 - aij:tarpl, r=Gankro

Just some grammar fixes and an assumed missing word.

r? @Gankro

8 years agoRollup merge of #27525 - Gankro:nomvar, r=aturon
Manish Goregaokar [Wed, 5 Aug 2015 08:15:38 +0000 (13:45 +0530)]
Rollup merge of #27525 - Gankro:nomvar, r=aturon

I thought this was actually a huge error and I'd have to rewrite a bunch but
it looks like everything else was correct.

Closes #27457

r? @aturon

8 years agoRollup merge of #27521 - steveklabnik:doc_std_mem_forget, r=gankro
Manish Goregaokar [Wed, 5 Aug 2015 08:15:38 +0000 (13:45 +0530)]
Rollup merge of #27521 - steveklabnik:doc_std_mem_forget, r=gankro

We were burying the reason to use this function below a bunch of caveats about
its usage. That's backwards. Why a function should be used belongs at the top of
the docs, not the bottom.

Also, add some extra links to related functions mentioned in the body.

/cc @abhijeetbhagat who  pointed this out on IRC

8 years agoRollup merge of #27519 - JanLikar:rearrange-patterns, r=steveklabnik
Manish Goregaokar [Wed, 5 Aug 2015 08:15:38 +0000 (13:45 +0530)]
Rollup merge of #27519 - JanLikar:rearrange-patterns, r=steveklabnik

  - Move "Destructuring" after "Multiple patterns", because some of
    later sections include examples which make use of destructuring.

  - Move "Ignoring bindings" after "Destructoring", because the former
    features Result<T,E> destructuring. Some of examples in later
    sections use "_" and "..", so "Ignoring bindings" must be
    positioned before them.

  - Fix #27347 by moving "Ref and mut ref" before "Ranges" and
    "Bindings", because "Bindings" section includes a somewhat
    difficult example, which also makes use of "ref" and "mut ref"
    operators.

8 years agoMake C_u8 take a u8 instead of a usize value
Björn Steinbrink [Wed, 5 Aug 2015 07:46:59 +0000 (09:46 +0200)]
Make C_u8 take a u8 instead of a usize value

8 years agoAuto merge of #27503 - c-nixon:master, r=steveklabnik
bors [Wed, 5 Aug 2015 07:14:47 +0000 (07:14 +0000)]
Auto merge of #27503 - c-nixon:master, r=steveklabnik

I was reading through the docs and came across a section that felt awkward.

I've tried to improve the flow by splitting up and reversing the explanations of
Arc and Mutex with some example code in between.

The "This would have have happened" bit is unfortunate but I couldn't see any
other way to illustrate it. The compiler errors didn't really help tell the
story in this particular instance so it still feels a bit forced. However I do think it's
an a small improvement...

Does anyone have any other ideas that might flow better?

8 years agoAuto merge of #27520 - brson:bump, r=alexcrichton
bors [Wed, 5 Aug 2015 05:37:47 +0000 (05:37 +0000)]
Auto merge of #27520 - brson:bump, r=alexcrichton

This probably wants to go in tomorrow. If it lands today then there will be one day where nightly is on 1.4 and stable is still on 1.1. Not a big deal either way.

8 years agoAuto merge of #27439 - vberger:more_perseverant_resolve, r=nrc
bors [Wed, 5 Aug 2015 03:52:39 +0000 (03:52 +0000)]
Auto merge of #27439 - vberger:more_perseverant_resolve, r=nrc

(This is a second try at #26242. This time I think things should be ok.)

The current algorithm handling import resolutions works sequentially, handling imports in the order they appear in the source file, and blocking/bailing on the first one generating an error/being unresolved.

This can lead to situations where the order of the `use` statements can make the difference between "this code compiles" and "this code fails on an unresolved import" (see #18083 for example). This is especially true when considering glob imports.

This PR changes the behaviour of the algorithm to instead try to resolve all imports in a module. If one fails, it is recorded and the next one is tried (instead of directly giving up). Also, all errors generated are stored (and not reported directly).

The main loop of the algorithms guaranties that the algorithm will always finish: if a round of resolution does not resolve anything new, we are stuck and give up. At this point, the new version of the algorithm will display all errors generated by the last round of resolve. This way we are sure to not silence relevant errors or help messages, but also to not give up too early.

**As a consequence, the import resolution becomes independent of the order in which the `use` statements are written in the source files.** I personally don't see any situations where this could be a problem, but this might need some thought.

I passed `rpass` and `cfail` tests on my computer, and now am compiling a full stage2 compiler to ensure the crates reporting errors in my previous attempts still build correctly. I guess once I have checked it, this will need a crater run?

Fixes #18083.

r? @alexcrichton , cc @nrc @brson

8 years agoAuto merge of #27393 - alexcrichton:no-std-changes, r=brson
bors [Wed, 5 Aug 2015 02:00:46 +0000 (02:00 +0000)]
Auto merge of #27393 - alexcrichton:no-std-changes, r=brson

This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of
the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The
`#![no_std]` attribute now injects `extern crate core` at the top of the crate
as well as the libcore prelude into all modules (in the same manner as the
standard library's prelude). The `#![no_core]` attribute disables both std and
core injection.

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

Closes #27394

8 years agoadd `meta` designator to macro reference
Matt Friedman [Wed, 5 Aug 2015 01:00:59 +0000 (20:00 -0500)]
add `meta` designator to macro reference

8 years agoFix some grammar in The Advanced Rust Programming Language
Ivan Jager [Tue, 4 Aug 2015 22:09:44 +0000 (17:09 -0500)]
Fix some grammar in The Advanced Rust Programming Language

8 years agoFix last nits
Jared Roesch [Tue, 4 Aug 2015 23:04:26 +0000 (16:04 -0700)]
Fix last nits

8 years agoAddress final nits
Jared Roesch [Tue, 4 Aug 2015 03:32:02 +0000 (20:32 -0700)]
Address final nits

8 years agoActually commit tests
Jared Roesch [Mon, 3 Aug 2015 20:51:23 +0000 (13:51 -0700)]
Actually commit tests

8 years agoAddress nits
Jared Roesch [Sat, 1 Aug 2015 21:35:46 +0000 (14:35 -0700)]
Address nits