Commit Graph

44372 Commits

Author SHA1 Message Date
Mathijs van de Nes
a89b3ea3fc Use wrapping_div call and correct the feature name 2015-07-08 15:44:50 +02:00
Mathijs van de Nes
e333a57a19 Implement Div for Wrapping<T>
Resolves #26867
2015-07-08 15:02:18 +02:00
Björn Steinbrink
9f4d5b4be1 Improve PartialEq for slices
Exploiting the fact that getting the length of the slices is known, we
can use a counted loop instead of iterators, which means that we only
need a single counter, instead of having to increment and check one
pointer for each iterator.

Benchmarks comparing vectors with 100,000 elements:

Before:

```
running 8 tests
test eq1_u8  ... bench:      66,757 ns/iter (+/- 113)
test eq2_u16 ... bench:     111,267 ns/iter (+/- 149)
test eq3_u32 ... bench:     126,282 ns/iter (+/- 111)
test eq4_u64 ... bench:     126,418 ns/iter (+/- 155)
test ne1_u8  ... bench:      88,990 ns/iter (+/- 161)
test ne2_u16 ... bench:      89,126 ns/iter (+/- 265)
test ne3_u32 ... bench:      96,901 ns/iter (+/- 92)
test ne4_u64 ... bench:      96,750 ns/iter (+/- 137)
```

After:

```
running 8 tests
test eq1_u8  ... bench:      46,413 ns/iter (+/- 521)
test eq2_u16 ... bench:      46,500 ns/iter (+/- 74)
test eq3_u32 ... bench:      50,059 ns/iter (+/- 92)
test eq4_u64 ... bench:      54,001 ns/iter (+/- 92)
test ne1_u8  ... bench:      47,595 ns/iter (+/- 53)
test ne2_u16 ... bench:      47,521 ns/iter (+/- 59)
test ne3_u32 ... bench:      44,889 ns/iter (+/- 74)
test ne4_u64 ... bench:      47,775 ns/iter (+/- 68)
```
2015-07-08 14:49:55 +02:00
Peter Atashian
da5ab9921e Report memory use in time-passes on Windows
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-07-08 08:29:41 -04:00
Andreas Tolfsen
8792c5c040 librustdoc: generalise handling of keyboard shortcuts 2015-07-08 13:12:18 +01:00
Andreas Tolfsen
885e701f0b librustdoc: sharpen help dialogue edges
Sharpens the help dialogues edges by removing border-padding, which
matches better with the rest of the document.

Also increases somewhat the rounded edges of the key symbols to
make it clear they are symbols.

Also introduces closing apostrophes and ellipsis for search field
placeholder.
2015-07-08 13:10:39 +01:00
Guillaume Gomez
d1658679ca Add E0191 error explanation 2015-07-08 12:57:48 +02:00
Esption
492f33a267 Fixed some occurrences of 'if' being spelled 'iff' 2015-07-08 05:29:03 -05:00
bors
50df2a09b8 Auto merge of #26863 - brson:revert-stageversion, r=alexcrichton
This reverts https://github.com/rust-lang/rust/pull/26599, which puts the stage number in the output of `--version -v`, but is not supposed to put it in the 'stage2' compiler, which is what most people refer to the binary we deploy.

The picture is not so clear though because of how stage 'promotions' happen in the build and also because the windows build deploys stage3, not stage2.

cc @richo
2015-07-08 07:26:42 +00:00
bors
fd8e175c4e Auto merge of #26859 - arielb1:const-deref-again, r=eddyb
Fixes #25901 

r? @eddyb
2015-07-08 03:11:36 +00:00
Alex Crichton
d23239b48e msvc: Get codegen-units working
This commit alters the implementation of multiple codegen units slightly to be
compatible with the MSVC linker. Currently the implementation will take the N
object files created by each codegen unit and will run `ld -r` to create a new
object file which is then passed along. The MSVC linker, however, is not able to
do this operation.

