Commit Graph

44487 Commits

Author SHA1 Message Date
Manish Goregaokar
00653da41a Rollup merge of #27071 - AlisdairO:diagnostics, r=Manishearth
Added some detailed diagnostics for E0364 and E0365.
2015-07-18 08:13:15 +05:30
Manish Goregaokar
1cf11cc04e Rollup merge of #27067 - GuillaumeGomez:patch-1, r=cmr
Now the macro argument list can be finished by a comma (not sure this is correct english...).

cc @tamird
r? @bluss
2015-07-18 08:13:15 +05:30
Manish Goregaokar
22aa16334c Rollup merge of #26777 - barosl:macro-doc-escapes, r=pnkfelix
Escape sequences in documentation comments must not be parsed as a normal string when expanding a macro, otherwise some innocent but invalid-escape-sequence-looking comments will trigger an ICE.

Although this commit replaces normal string literals with raw string literals in macro expansion, this shouldn't be much a problem considering documentation comments are converted into attributes before being passed to a macro anyways.

Fixes #25929.
Fixes #25943.
2015-07-18 08:13:15 +05:30
Alisdair Owens
94b1ca8448 Write diagnostics for E0364 and E0365 2015-07-17 21:05:51 +01:00
bors
e05ac3938b Auto merge of #27045 - nikomatsakis:better-object-defaults-error, r=pnkfelix
Transition to the new object lifetime defaults, replacing the old defaults completely.

r? @pnkfelix 

This is a [breaking-change] as specified by [RFC 1156][1156] (though all cases that would break should have been receiving warnings starting in Rust 1.2). Types like `&'a Box<Trait>` (or `&'a Rc<Trait>`, etc) will change from being interpreted as `&'a Box<Trait+'a>` to `&'a Box<Trait+'static>`. To restore the old behavior, write the `+'a` explicitly. For example, the function:


```rust
trait Trait { }
fn foo(x: &Box<Trait>) { ... }
```

would be rewritten as:

```rust
trait Trait { }
fn foo(x: &'a Box<Trait+'a>) { ... }
```

if one wanted to preserve the current typing.

[1156]: https://github.com/rust-lang/rfcs/blob/master/text/1156-adjust-default-object-bounds.md
2015-07-17 18:35:50 +00:00
bors
d4432b3737 Auto merge of #27076 - alexcrichton:update-llvm, r=brson
LLVM has recently created their 3.7 release branch, and this PR updates us to that point. This should hopefully mean that we're basically compatible with the upcoming 3.7 release. Additionally, there are a number of goodies on this branch.

* This contains a fix for https://llvm.org/bugs/show_bug.cgi?id=23957
  which should help us bootstrap farther on 32-bit MSVC targets.
* There is better support for writing multiple flavors of archives, allowing us
  to use the built-in LLVM support instead of the system `ar` on all current
  platforms of the compiler.
* This LLVM has SafeStack support
* An [optimization patch](7cf5e26e18) by @pcwalton is included.
* A number of other minor test fixes here and there.

Due to problems dealing with the data layout we pass to LLVM, this PR also takes the time to clean up how we specific this. We no longer specify a data layout to LLVM by default and instead take the default for the target from LLVM to pass to the module that we're building. This should be more robust going into the future, and I'm also not sure we know what any of these arcane strings are any more...
2015-07-17 16:18:52 +00:00
Alex Crichton
6d96edfe16 test: Ignore a failing test on LLDB
Re-enabling it is tracked in #27089
2015-07-17 08:28:08 -07:00
Alex Crichton
81d128b968 Merge branch 'generic-enum-disr-fix' of https://github.com/michaelwoerister/rust into update-llvm 2015-07-17 08:24:11 -07:00
bors
b5dad7dcb2 Auto merge of #27082 - Manishearth:rollup, r=Manishearth
- Successful merges: #25993, #27038, #27069, #27070, #27080
- Failed merges: #27034, #27064
2015-07-17 10:26:31 +00:00
Manish Goregaokar
ed8b7ea83e Rollup merge of #27080 - soderstroff:kristof-patch, r=Gankro
I fixed a single character typo.
r? @steveklabnik
2015-07-17 15:56:12 +05:30
Manish Goregaokar
07b337ce33 Rollup merge of #27069 - Eljay:fix-raw-attr-typo, r=alexcrichton
Pretty sure this should apply to the module.

