Commit graph

45297 commits

Author SHA1 Message Date
bors
871fd5eb73 Auto merge of #27552 - tshepang:misc, r=brson 2015-08-07 02:46:43 +00:00
bors
1181679c8f 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
2015-08-07 01:12:15 +00:00
Brian Anderson
fd142bb741 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
2015-08-06 16:53:05 -07:00
bors
68f79288bf 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!
2015-08-06 20:45:39 +00:00
bors
11deb083f5 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.
2015-08-06 19:11:17 +00:00
Ruby
d3e089f08b fixed the few nits! 2015-08-06 19:55:53 +01:00
Ruby
855f1ff321 Explained asterisk on & and &mut reference 2015-08-06 19:29:03 +01:00
bors
fb92de75c1 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
2015-08-06 17:36:21 +00:00
bors
83f2667fa2 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
2015-08-06 15:01:35 +00:00
bors
8f3901feab 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.
2015-08-06 10:46:26 +00:00
Jared Roesch
83e43bb728 Fix expected parse error 2015-08-06 00:46:51 -07:00
bors
859d2954ed Auto merge of #27557 - Manishearth:rollup, r=Manishearth
- Successful merges: #27546, #27550
- Failed merges:
2015-08-06 06:59:19 +00:00
Jeehoon Kang
9bfb8d3add 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.
2015-08-06 15:40:41 +09:00
Manish Goregaokar
4e9300c02b Rollup merge of #27550 - tshepang:missing-info, r=brson 2015-08-06 11:42:57 +05:30
Manish Goregaokar
1daad87893 Rollup merge of #27546 - steveklabnik:gh26115, r=brson
Fixes #26115
2015-08-06 11:42:56 +05:30
Taliesin Beynon
2ca3dda3c4 Some rerp-rust improvements.
* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.
2015-08-06 02:04:11 -04:00
Björn Steinbrink
38d627fe48 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.
2015-08-06 07:43:46 +02:00
bors
b81ab8a040 Auto merge of #27548 - tamird:opaque-ctypes, r=alexcrichton
r? @alexcrichton
2015-08-06 05:19:16 +00:00
bors
4278b5f03b 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
2015-08-06 03:40:42 +00:00
Tshepang Lekhonkhobe
3653cd9555 book: some improvements to Advanced Linking 2015-08-06 02:32:27 +02:00
bors
4f33e43cbc Auto merge of #27505 - steveklabnik:exterminate_exterminate, r=brson
These are for syntaxes that haven't existed for a long time.
2015-08-05 23:53:48 +00:00
Tshepang Lekhonkhobe
fc3df01eee doc: add info about the u64 wrapped in Result 2015-08-06 00:48:57 +02:00
Tamir Duberstein
05a814279b Better FFI discipline 2015-08-05 18:05:19 -04:00
bors
a0eb7a2c6d Auto merge of #27544 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #27285, #27524, #27533, #27535, #27538, #27539
- Failed merges:
2015-08-05 21:34:19 +00:00
Andrew Paseltiner
4fdeb353ce 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.
2015-08-05 16:06:12 -04:00
Steve Klabnik
de98a0b8fe Add an example to Trait section of reference
Fixes #26115
2015-08-05 15:31:19 -04:00
Steve Klabnik
428050712f 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
2015-08-05 15:09:50 -04:00
Steve Klabnik
43451bc4ee 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
2015-08-05 15:09:50 -04:00
Steve Klabnik
3a2af87363 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
2015-08-05 15:09:50 -04:00
Steve Klabnik
3a7e3c24b9 Rollup merge of #27533 - steveklabnik:gh27109, r=Gankro
This should be a bit more prominent.

Fixes #27109
2015-08-05 15:09:49 -04:00
Steve Klabnik
50dd4977fd Rollup merge of #27524 - steveklabnik:gh27523, r=gankro
This wording was too strong.

Fixes #27523
2015-08-05 15:09:49 -04:00
Steve Klabnik
1fb78b19ce Rollup merge of #27285 - lastorset:trait-operator-impl, r=steveklabnik
I also included some smaller trait-related changes.

Fixes #26991.

r? @shepmaster 
r? @steveklabnik
2015-08-05 15:09:49 -04:00
bors
430a9fd4c7 Auto merge of #27534 - alexcrichton:revert-adding-gdb-pp-tests, r=michaelwoerister
… are not actually broken."

This reverts commit 354cf4b56b.


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
2015-08-05 18:48:53 +00:00
Steve Klabnik
e4c229b9fd 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
2015-08-05 13:44:54 -04:00
Steve Klabnik
340c25aebf Clarify claims about PhantomData<T>.
This wording was too strong.

Fixes #27523
2015-08-05 13:29:26 -04:00
Steve Klabnik
8f828a3a9d 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
2015-08-05 13:23:22 -04:00
Steve Klabnik
4a68a7e198 Make note of Hash in Borrow's docs
This should be a bit more prominent.

Fixes #27109
2015-08-05 12:32:35 -04:00
Steve Klabnik
db1f17a64b 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
2015-08-05 12:30:00 -04:00
Alex Crichton
3430532a8e Revert "debuginfo: Bring back some GDB pretty printing autotests that are not actually broken."
This reverts commit 354cf4b56b.
2015-08-05 09:20:28 -07:00
bors
d03456183e Auto merge of #27529 - dotdash:c_u8, r=eddyb 2015-08-05 12:08:17 +00:00
bors
0dc2910c9c 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
2015-08-05 10:30:41 +00:00
bors
6210dcdddb Auto merge of #27530 - Manishearth:rollup, r=Manishearth
- Successful merges: #27519, #27521, #27525, #27527, #27528
- Failed merges:
2015-08-05 08:52:06 +00:00
Manish Goregaokar
eee286dfdd Rollup merge of #27528 - friedm:doc_meta_designator, r=huonw
For #27471
2015-08-05 13:45:39 +05:30
Manish Goregaokar
8effc61816 Rollup merge of #27527 - aij:tarpl, r=Gankro
Just some grammar fixes and an assumed missing word.

r? @Gankro
2015-08-05 13:45:38 +05:30
Manish Goregaokar
a497c6722e 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
2015-08-05 13:45:38 +05:30
Manish Goregaokar
05083299fa 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
2015-08-05 13:45:38 +05:30
Manish Goregaokar
b1dc2c5094 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.
2015-08-05 13:45:38 +05:30
Björn Steinbrink
6e311e7af4 Make C_u8 take a u8 instead of a usize value 2015-08-05 09:56:29 +02:00
bors
76ff835ca0 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?
2015-08-05 07:14:47 +00:00
bors
8228240ca8 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.
2015-08-05 05:37:47 +00:00