The compiler will now no longer attempt to assemble object files together but
will instead just pass through all the object files as usual. This implies that
rlibs may not contain more than one object file (if the library is compiled with
more than one codegen unit) and the output of `-C save-temps` will have changed
slightly as object files with the extension `0.o` will not be renamed to `o`
unless requested otherwise.
2015-07-07 20:07:20 -07:00
bors
e6a9be10bc Auto merge of #26861 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #26742, #26852, #26853, #26854, #26855, #26857
- Failed merges: #26796
2015-07-07 21:28:54 +00:00
Brian Anderson
147da94206 Revert "rustc_driver: Print stage info in --version --verbose"
This reverts commit 555b021c6e.
2015-07-07 10:54:06 -07:00
Brian Anderson
04dfdd7403 Revert "rustc_driver: Omit stage info for stage2+"
This reverts commit e66ac43ea4.
2015-07-07 10:53:54 -07:00
bors
5d53921eff Auto merge of #26747 - huonw:stability-issue, r=alexcrichton
This takes an issue number and points people to it in the printed error
message. This commit does not make it an error to have no `issue` field.
2015-07-07 17:41:43 +00:00
Ariel Ben-Yehuda
45fd29621d mark user-defined derefs as non-constant
Fixes #25901
2015-07-07 18:48:28 +03:00
Ariel Ben-Yehuda
445824b29f use is_method_call rather than directly accessing the method_map 2015-07-07 18:48:27 +03:00
Steve Klabnik
bead66b0ef Rollup merge of #26857 - GuillaumeGomez:patch-1, r=steveklabnik 2015-07-07 09:49:56 -04:00
Guillaume Gomez
3c76163e1d Add missing "```" 2015-07-07 19:37:54 +02:00
Steve Klabnik
b6c7dff728 Rollup merge of #26855 - steveklabnik:gh26344, r=alexcrichton
Fixes #26344
2015-07-07 09:49:56 -04:00
Steve Klabnik
743a9e6cae Rollup merge of #26854 - steveklabnik:gh26345, r=alexcrichton
I am not mentioning #[unsafe_drop_flag] because it should go away
eventually, and also because it's just an attribute, it's not
really a use of the `unsafe` keyword.

Fixes #26345
2015-07-07 09:49:56 -04:00
Steve Klabnik
10c795a6ea Rollup merge of #26853 - steveklabnik:gh26346, r=Gankro
This incorrectly implied that doing things is fine in unsafe code

Fixes #26346
2015-07-07 09:49:55 -04:00
Steve Klabnik
bc28e64fb3 Re-word UB in unsafe guide
This incorrectly implied that doing things is fine in unsafe code

Fixes #26346
2015-07-07 12:52:20 -04:00
Steve Klabnik
a97687e521 Rollup merge of #26852 - steveklabnik:gh26375, r=alexcrichton
Fixes #26375
2015-07-07 09:49:55 -04:00
Steve Klabnik
c69663caf6 Rollup merge of #26742 - GuillaumeGomez:patch-2, r=arielb1
Part of #24407.
r? @Manishearth
2015-07-07 09:49:55 -04:00
Steve Klabnik
4b19be3631 Not literally all of concurrency is a library
Fixes #26344
2015-07-07 09:29:04 -04:00
Steve Klabnik
73df19a206 There are four uses of unsafe, actually
I am not mentioning #[unsafe_drop_flag] because it should go away
eventually, and also because it's just an attribute, it's not
really a use of the `unsafe` keyword.

Fixes #26345
2015-07-07 09:26:23 -04:00
Steve Klabnik
f29b565e2d Describe lifetime syntax for impl
Fixes #26375
2015-07-07 09:19:26 -04:00
bors
ed14593d98 Auto merge of #26699 - eddyb:unstable-prelude_import, r=huonw
Closes #26690.
2015-07-07 07:34:56 +00:00
bors
26f0cd5de7 Auto merge of #26844 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #26599, #26761, #26807, #26809, #26825, #26827, #26828, #26832, #26834, #26835
- Failed merges: #26796
2015-07-07 02:26:31 +00:00
bors
6d71ce5364 Auto merge of #26599 - richo:richo-stage-info, r=brson
This will add information about the stage that a rustc was built with to the verbose version info

I have symlinks into $(HOST)/stage{0,1,2} into the rust version switcher thing I use, and occasionally need to know which stage a given rustc is.
2015-07-06 22:55:07 +00:00
Steve Klabnik
04a85c538a Rollup merge of #26835 - tshepang:copy-or-not, r=steveklabnik 2015-07-06 18:06:31 -04:00
Steve Klabnik
c4ee2e5c01 Rollup merge of #26834 - tshepang:space, r=brson 2015-07-06 18:06:31 -04:00
Steve Klabnik
8d94bbf106 Rollup merge of #26832 - steveklabnik:doc_rustc_cycle_time, r=huonw 2015-07-06 18:06:30 -04:00
Steve Klabnik
3e62e20b61 Rollup merge of #26828 - steveklabnik:gh25765, r=bluss
Each formatting trait now has an example of implementation, as well as a
fuller description of what it's supposed to output.

It also contains a link to the module-level documentation which

