Commit Graph

53081 Commits

Author SHA1 Message Date
Michael Woerister
d24ead0f93 trans: Make various trans::collector functions independent of CrateContext. 2016-05-09 16:17:00 -04:00
Michael Woerister
2564199d8f trans: Make meth::get_vtable_methods() not depend on CrateContext. 2016-05-09 16:17:00 -04:00
Michael Woerister
100a4f5699 trans: Make normalize_and_test_predicates() not depend on CrateContext. 2016-05-09 16:17:00 -04:00
Michael Woerister
60259b9d90 Make trans::collector item printing methods independent of CrateContext. 2016-05-09 16:17:00 -04:00
Michael Woerister
b2ea54d2c6 trans: Split LocalCrateContext ownership out of SharedCrateContext. 2016-05-09 16:17:00 -04:00
Eduard Burtescu
cb3a557e0c trans: deal with the fact that ZSTs are always "initialized". 2016-05-09 22:52:06 +03:00
Eduard Burtescu
d460597e33 trans: monomorphize varidiac call argument types. 2016-05-09 22:52:01 +03:00
bors
faca79fc33 Auto merge of #33457 - oli-obk:const_err/cast_u8_ptr, r=eddyb
casting `&[u8]` to `* const u8` doesn't work in const_eval

fixes #33452

r? @eddyb

cc @Ms2ger
2016-05-09 10:57:35 -07:00
bors
af0a433865 Auto merge of #33048 - Amanieu:integer_atomics, r=alexcrichton
Add integer atomic types

Tracking issue: #32976
RFC: rust-lang/rfcs#1543

