Commit Graph

44421 Commits

Author SHA1 Message Date
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
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
Brian Anderson
2881bbad59 Address more feedback 2015-07-14 14:41:50 -07: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
Guillaume Gomez
31262c206e Arguments are now passed directly to the function instead of the enum variants 2015-07-14 16:32:43 +02: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
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
bors
5708b1a18a Auto merge of #27016 - alexcrichton:inline-asm-docs, r=steveklabnik
Hot off the press, we've now got some nice documentation to link to in LLVM
officially!
2015-07-14 07:51:04 +00:00
bors
137a699cc3 Auto merge of #27015 - frankmcsherry:patch-1, r=steveklabnik
Grammatical update (and passive -> active, but I'm not sure if "Rust" is often used as a subject in the book; feel free to revert that part for style, but keep the subject-verb agreement)

r? @steveklabnik
2015-07-14 06:19:08 +00:00
bors
c8cddde207 Auto merge of #27002 - IvanUkhov:docblock-pre-code, r=Gankro
The current nonzero side padding of `code` tags is good for legibility in paragraphs and lists; however, it introduces an awkward indentation to `pre` tags. Specifically, when a `pre` tag contains preformatted text with multiple lines, the fist line gets pushed slightly to the right, running the vertical alignment. An example can be seen [here](http://doc.rust-lang.org/std/fmt/#syntax). I propose setting the padding to zero for `code`s contained in `pre`s.


Regards,
Ivan
2015-07-14 04:00:26 +00:00
Nick Cameron
e6e6368454 save-analysis: make generated_code pub 2015-07-14 13:40:02 +12:00
Brian Anderson
3a180d15f8 Address feedback 2015-07-13 18:38:00 -07:00
Brian Anderson
4089ba873e Fix local path 2015-07-13 17:56:47 -07:00
Brian Anderson
68781e25c5 std: Refining crate docs
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.
2015-07-13 17:56:47 -07:00
bors
dd46cf8b22 Auto merge of #26241 - SimonSapin:derefmut-for-string, r=alexcrichton
See https://github.com/rust-lang/rfcs/issues/1157
2015-07-13 23:47:06 +00:00
bors
72483f58e3 Auto merge of #27006 - ryanp-me:apple-llvm, r=brson
Since Apple LLVM no longer reports which version of LLVM it's based off (starting with 7.0.0), I believe it's time to start checking Apple LLVM versions directly.

The changes in this pull request update the `configure` script to check "Apple LLVM" versions independently if no "based off" version can be found. If a "based off" version is included, however, it will be preferred.

(This is a less hacky version of #26653)
2015-07-13 22:14:50 +00:00
Simon Sapin
3226858e50 Fix tests for changes in #26241. 2015-07-13 23:28:58 +02:00
bors
2533a85be4 Auto merge of #26993 - michaelwoerister:msvc-debuginfo, r=alexcrichton
This PR will enable RUSTC to generate PDB debuginfo files when targeting the MSVC toolchain. Mind that these are not full featured PDB files -- they just contain line tables, so you can get proper backtraces and step through your code, but variable values can't be inspected. We are just levering (LLVM's current support)[http://clang.llvm.org/docs/MSVCCompatibility.html] for creating Windows debuginfo. When LLVM's support gets better, we should benefit from that too without much effort.

I also wanted to include some kind of auto test with this PR but I could not get the `rmake` tests to work properly when targeting MSVC.

EDIT:
Closes #19533
2015-07-13 20:42:55 +00:00
Jose Narvaez
2e1f75acc4 Fixed snippet to return the proper error. 2015-07-13 20:54:33 +01:00
bors
6800538489 Auto merge of #26984 - nham:errorck-ignore-long-diag, r=brson
Currently errorck yields bogus `duplicate error code` messages when an error code occurs inside of a long diagnostic message (see https://github.com/rust-lang/rust/pull/26982), because errorck just goes line by line checking for error codes and recording them all.

A simplistic approach to fixing this is just to detect the beginning of a long diagnostic raw string literal (`r##"`) and skip lines until the end of the raw string literal is encountered. I'm not completely confident in this approach, but I think a more robust approach would be more complicated and I wanted to get feedback before pursuing that.
2015-07-13 18:42:49 +00:00
Guillaume Gomez
f52a87c44e Centralize error spaning and add an enum to make this treatment easier 2015-07-13 19:32:45 +02:00
Alex Crichton
07132b499f doc: Add a link to LLVM's new inline assembly docs
Hot off the press, we've now got some nice documentation to link to in LLVM
officially!
2015-07-13 10:08:09 -07:00
bors
0fbcebaaec Auto merge of #27001 - tsion:patch-2, r=Gankro 2015-07-13 16:31:05 +00:00
Frank McSherry
d673bdef0f minor grammatical update
Grammatical update (and passive -> active, but I'm not sure if "Rust" is often used as a subject in the book; feel free to revert that part for style, but keep the subject-verb agreement)
2015-07-13 17:22:08 +02:00
Simon Sapin
eb99f0e420 Mark some new things as unstable. 2015-07-13 16:21:43 +02:00
Simon Sapin
7469914e96 Add str::split_at_mut 2015-07-13 16:21:43 +02:00
Simon Sapin
f9005512a9 Implement IndexMut for String and str.
... matching the existing Index impls.
There is no reason not to if String implement DerefMut.

The code removed in `src/librustc/middle/effect.rs` was added in #9750
to prevent things like `s[0] = 0x80` where `s: String`,
but I belive became unnecessary when the Index(Mut) traits were introduced.
2015-07-13 16:21:43 +02:00
Simon Sapin
90d61d828f Add more tests for AsciiExt::is_ascii 2015-07-13 16:21:43 +02:00
Simon Sapin
304f545274 Add tests for AsciiExt::make_ascii_*case, including on String. 2015-07-13 16:21:43 +02:00
Simon Sapin
2d34a531f4 Implement DerefMut for String
`&mut str` is rarely useful, but it is for e.g.
`AsciiExt::make_ascii_lowercase`.
2015-07-13 16:21:43 +02:00
bors
9ff2d19c45 Auto merge of #27000 - alexcrichton:semi-after-type, r=cmr
This commit expands the follow set of the `ty` and `path` macro fragments to
include the semicolon token as well. A semicolon is already allowed after these
tokens, so it's currently a little too restrictive to not have a semicolon
allowed. For example:

    extern {
        fn foo() -> i32; // semicolon after type
    }

    fn main() {
        struct Foo;

        Foo; // semicolon after path
    }
2015-07-13 13:55:29 +00:00
Michael Sproul
4ec3ab61c0 diagnostics: Fix E0303 explanation. 2015-07-13 23:21:33 +10:00
bors
df39a92e22 Auto merge of #27011 - dotdash:issue-26996, r=luqmana
If we match a whole struct or tuple, the "field" for the reassignment
checker will be "None" which means that mutating any field should count
as a reassignment.

Fixes #26996.
2015-07-13 12:24:25 +00:00
Björn Steinbrink
043d7b5198 Correctly detect reassignments to the interior of matched structs/tuples
If we match a whole struct or tuple, the "field" for the reassignment
checker will be "None" which means that mutating any field should count
as a reassignment.

Fixes #26996.
2015-07-13 13:23:13 +02:00
bors
edf29a7102 Auto merge of #26999 - rick68:patch-13, r=Gankro
Reverse PR `#26944 `, symbol `#` are actually as intended.
2015-07-13 10:53:14 +00:00
bors
a16a4173c9 Auto merge of #26990 - rwz:patch-1, r=alexcrichton
The current example does not illustrate threaded behavior imo.
2015-07-13 09:15:12 +00:00