Fixes #25765
2015-07-06 18:06:30 -04:00
Steve Klabnik
015441bd5d Rollup merge of #26827 - steveklabnik:gh25786, r=alexcrichton
Fixes #25786
2015-07-06 18:06:30 -04:00
Steve Klabnik
29aabcc7c4 Rollup merge of #26825 - steveklabnik:gh24802, r=alexcrichton
Fixes #24802
2015-07-06 18:06:30 -04:00
Steve Klabnik
58d0f28057 Rollup merge of #26809 - cmr:libc-ioctl, r=alexcrichton
None
2015-07-06 18:06:29 -04:00
Steve Klabnik
539cc55018 Rollup merge of #26807 - eddyb:trans-normalize, r=cmr
Fixes #26805. f? @jroesch.
2015-07-06 18:06:29 -04:00
Steve Klabnik
aef38ef819 Rollup merge of #26761 - steveklabnik:actually_ub, r=alexcrichton
I incorrectly stated that it's an abort.

r? @Gankro
2015-07-06 18:06:29 -04:00
Steve Klabnik
b959f256bf Rollup merge of #26599 - richo:richo-stage-info, r=brson
This will add information about the stage that a rustc was built with to the verbose version info

I have symlinks into $(HOST)/stage{0,1,2} into the rust version switcher thing I use, and occasionally need to know which stage a given rustc is.
2015-07-06 18:06:29 -04:00
Steve Klabnik
3a6cd649b4 Significantly improve formatter trait docs
Each formatting trait now has an example of implementation, as well as a
fuller description of what it's supposed to output.

It also contains a link to the module-level documentation which

Fixes #25765
2015-07-06 17:26:59 -04:00
bors
9d9e2678f5 Auto merge of #26757 - oli-obk:style_fixes, r=brson
the indentation has always been a thorn in my eye.

If it's preferred I'll leave the `unsafe` where it was and change it to

```rust
unsafe { match e.node {
    ...
} } // unsafe { match e.node {
```

so there's no unnecessary indent
2015-07-06 21:22:20 +00:00
Steve Klabnik
720da310a9 Add note about special make targets 2015-07-06 17:01:04 -04:00
Richo Healey
e66ac43ea4 rustc_driver: Omit stage info for stage2+ 2015-07-06 13:42:10 -07:00
Tshepang Lekhonkhobe
dd78ffe828 reference: make 'Move and copied types' section more simple 2015-07-06 22:10:35 +02:00
Tshepang Lekhonkhobe
c2f4f11443 reference: do not display the extra space 2015-07-06 22:01:20 +02:00
Steve Klabnik
ee43c5e2f0 FFI panic is UB
I incorrectly stated that it's an abort.
2015-07-06 16:00:31 -04:00
bors
2ceaa77ae2 Auto merge of #26741 - alexcrichton:noinline-destructors, r=brson
This PR was originally going to be a "let's start running tests on MSVC" PR, but it didn't quite get to that point. It instead gets us ~80% of the way there! The steps taken in this PR are:

* Landing pads are turned on by default for 64-bit MSVC. The LLVM support is "good enough" with the caveat the destructor glue is now marked noinline. This was recommended [on the associated bug](https://llvm.org/bugs/show_bug.cgi?id=23884) as a stopgap until LLVM has a better representation for exception handling in MSVC. The consequence of this is that MSVC will have a bit of a perf hit, but there are possible routes we can take if this workaround sticks around for too long.
* The linker (`link.exe`) is now looked up in the Windows Registry if it's not otherwise available in the environment. This improves using the compiler outside of a VS shell (e.g. in a MSYS shell or in a vanilla cmd.exe shell). This also makes cross compiles via Cargo "just work" when crossing between 32 and 64 bit!
* TLS destructors were fixed to start running on MSVC (they previously weren't running at all)
* A few assorted `run-pass` tests were fixed.
* The dependency on the `rust_builtin` library was removed entirely for MSVC to try to prevent any `cl.exe` compiled objects get into the standard library. This should help us later remove any dependence on the CRT by the standard library.
* I re-added `rust_try_msvc_32.ll` for 32-bit MSVC and ensured that landing pads were turned off by default there as well.

Despite landing pads being enabled, there are still *many* failing tests on MSVC. The two major classes I've identified so far are:

* Spurious aborts. It appears that when optimizations are enabled that landing pads aren't always lined up properly, and sometimes an exception being thrown can't find the catch block down the stack, causing the program to abort. I've been working to reduce this test case but haven't been met with great success just yet.
* Parallel codegen does not work on MSVC. Our current strategy is to take the N object files emitted by the N codegen threads and use `ld -r` to assemble them into *one* object file. The MSVC linker, however, does not have this ability, and this will need to be rearchitected to work on MSVC.

I will fix parallel codegen in a future PR, and I'll also be watching LLVM closely to see if the aborts... disappear!
2015-07-06 19:49:16 +00:00
Richo Healey
555b021c6e rustc_driver: Print stage info in --version --verbose 2015-07-06 12:41:30 -07:00