The changes to AtomicBool in the RFC are not included, they are in a separate PR (#32365).
2016-05-09 08:48:58 -07:00
Alex Crichton
0ec321f7b5 rustc: Implement custom panic runtimes
This commit is an implementation of [RFC 1513] which allows applications to
alter the behavior of panics at compile time. A new compiler flag, `-C panic`,
is added and accepts the values `unwind` or `panic`, with the default being
`unwind`. This model affects how code is generated for the local crate, skipping
generation of landing pads with `-C panic=abort`.

[RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md

Panic implementations are then provided by crates tagged with
`#![panic_runtime]` and lazily required by crates with
`#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic
runtime must match the final product, and if the panic strategy is not `abort`
then the entire DAG must have the same panic strategy.

With the `-C panic=abort` strategy, users can expect a stable method to disable
generation of landing pads, improving optimization in niche scenarios,
decreasing compile time, and decreasing output binary size. With the `-C
panic=unwind` strategy users can expect the existing ability to isolate failure
in Rust code from the outside world.

Organizationally, this commit dismantles the `sys_common::unwind` module in
favor of some bits moving part of it to `libpanic_unwind` and the rest into the
`panicking` module in libstd. The custom panic runtime support is pretty similar
to the custom allocator support with the only major difference being how the
panic runtime is injected (takes the `-C panic` flag into account).
2016-05-09 08:22:36 -07:00
Georg Brandl
6100b70b98 rustdoc: do not strip blanket impls in crate of origin
In `impl<T> Trait for T`, the blanket type parameters `T` were
recognized as "local" and "not exported", so these impls were
thrown out.

Now we check if they are generic, and keep them in that case.

Fixes: #29503
2016-05-09 16:50:47 +02:00
bors
0cc90978e8 Auto merge of #33484 - murarth:diagnostic-builder-fields, r=brson
Add accessor methods to DiagnosticBuilder
2016-05-09 06:40:56 -07:00
Corey Farwell
62b19c627e Utilize Result::unwrap_err in more places. 2016-05-09 08:40:57 -04:00
Amanieu d'Antras
03dd9b87cb Add test to ensure that atomic types are lock-free 2016-05-09 13:33:24 +01:00
Amanieu d'Antras
97216a6ce5 Add new atomic integer types 2016-05-09 13:31:47 +01:00
Amanieu d'Antras
04835ea5ec Add #[cfg(target_has_atomic)] to get atomic support for the current target 2016-05-09 13:31:47 +01:00
Jeffrey Seyfried
805666a4d2 Fix fallout in librustdoc and in tests 2016-05-09 12:12:32 +00:00
bors
32683ce193 Auto merge of #33478 - xen0n:normalize-callee-trait-ref, r=eddyb
trans: callee: normalize trait_ref before use

This fixes #33436 and #33461. Ran the tests and nothing else seems to be affected.

P.S. How to write the regression test for this fix? Does this qualify as run-pass or run-make, as the test only needs to be successfully compiled to be considered passed? Will add the testcase (the minimal example in #33461 seems fit) after clarifying this.
2016-05-09 04:32:39 -07:00
Jeffrey Seyfried
abec20b177 Refactor out driver::lower_and_resolve 2016-05-09 10:27:27 +00:00
Jeffrey Seyfried
6710eef6b2 Refactor hir::lowering::Resolver 2016-05-09 10:27:24 +00:00
Georg Brandl
ba17bd0b42 rustdoc: fix emitting duplicate implementors in .js files
The collect() fn checks for double quotes; use them here as well.

Fixes: #30219
2016-05-09 10:18:06 +02:00
Manish Goregaokar
84843b73dc
Merge E0410 into E0408 2016-05-08 23:36:40 -07:00
Eduard Burtescu
9709dff7e3 trans: monomorphize the cast destination type before using it. 2016-05-09 09:20:02 +03:00
bors
50909f2d50 Auto merge of #33365 - birkenfeld:makehelpfix, r=alexcrichton
Makefile: there is only one tidy target now

Also removes mention of tidy.py from the tidy sources.
2016-05-08 20:07:10 -07:00
Jeffrey Seyfried
e6d6c37968 Reimplement pretty printing 2016-05-09 02:47:08 +00:00
Jeffrey Seyfried
e5a0dd7c6e Resolve paths generated in the ast->hir lowerer 2016-05-09 02:31:06 +00:00
Jeffrey Seyfried
983b4d3925 Refactor the interface that resolve exposes to driver 2016-05-09 02:31:06 +00:00
Jeffrey Seyfried
8428447253 Move resolution to before lowering 2016-05-09 02:31:04 +00:00
bors
27edda2411 Auto merge of #33360 - alexcrichton:rustbuild-dox, r=brson
rustbuild: Document many more parts of the build

This commit expands the bootstrap build system's `README.md` as well as ensuring
that all API documentation is present and up-to-date. Additionally a new
`config.toml.example` file is checked in with commented out versions of all
possible configuration values.
2016-05-08 17:58:54 -07:00
Jeffrey Seyfried
16c8f2cca8 Temporarily unimplement pretty printing 2016-05-09 00:48:50 +00:00
Jeffrey Seyfried
a988c9a839 Refactor Resolver field def_map from RefCell<DefMap> to DefMap 2016-05-09 00:48:48 +00:00
Jeffrey Seyfried
8c2fa93e81 Remove a use of ast_map.span_if_local() in resolve 2016-05-09 00:48:44 +00:00
bors
6974800c6b Auto merge of #33288 - cyplo:32834_retry_download, r=alexcrichton
Get a file during bootstrap to a temp location first.

When downloading a file in the bootstrap phase - get it to a temp
location first. Verify it there and only if downloaded properly move it
to the `cache` directory.

This should prevent `make` being stuck if the download was interrupted
or otherwise corrupted, as per discussion in #32834

The temporary files are deleted in case of an exception.

I was looking for some unit/integration tests around this and couldn't find any - presumably because this is being tested by just Travis launching it ? Let me know if it would be good to try to write tests around this. Thanks !
2016-05-08 14:57:57 -07:00
Adolfo Ochagavía
192e336148 Merge pull request #1 from nrc/save-ids-fix
Save ids fix
2016-05-08 19:57:12 +02:00
Manish Goregaokar
cf8a1b0998 Add E0408/E0409 2016-05-08 10:13:58 -07:00
bors
ebe6da34ff Auto merge of #33414 - Nercury:master, r=alexcrichton
Add armv7-linux-androideabi target

This PR adds `armv7-linux-androideabi` target that matches `armeabi-v7a` Android ABI, ~~downscales `arm-linux-androideabi` target to match `armeabi` Android ABI~~ (TBD later if needed).

This should allow us to get the best performance from every [Android ABI level](http://developer.android.com/ndk/guides/abis.html).

Currently existing target `arm-linux-androideabi` started gaining features out of the supported range of [android `armeabi`](http://developer.android.com/ndk/guides/abis.html). While android compiler does not use a different target for later supported `armv7` architecture, it has distinct ABI name `armeabi-v7a`. We decided to add rust target `armv7-linux-androideabi` to match it.

Note that `NEON`, `VFPv3-D32`, and `ThumbEE` instruction sets are not added, because not all android devices are guaranteed to support all or some of these, and [their availability should be checked at runtime](http://developer.android.com/ndk/guides/abis.html#v7a).

~~This reduces performance of existing `arm-linux-androideabi` and may make it _much_ slower (we are talking more than order of magnitude in some random ad-hoc fp benchmark that I did).~~

Part of #33278.
2016-05-08 09:13:19 -07:00
bors
cae42a471c Auto merge of #33494 - Manishearth:rollup, r=Manishearth
Rollup of 8 pull requests

- Successful merges: #33369, #33373, #33404, #33406, #33420, #33424, #33426, #33473
- Failed merges:
2016-05-08 07:04:17 -07:00
Manish Goregaokar
cc98f4cbb0
Rollup merge of #33426 - sfackler:try-from, r=aturon
Implement RFC 1542

cc #33417

r? @aturon
2016-05-08 07:02:22 -07:00
Manish Goregaokar
5d878057d2
Rollup merge of #33424 - semarie:dist, r=alexcrichton
make dist: specify the archive file as stdout

If the `-f` option isn't given, GNU tar will use environment variable
`TAPE` first, and next use the compiled-in default, which isn't
necessary `stdout` (it is the tape device `/dev/rst0` under OpenBSD for
example).
2016-05-08 07:00:16 -07:00
Manish Goregaokar
544074eb69
Rollup merge of #33420 - durka:patch-20, r=alexcrichton
implement RFC 1521

Adds documentation to Clone, specifying that Copy types should have a trivial Clone impl.

Fixes #33416.

I tried to use "should" and "must" as defined [here](https://tools.ietf.org/html/rfc2119).

cc @ubsan
2016-05-08 07:00:13 -07:00
Manish Goregaokar
deb97fef21
Rollup merge of #33406 - Manishearth:diag-improve-const-let, r=GuillaumeGomez
Improve diagnostics for constants being used in irrefutable patterns

It's pretty confusing and this error triggers in resolve only when "shadowing" a const, so let's make that clearer.

r? @steveklabnik
2016-05-08 07:00:11 -07:00
Manish Goregaokar
0cb966fa3b
Rollup merge of #33404 - gsquire:cargo-lock, r=alexcrichton
Cargo lock tidy check

A rebased PR for #32901
2016-05-08 07:00:07 -07:00
Manish Goregaokar
c89d8c58ca
Rollup merge of #33373 - birkenfeld:issue-32555, r=bluss
rustdoc: use btree map for where clauses

to get more reproducible output.

Fixes: #32555

I've looked at the other uses of HashMap in rustdoc, and they seem ok to (i.e. they use `iter()` and related only for constructing a new map, or when the output goes into independent files).

Not sure what the cause of #24473 is, it shouldn't be where clauses, but maybe it was also fixed inbetween since May 2015.
2016-05-08 07:00:04 -07:00
Manish Goregaokar
dfa5245716
Rollup merge of #33369 - nikomatsakis:graceful-empty-span, r=jntrnr
degrade gracefully with empty spans

In https://github.com/rust-lang/rust/pull/32756, we solved the final test failure, but digging more into it the handling of that scenario could be better. The error was caused by an empty span supplied by the parser representing EOF. This patch checks that we cope more gracefully with such spans:

r? @jonathandturner
2016-05-08 07:00:00 -07:00
silvo38
a7439ad75a Fix minor typo in E0312 2016-05-08 22:33:03 +10:00
bors
8e414e0e3f Auto merge of #33091 - sanxiyn:unused-trait-import-3, r=nrc
Warn unused trait imports, rebased

Rebase of #30021.

Fix #25730.
2016-05-08 04:50:27 -07:00
bors
4896832988 Auto merge of #33403 - alexcrichton:consistent-env, r=brson
rustc: Change target_env for ARM targets to `gnu`

Right now they're `gnueabihf` and `gnueabi`, but when adding new platforms like
musl on ARM it's unfortunate to have to test for all three (`musl`, `musleabi`,
and `musleabihf`). This PR switches everything currently to `gnu`, and the new
musl targets can also use `musl` when they land.

Closes #33244
2016-05-08 02:41:50 -07:00
Oliver 'ker' Schneider
7461e450b9 casting b"text" to * const u8 doesn't work in const_eval 2016-05-08 10:52:17 +02:00
Cyryl Płotnicki-Chudyk
6bce110c3e Remove sha256 file only if present. 2016-05-08 10:00:36 +02:00
Cyryl Płotnicki-Chudyk
15de207b9c Better error handling for bootstrap file downloads.
Remove the temp files if something goes wrong.
2016-05-08 09:54:50 +02:00