Commit Graph

44917 Commits

Author SHA1 Message Date
Steve Klabnik
ff664f3c6c More docs for std::io::Read 2015-07-16 13:38:11 -04:00
Steve Klabnik
2074b19bdc More docs for std::io::BufRead 2015-07-16 13:38:07 -04:00
Michael Woerister
f9a20bb206 debuginfo: Fix type description generic enum discriminants. 2015-07-16 09:13:38 -07:00
Lee Jeffery
4ec64453ae Fix typo in stability attribute. 2015-07-16 14:36:05 +01:00
Manish Goregaokar
69e6dc0444 Fix diagnostics name clash 2015-07-16 17:20:18 +05:30
Guillaume Gomez
a5d8c43687 Improve register_diagnostics macro 2015-07-16 13:16:59 +02:00
Manish Goregaokar
7c202a39c1 Fixup test 2015-07-16 16:37:41 +05:30
Manish Goregaokar
30ac7e78e2 Fixup #27046 with pattern bindings 2015-07-16 16:37:40 +05:30
Manish Goregaokar
2a74fa3582 Rollup merge of #27046 - nrc:driver-defaults, r=alexcrichton 2015-07-16 16:37:40 +05:30
Manish Goregaokar
c8ec909cdd Rollup merge of #27039 - bluss:siphash-tests, r=alexcrichton
core: Revive SipHash's tests

These tests were bitrotting, include them in the crate and bring them up
to date and compiling.. and they pass.
2015-07-16 16:37:40 +05:30
Manish Goregaokar
77d5fca3ef Rollup merge of #27030 - nrc:save-ctors, r=alexcrichton 2015-07-16 16:37:40 +05:30
Manish Goregaokar
b8a9c80166 Rollup merge of #27019 - akiss77:pr-aarch64-morestack-section, r=alexcrichton
When building for AArch64/Linux, __morestack ends up in the .note.GNU-stack section,
which causes missing references for the linker. By using the func/endfunc macros
from macros.S we get __morestack right to .text (and a bit more on the side).
2015-07-16 16:37:40 +05:30
Manish Goregaokar
b64af26625 Rollup merge of #27018 - arielb1:enum-update, r=eddyb
Fixes #26948.

r? @eddyb
2015-07-16 16:37:39 +05:30
Manish Goregaokar
31d6716d9c Rollup merge of #26988 - frewsxcv:regression-tests, r=alexcrichton
"body": null,
2015-07-16 16:37:39 +05:30
Manish Goregaokar
12899e73a0 Rollup merge of #26950 - AlisdairO:memset, r=alexcrichton
In general, it's undesirable to have read_to_end use a buffer with uninitialized memory, as that could lead to undefined behaviour in the event of a bad Read implementation.  Since we control the implementations of Read for Stdin and File, however, it should be okay for us to specialise them to improve performance.  This PR is to do that!

Adds some unsafe code to deal with creating the buffers.  Since the read_to_end function needed to be used from the io and fs crates, I moved it into a newly-created sys::common::io module.  Alternatively we could expose the new read_to_end functions to allow people to create their own read_to_end implementations for code they trust.

Benchmarks:

Read a 2.5MB file:
sys_common::io::tests::bench_init_file      ... bench:  27,473,317 ns/iter (+/- 2,490,767)
sys_common::io::tests::bench_uninit_file    ... bench:  25,611,793 ns/iter (+/- 2,137,387)

Read a buffer full of constant values
sys_common::io::tests::bench_uninitialized  ... bench:  12,877,645 ns/iter (+/- 931,025)
sys_common::io::tests::bench_zeroed         ... bench:  18,581,082 ns/iter (+/- 1,541,108)

So, approx a 7% speedup for file reading, which I think is worthwhile.
2015-07-16 14:13:38 +05:30
Manish Goregaokar
1da1a46d56 Rollup merge of #26898 - GuillaumeGomez:fixup, r=eddyb
r? @eddyb

First part of the improvement. I then intend to improve resolve_error as indicated by @eddyb. Do not merge for now (please !).
2015-07-16 14:13:25 +05:30
Manish Goregaokar
38e875aa80 Rollup merge of #26838 - P1start:refactor-diagnostic, r=alexcrichton 2015-07-16 14:13:10 +05:30
Manish Goregaokar
828ebb805a Rollup merge of #26819 - P1start:ref-suggestion, r=nikomatsakis
The error now looks like this:

