Commit Graph

47860 Commits

Author SHA1 Message Date
Michael Neumann
9415450ace Use guard-pages also on DragonFly/FreeBSD.
Only tested on DragonFly.
2015-11-01 22:56:31 +01:00
bors
6307719a12 Auto merge of #29501 - Manishearth:pat-docs, r=alexcrichton
None
2015-11-01 21:42:18 +00:00
Vadim Chugunov
ab10cb7443 Clarify Windows gcc setup instructions. 2015-11-01 12:41:32 -08:00
bors
af6e413fdb Auto merge of #29471 - pierzchalski:custom-target-custom-unwind-json, r=alexcrichton 2015-11-01 20:00:07 +00:00
Florian Hartwig
4168e026b4 Stop using ok().expect() in Result docs 2015-11-01 20:41:23 +01:00
Florian Hartwig
f7a61678e3 Replace ok().expect() by Result::expect in trait chapter of trpl 2015-11-01 20:40:20 +01:00
bors
71409184dc Auto merge of #29177 - vadimcn:rtstuff, r=alexcrichton
Note: for now, this change only affects `-windows-gnu` builds.

So why was this `libgcc` dylib dependency needed in the first place?
The stack unwinder needs to know about locations of unwind tables of all the modules loaded in the current process.  The easiest portable way of achieving this is to have each module register itself with the unwinder when loaded into the process.  All modules compiled by GCC do this by calling the __register_frame_info() in their startup code (that's `crtbegin.o` and `crtend.o`, which are automatically linked into any gcc output).
Another important piece is that there should be only one copy of the unwinder (and thus unwind tables registry) in the process.  This pretty much means that the unwinder must be in a shared library (unless everything is statically linked). 

Now, Rust compiler tries very hard to make sure that any given Rust crate appears in the final output just once.   So if we link the unwinder statically to one of Rust's crates, everything should be fine.

Unfortunately, GCC startup objects are built under assumption that `libgcc` is the one true place for the unwind info registry, so I couldn't find any better way than to replace them.  So out go `crtbegin`/`crtend`, in come `rsbegin`/`rsend`!  

A side benefit of this change is that rustc is now more in control of the command line that goes to the linker, so we could stop using `gcc` as the linker driver and just invoke `ld` directly.
2015-11-01 17:15:29 +00:00
bors
6d43fef3aa Auto merge of #29486 - petrochenkov:multiwild, r=Manishearth
Motivation:
- It is not actually a pattern
- It is not actually needed, except for...

Drawback:
- Slice patterns like `[a, _.., b]` are pretty-printed as `[a, .., b]`. Great loss :(

plugin-[breaking-change], as always
2015-11-01 13:36:49 +00:00
Vadim Petrochenkov
306b0efc44 Add comment for stability.rs 2015-11-01 16:33:46 +03:00
Manish Goregaokar
8bb72cfe00 Add code formatting on PatVec docs 2015-11-01 16:37:12 +05:30
Manish Goregaokar
7e9d73cf2d Fix PatEnum docs 2015-11-01 16:32:51 +05:30
bors
a5fbb3a25f Auto merge of #29316 - GBGamer:change-unchecked-div-generic, r=eddyb
Similarly to the simd intrinsics. I believe this is a better solution than #29288, and I could implement it as well for overflowing_add/sub/mul. Also rename from udiv/sdiv to div, and same for rem.
2015-11-01 07:03:09 +00:00
Vadim Chugunov
4e0c6db67f Windows: Move target libraries to $rustroot/lib/rustlib/... - for symmetry with all other platforms. 2015-10-31 23:29:39 -07:00
bors
b252f4c826 Auto merge of #29496 - cpjreynolds:patch-1, r=apasel422
Corrects `write_bytes`'s documentation as the parameter name is `val` not `c`.
2015-11-01 04:23:18 +00:00
Vadim Chugunov
0332ee9f63 Fix stage0 ICE caused by the old _Unwind_Resume override trickery. 2015-10-31 18:52:37 -07:00
Cole Reynolds
87c9fd2b42 Minor documentation correction
Corrects `write_bytes`'s documentation as the parameter name is `val` not `c`.
2015-10-31 20:31:16 -04:00
Nicholas Mazzuca
579420fbdd Check unchecked_div|rem's specialisation
Similarly to the simd intrinsics.
2015-10-31 12:22:15 -07:00
Alex Crichton
8588654783 std: Prevent print panics when using TLS
Currently if a print happens while a thread is being torn down it may cause a
panic if the LOCAL_STDOUT TLS slot has been destroyed by that point. This adds a
guard to check and prints to the process stdout if that's the case (as we do for
if the slot is already borrowed).

Closes #29488
2015-10-31 09:41:21 -07:00
bors
1a2eaffb63 Auto merge of #29487 - sfackler:current-exe-docs, r=steveklabnik
The "optionally" stuff just makes things confusing.

r? @steveklabnik
2015-10-31 14:13:43 +00:00
bors
57a0df6db5 Auto merge of #29489 - Ms2ger:fmt-ri, r=Manishearth
CC @nrc
2015-10-31 10:58:41 +00:00
Ms2ger
eb5c0a6b68 Rustfmt region_inference. 2015-10-31 11:31:52 +01:00
Steven Fackler
4af19537b2 Tweak env docs a bit
The "optionally" stuff just makes things confusing.
2015-10-30 22:13:32 -07:00
bors
fa7a3c210d Auto merge of #29484 - steveklabnik:gh29330, r=brson
These two commits do a few things:

1. reformat to 80 cols
2. use the reference-style links where appropriate for improved in-source readability
3. adds a few links, tweaks a couple of words, `3` -> `three`, stuff like that

While the diff is big due to these edits, there's no significant content change.

r? @brson
2015-10-31 04:04:45 +00:00
bors
ee88e04e77 Auto merge of #29480 - apasel422:coerce-unique, r=alexcrichton
Closes rust-lang/rfcs#1343.
2015-10-31 01:58:51 +00:00
Vadim Petrochenkov
3468b8d42c Remove PatWildMulti 2015-10-31 03:44:43 +03:00
bors
11ba81e105 Auto merge of #29477 - alexcrichton:revert-compiler-rt, r=brson
This ended up causing regressions in a few builds I've seen:

* MinGW -- [64-bit](https://ci.appveyor.com/project/alexcrichton/gcc-rs/build/1.0.338/job/2c4pkxgxa2dvqs25) and [32-bit](https://ci.appveyor.com/project/alexcrichton/gcc-rs/build/1.0.338/job/d0n7kml3k5el9gla)
- MSVC - [64-bit with VS 12.0](https://ci.appveyor.com/project/alexcrichton/gcc-rs/build/job/ugldcage9ydoy1k6) and [32-bit with VS 12.0](https://ci.appveyor.com/project/alexcrichton/gcc-rs/build/job/pn59p4rhnj8gybei).

I suspect the problems are along the lines of:

* The emutls support needs to be disabled on Windows, it currently always used pthreads which isn't available
* The objects in compiler-rt either need to be built without a CRT or not specifically against the static one.
2015-10-31 00:09:39 +00:00
bors
64b0277643 Auto merge of #29454 - stepancheg:vec-reserve, r=bluss
Before this patch `reserve` function allocated twice as requested
amount elements (not twice as capacity).  It leaded to unnecessary
excessive memory usage in scenarios like this:

```
let mut v = Vec::new();
v.push(17);
v.extend(0..10);
println!("{}", v.capacity());
```

`Vec` allocated 22 elements, while it could allocate just 11.

`reserve` function must have a property of keeping `push` operation
cost (which calls `reserve`) `O(1)`. To achieve this `reserve` must
exponentialy grow its capacity when it does reallocation.

There's better strategy to implement `reserve`:

```
let new_capacity = max(current_capacity * 2, requested_capacity);
```

This strategy still guarantees that capacity grows at `O(1)` with
`reserve`, and fixes the issue with `extend`.

Patch imlpements this strategy.
2015-10-30 22:23:41 +00:00
Steve Klabnik
744df28758 Some fixes to std index docs
Part of https://github.com/rust-lang/rust/issues/29330

Needed because of https://github.com/rust-lang/rust/issues/29481 and https://github.com/rust-lang/rust/issues/29483
2015-10-30 17:43:05 -04:00
Steve Klabnik
e2906dbeac Clean up formatting on std main page
Part of #29330
2015-10-30 17:18:26 -04:00
Stepan Koltsov
46068c9daf Fix excessive memory allocation in RawVec::reserve
Before this patch `reserve` function allocated twice as requested
amount elements (not twice as capacity).  It leaded to unnecessary
excessive memory usage in scenarios like this:

```
let mut v = Vec::new();
v.push(17);
v.extend(0..10);
println!("{}", v.capacity());
```

`Vec` allocated 22 elements, while it could allocate just 11.

`reserve` function must have a property of keeping `push` operation
cost (which calls `reserve`) `O(1)`. To achieve this `reserve` must
exponentialy grow its capacity when it does reallocation.

There's better strategy to implement `reserve`:

```
let new_capacity = max(current_capacity * 2, requested_capacity);
```

This strategy still guarantees that capacity grows at `O(1)` with
`reserve`, and fixes the issue with `extend`.

Patch imlpements this strategy.
2015-10-31 00:17:16 +03:00
Andrew Paseltiner
04266daf77 Implement CoerceUnsized for Unique
Closes rust-lang/rfcs#1343.
2015-10-30 16:38:29 -04:00
bors
cc8d398e28 Auto merge of #29475 - apasel422:drop-in, r=alexcrichton
This is a rebase of #27204.

r? @alexcrichton 
CC @Gankro
2015-10-30 19:06:43 +00:00
Alex Crichton
f351b69edd Revert "Build compiler-rt/builtins with MSVC"
This reverts commit b09e8f51a2.
2015-10-30 10:36:38 -07:00
Alex Crichton
9e99367316 Revert "Update compiler-rt"
This reverts commit 6e61c6f119.
2015-10-30 10:36:34 -07:00
bors
2aa9f7d391 Auto merge of #29468 - ronindev:patch-1, r=alexcrichton
There are no `rm` commands on windows. But windows has `del`
2015-10-30 16:18:11 +00:00
Alexis Beingessner
e351595c61 don't use drop_in_place as an intrinsic 2015-10-30 11:24:54 -04:00
Alexis Beingessner
e72c226bed expose drop_in_place as ptr::drop_in_place 2015-10-30 10:54:25 -04:00
pierzchalski
054e409651 Add JSON parser rule for custom_unwind_resume. 2015-10-30 20:17:01 +11:00
Igor Shuvalov
66425568b3 Fixed delete command on Windows 2015-10-30 09:25:55 +03:00
bors
914c4dbc2a Auto merge of #29458 - tshepang:better, r=alexcrichton
I see that `extend()` is not called if new_len > len()
2015-10-30 01:28:12 +00:00
bors
2e07996a9b Auto merge of #29199 - tshepang:they-can, r=steveklabnik 2015-10-29 23:39:34 +00:00
Tshepang Lekhonkhobe
37735b4d6d run rustfmt on std::path
There was a bunch of manual fixes too... rustfmt isn't quite there yet
2015-10-30 01:15:00 +02:00
bors
7646fcfe54 Auto merge of #29452 - SimonSapin:patch-14, r=alexcrichton
… I think.
2015-10-29 20:46:44 +00:00
Tshepang Lekhonkhobe
898f3af1ce book: it's just doctests that can't be run on binary files 2015-10-29 22:45:09 +02:00
Tshepang Lekhonkhobe
d7a5aba2d3 doc: fix and expand explanation
I see that `extend()` is not called if new_len > len()
2015-10-29 21:40:56 +02:00
Tshepang Lekhonkhobe
615275b7b8 doc: make example more simple 2015-10-29 21:11:24 +02:00
bors
4d11db6501 Auto merge of #29129 - cuviper:impl-from-for-floats, r=alexcrichton
This is a spiritual successor to #28921, completing the "upcast" idea from rust-num/num#97.
2015-10-29 18:55:12 +00:00
Vadim Petrochenkov
61cbc84480 Make fields and macro defs exported 2015-10-29 21:54:55 +03:00
Brian Anderson
018c468e18 Address release notes feedback 2015-10-29 11:36:56 -07:00
bors
a18e0b2707 Auto merge of #29445 - igpay:patch-1, r=alexcrichton
This documentation confused me when trying to use truncate on a project. Originally, it was unclear whether truncate removed the last `len` elements, or whether it cut down the vector to be exactly `len` elements long. The example was also ambiguous.
2015-10-29 16:03:46 +00:00