r? @alexcrichton
2015-07-17 14:57:36 +05:30
Manish Goregaokar
ef9b9cebe3 Rollup merge of #25993 - nham:fix_23969, r=nikomatsakis
Adds two error codes, one for duplicate associated constants and one for types. I'm not certain these should each have their own code, but E0201 is already solely for duplicate associated functions so at least it kinda matches. This will lead to somewhat redundant error explanations, but that's nothing new!

Fixes #23969.
2015-07-17 19:06:23 +05:30
Guillaume Gomez
6e58043e75 Improve register_long_diagnostics macro 2015-07-17 11:21:05 +02:00
bors
8e9bd6cd26 Auto merge of #27066 - rust-lang:rollup_central, r=steveklabnik
Everything on this branch has passed check-stage2 on linux.

This is a temporary integration branch until [our buildbot problems](https://internals.rust-lang.org/t/buildbot-is-down-for-a-bit/2365/3) get fixed.
As the day progresses I'll merge more PRs into this branch once I get them through make check.

This branch isn't complete, keeping it up here so more people can merge PRs into integration if they want.

r? @Manishearth
2015-07-17 05:31:15 +00:00
Kristof Söderström
2d32a15667 Fixed typo 2015-07-16 20:43:36 -07:00
Alex Crichton
958d563825 trans: Clean up handling the LLVM data layout
Turns out for OSX our data layout was subtly wrong and the LLVM update must have
exposed this. Instead of fixing this I've removed all data layouts from the
compiler to just use the defaults that LLVM provides for all targets. All data
layouts (and a number of dead modules) are removed from the compiler here.
Custom target specifications can still provide a custom data layout, but it is
now an optional key as the default will be used if one isn't specified.
2015-07-16 20:25:52 -07:00
Alex Crichton
74e198126b trans: Add kind to writeArchive
Updates our LLVM bindings to be able to write out multiple kinds of archives.
This commit also enables using LLVM instead of the system ar on all current
targets.
2015-07-16 20:25:51 -07:00
Alex Crichton
7f0e733f1d rustc_trans: Update LLVMBuildLandingPad signature
The C API of this function changed so it no longer takes a personality function.
A shim was introduced to call the right LLVM function (depending on which
version we're compiled against) to set the personality function on the outer
function.

The compiler only ever sets one personality function for all generated
functions, so this should be equivalent.
2015-07-16 20:25:51 -07:00
Richo Healey
c55d3f1ba1 rt: Move personality to functions from their landing pads
This is for llvm/cc714e214298cfbf11de65b46de31900d51422cf
2015-07-16 20:25:51 -07:00
Alex Crichton
ea317e8ea4 Update LLVM
There's a number of goodies in this LLVM update:

* This contains a fix for https://llvm.org/bugs/show_bug.cgi?id=23957
  which should help us bootstrap farther on 32-bit MSVC targets.
* There is better support for writing multiple flavors of archives, allowing us
  to use the built-in LLVM support instead of the system `ar` on all current
  platforms of the compiler.
* A number of other minor bug fixes and performance improvements to unblock
  various other pieces of work.
2015-07-16 20:25:51 -07:00
Steve Klabnik
c9e6d9a323 Merge branch 'fix-26673' of https://github.com/nhowell/rust into rollup_central 2015-07-16 17:55:19 -04:00
Steve Klabnik
d354d41fd5 Merge branch 'more-ref-fixes' of https://github.com/tshepang/rust into rollup_central 2015-07-16 17:55:07 -04:00
Steve Klabnik
72722e3c2b Merge branch 'coercions' of https://github.com/tshepang/rust into rollup_central 2015-07-16 17:54:57 -04:00
Steve Klabnik
48ddf90682 Merge branch 'doc_io_traits_enums' of https://github.com/steveklabnik/rust into rollup_central 2015-07-16 17:54:44 -04:00
Steve Klabnik
c451bb81ee Merge branch 'nopacked' of https://github.com/Stebalien/rust into rollup_central 2015-07-16 17:53:49 -04:00
Steve Klabnik
2fb87ed5a7 Merge branch 'uint-usize-rustc-docs' of https://github.com/nham/rust into rollup_central 2015-07-16 17:53:39 -04:00
Steve Klabnik
3ba0b3c722 Merge branch 'fix/doc/rel-prev-next' of https://github.com/vincentbernat/rust into rollup_central 2015-07-16 17:53:26 -04:00
Steve Klabnik
4fb02a391d More docs for std::io free functions. 2015-07-16 13:38:20 -04:00
Steve Klabnik
664449ac6e More docs for std::io::Write 2015-07-16 13:38:16 -04:00
Steve Klabnik
092f4ed2de More docs for std::io::Seek 2015-07-16 13:38:15 -04:00
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