```
<anon>:4:9: 4:10 error: use of moved value: `x` [E0382]
<anon>:4     foo(x);
                 ^
<anon>:3:9: 3:10 note: `x` moved here because it has type `Box<i32>`, which is moved by default
<anon>:3     let y = x;
                 ^
<anon>:3:9: 3:10 help: use `ref` to take a reference instead:
<anon>:      let ref y = x;
```
2015-07-16 14:12:57 +05:30
Manish Goregaokar
43bb514984 Rollup merge of #27029 - nrc:save-pub-gen-code, r=alexcrichton 2015-07-16 10:49:37 +05:30
Manish Goregaokar
2c49927ae4 Rollup merge of #27028 - Gankro:travis, r=alexcrichton
This has travis build LLVM and rustc up to stage1, but not run any tests. It seems wasteful to have the ultimate might of travis running on every PR just to check for whitespace errors. This is a pure subset of the bootstrap, so it shouldn't ever spuriously break.

`make tidy` still runs first, so we still get \"fast errors\" on bad style. However once make tidy passes, the build will simply keep running to try to make rustc. `tidy` takes ~3 mins to complete, so if your build runs longer you can be confident we've gone on to build LLVM/rustc. In principle this is configured to use ccache (it shows up in the build logs as uploaded/downloaded), but I found no actual performance changes in using it.

Maybe someone at @travis-ci knows what's up with that.

For reference, here is a successful build with ccache enabled: https://travis-ci.org/Gankro/rust/builds/70821237

and one without: https://travis-ci.org/Gankro/rust/builds/70812814

Builds seem to take about 41mins regardless.

r? @alexcrichton
2015-07-16 10:49:23 +05:30
Manish Goregaokar
a4060d02cb Rollup merge of #27020 - goyox86:goyox86/fix-error-handling-snippet, r=steveklabnik
This PR fixes a snippet of code on the error handling chapter of \"The Rust Programming Language\".

//cc @steveklabnik

The docs state that trying to compile the snippet will yield the following error:

```bash
anon>:13:5: 20:6 error: non-exhaustive patterns: `_` not covered [E0004]
```

But instead the error received is:

```bash
<anon>:22:46: 22:56 error: unresolved name `NewRelease`
<anon>:22     std::io::println(descriptive_probability(NewRelease));
                                                       ^~~~~~~~~~
<anon>:22:5: 22:21 error: unresolved name `std::io::println`
<anon>:22     std::io::println(descriptive_probability(NewRelease));
              ^~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
playpen: application terminated with error code 101
```

After applying this PR the expected error is returned:

```bash
anon>:13:5: 20:6 error: non-exhaustive patterns: `_` not covered [E0004]
<anon>:13     match probability(&event) {
<anon>:14         1.00 => \"certain\",
<anon>:15         0.00 => \"impossible\",
<anon>:16         0.00 ... 0.25 => \"very unlikely\",
<anon>:17         0.25 ... 0.50 => \"unlikely\",
<anon>:18         0.50 ... 0.75 => \"likely\",
          ...
<anon>:13:5: 20:6 help: see the detailed explanation for E0004
error: aborting due to previous error
```
2015-07-16 10:49:08 +05:30
Manish Goregaokar
62bb71e83a Rollup merge of #27013 - michaelsproul:fix-E0303, r=alexcrichton
A merge in #24523  broke the explanation for E0303. This commit restores the previous version and also removes an erroneous `&` (which had nothing to do with the merge).
2015-07-16 10:48:58 +05:30
Manish Goregaokar
3a5bc736ae Rollup merge of #26977 - brson:stddoc, r=Gankro
Yet another attempt to make the prose on the std crate page
clearer and more informative.

This does a lot of things: tightens up the opening, adds useful links
(including a link to the search bar), offers guidance on how to use
the docs, and expands the prelude docs as a useful newbie entrypoint.

r? @steveklabnik cc @aturon
2015-07-16 10:48:47 +05:30
Manish Goregaokar
9ac3f42771 Rollup merge of #26695 - rutsky:patch-2, r=Manishearth
r? @steveklabnik
2015-07-16 10:48:36 +05:30
Manish Goregaokar
98475320f2 Rollup merge of #26693 - rutsky:patch-1, r=Manishearth
r? @steveklabnik
2015-07-16 10:48:28 +05:30
Manish Goregaokar
feb06b12e7 Rollup merge of #27061 - tamird:patch-1, r=alexcrichton
It was removed in bba934f19a.

Fixes #27059.
2015-07-16 10:48:10 +05:30
Tamir Duberstein
e1073dd501 Remove reference to gdb-pretty-struct-and-enums.rs
It was removed in bba934f19a.

Fixes #27059.
2015-07-15 23:51:51 -04:00
Vincent Bernat
cfa8e48b21 doc: add rel=prev/next for links to adjacent sections
This help people using keyboard navigation or with disabilities to
easily browse through pagination. For example, in Vimium, a reader can
do `[[` or `]]` to browse through the pages.
2015-07-15 23:32:58 +02:00
Alisdair Owens
98f287240f Add specializations of read_to_end for Stdin, TcpStream and File,
allowing them to read into a buffer containing uninitialized data,
rather than pay the cost of zeroing.
2015-07-15 21:30:18 +01:00
Nick Hamann
560bb0af6d Better detection of duplicate associated items.
Expands E0201 to be used for any duplicate associated items, not just duplicate
methods/functions. It also correctly detects when two different kinds of items
(like a constant and a method) have the same name.

Fixes #23969.
2015-07-15 13:32:29 -05:00
Alexis Beingessner
e8a03285b7 Ratchet up travis to build stage1 and our own LLVM.
Tidy is still run first for failing fast on the easy stuff.

To accomplish this we have travis actually persist ccache across builds. This
has LLVM built within 6 minutes, and all of stage1 built within 18.
Caching should work on fresh PRs (cache acquired from the master branch).
Because all we persist is ccache, there is minimal danger of persisting corrupt
build state.

I had to mangle `configure` a bit to make --enable-ccache work when custom
compilers are provide via CC and CXX.
2015-07-15 10:48:50 -07:00
Simonas Kazlauskas
22502154e6 Implement lint deprecation/removal…
and deprecate/remove unsigned_negation lint.

This is useful to avoid causing breaking changes in case #![deny(unknown_lints)]
is used and lint is removed.
2015-07-15 20:16:58 +03:00
Nick Hamann
5ec1deae3b Change int/uint => isize/usize in compiler docs. 2015-07-14 21:27:06 -05:00
Nick Cameron
441b1c6103 Some more default implementations for the compiler driver callbacks. 2015-07-15 11:38:24 +12:00
Niko Matsakis
de6b3c282e Transition to the new object lifetime defaults, replacing the old
defaults completely.
2015-07-14 19:36:15 -04:00
Brian Anderson
2881bbad59 Address more feedback 2015-07-14 14:41:50 -07:00
Simonas Kazlauskas
0c9e3dc75c Fix negate_unsigned feature gate check
This commit fixes the negate_unsigned feature gate to appropriately
account for infered variables.

This is technically a [breaking-change].
2015-07-14 21:48:43 +03:00
Steven Allen
833e88db52 Don't mention packed attribute in reference.md 2015-07-14 14:04:21 -04:00
Guillaume Gomez
60133aa6dd Remove macro, import function and enum 2015-07-14 19:53:09 +02:00
Brian Anderson
a266ab0563 Mention that removal of #[packed] was a breaking change in 1.2 2015-07-14 10:32:23 -07:00
Brian Anderson
6d5ae6b20d Address more feedback 2015-07-14 10:27:33 -07:00
Ulrik Sverdrup
86d954ba2b core: Revive SipHash's tests
These tests were bitrotting, include them in the crate and bring them up
to date and compiling.. and they pass.
2015-07-14 18:41:04 +02:00
Ariel Ben-Yehuda
a878f35d3b don't ICE when FRU is used on an enum variant
Fixes #26948.
2015-07-14 18:58:18 +03:00
Guillaume Gomez
31262c206e Arguments are now passed directly to the function instead of the enum variants 2015-07-14 16:32:43 +02:00
Corey Farwell
7954096bc8 Add regression test for #21140
Closes #21140
2015-07-14 22:57:55 +09:00
Guillaume Gomez
c5f7c19cf2 End of error code spanning centralization 2015-07-14 15:37:52 +02:00
bors
e4e93196e1 Auto merge of #27024 - bluss:io-drain, r=alexcrichton
Use Vec::drain in BufWriter

I happened past a comment that asked for functionality that we now have.
2015-07-14 11:13:21 +00:00
Nick Cameron
49d3a93c52 save-analysis: fix def_ids for method calls
We were sometime emitting the decl as a def.
2015-07-14 22:10:40 +12:00
Ulrik Sverdrup
7b51c1c573 Use Vec::drain in BufWriter
I happened past a comment that asked for functionality that we now have.
2015-07-14 11:43:24 +02:00
Nick Cameron
94f13ac376 save-analysis: handle a few more kinds of paths 2015-07-14 20:56:25 +12:00