Commit Graph

53112 Commits

Author SHA1 Message Date
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
bors
1ec22171e6 Auto merge of #33130 - eddyb:mir-const, r=nikomatsakis
Implement constant support in MIR.

All of the intended features in `trans::consts` are now supported by `mir::constant`.
The implementation is considered a temporary measure until `miri` replaces it.

A `-Z orbit` bootstrap build will only translate LLVM IR from AST for `#[rustc_no_mir]` functions.

Furthermore, almost all checks of constant expressions have been moved to MIR.
In non-`const` functions, trees of temporaries are promoted, as per RFC 1414 (rvalue promotion).
Promotion before MIR borrowck would allow reasoning about promoted values' lifetimes.

The improved checking comes at the cost of four `[breaking-change]`s:
* repeat counts must contain a constant expression, e.g.:
`let arr = [0; { println!("foo"); 5 }];` used to be allowed (it behaved like `let arr = [0; 5];`)
* dereference of a reference to a `static` cannot be used in another `static`, e.g.:
`static X: [u8; 1] = [1]; static Y: u8 = (&X)[0];` was unintentionally allowed before
* the type of a `static` *must* be `Sync`, irrespective of the initializer, e.g.
`static FOO: *const T = &BAR;` worked as `&T` is `Sync`, but it shouldn't because `*const T` isn't
* a `static` cannot wrap `UnsafeCell` around a type that *may* need drop, e.g.
`static X: MakeSync<UnsafeCell<Option<String>>> = MakeSync(UnsafeCell::new(None));`
was previously allowed based on the fact `None` alone doesn't need drop, but in `UnsafeCell`
it can be later changed to `Some(String)` which *does* need dropping

The drop restrictions are relaxed by RFC 1440 (#33156), which is implemented, but feature-gated.
However, creating `UnsafeCell` from constants is unstable, so users can just enable the feature gate.
2016-05-08 00:31:40 -07:00
Eduard Burtescu
3b0e27cc74 trans: handle string literal reborrows. 2016-05-08 06:23:50 +03:00
Eduard Burtescu
3001626595 Always remove tmp/partitioning-tests before check-codegen-units to work around #33435. 2016-05-07 23:44:52 +03:00
bors
d91f8ab0f5 Auto merge of #33487 - steveklabnik:rollup, r=steveklabnik
Rollup of 20 pull requests

- Successful merges: #33256, #33283, #33313, #33314, #33326, #33336, #33382, #33384, #33402, #33409, #33410, #33412, #33428, #33430, #33437, #33438, #33439, #33442, #33456, #33459
- Failed merges:
2016-05-07 12:36:18 -07:00
Steve Klabnik
84e27738ef Rollup merge of #33459 - frewsxcv:patch-29, r=guillaumegomez
Indicate struct names are code-like in doc-comment.
2016-05-07 15:35:19 -04:00
Steve Klabnik
099e0879aa Rollup merge of #33456 - CryZe:barrier-wait-docs, r=GuillaumeGomez
Fix Typo in Barrier::wait documentation

This should be `have` instead of `has`.
2016-05-07 15:35:19 -04:00
Steve Klabnik
f4453bba95 Rollup merge of #33442 - tshepang:trim, r=steveklabnik
doc: trim some needless code
2016-05-07 15:35:19 -04:00
Steve Klabnik
b68254fbb8 Rollup merge of #33439 - birkenfeld:ip-rfc-refs, r=steveklabnik
doc: make RFC references consistent

Always add a space and end sentence with a full stop.
2016-05-07 15:35:19 -04:00
Steve Klabnik
aa63f54e37 Rollup merge of #33438 - birkenfeld:dup-words, r=steveklabnik
Fix some some duplicate words.
2016-05-07 15:35:19 -04:00
Steve Klabnik
1ce9405380 Rollup merge of #33437 - brson:trips, r=Manishearth
doc: Update reference with better description of target_env

The definition of this value recently changed slightly. It no
longer corresponds directly to the target triple.

Also shuffled things around to make the order of cfg descriptions more
logical and added text related them to the target triple.

cc #33403
2016-05-07 15:35:18 -04:00
Steve Klabnik
f569b59fdf Rollup merge of #33430 - phil-opp:patch-1, r=alexcrichton
[Doc] Default cpu is "generic" (and not "default")

See [line 305](a22ca2872e/src/librustc_back/target/mod.rs (L305)).
2016-05-07 15:35:18 -04:00
Steve Klabnik
aec36f61a0 Rollup merge of #33428 - fiveop:wrapping_example, r=steveklabnik
Add an example to Wrapping's documentation.

Such an example would have helped me understand `Wrapping` quicker.

r? @steveklabnik
2016-05-07 15:35:18 -04:00
Steve Klabnik
0b8a3d5187 Rollup merge of #33412 - cramertj:E0389, r=Manishearth
Add detailed error explanation for E0389

Part of #32777
2016-05-07 15:35:18 -04:00
Steve Klabnik
be61c6d828 Rollup merge of #33410 - GuillaumeGomez:explain, r=Manishearth
Remove rust flags from doc block

Fixes #33405

r? @Manishearth
2016-05-07 15:35:18 -04:00
Steve Klabnik
e09ad1deb7 Rollup merge of #33409 - kindlychung:patch-2, r=steveklabnik
errors in the doc
2016-05-07 15:35:17 -04:00
Steve Klabnik
769ec1e743 Rollup merge of #33402 - shepmaster:copied-variable-name, r=Manishearth
Replace copy-pasted variable name with relevant one
2016-05-07 15:35:17 -04:00
Steve Klabnik
04f2972d14 Rollup merge of #33384 - cramertj:E0506, r=arielb1
Add detailed error explanation for E0506

Part of #32777
2016-05-07 15:35:17 -04:00
Steve Klabnik
76d6030e80 Rollup merge of #33382 - birkenfeld:issue-30416, r=alexcrichton
rustdoc: add "src" links to individual impls

Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.

NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.

Fixes: #30416
2016-05-07 15:35:17 -04:00
Steve Klabnik
a8162171fd Rollup merge of #33336 - birkenfeld:issue-27361, r=sfackler
parser: do not try to continue with `unsafe` on foreign fns

The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is:

```
self.expect_keyword(keywords::Fn)?;
```

So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`".

Fixes: #27361
2016-05-07 15:35:17 -04:00
Steve Klabnik
b651b2c8af Rollup merge of #33326 - birkenfeld:issue-33321, r=GuillaumeGomez
std::thread docs: spawn() does not return a Thread anymore

Also move the "Thread type" section down a bit, since it is not so important anymore.

Fixes: #33321
2016-05-07 15:35:16 -04:00
Steve Klabnik
4e41e8bb48 Rollup merge of #33314 - alexcrichton:fix-enable-ccache, r=pnkfelix
mk: Fix building with --enable-ccache

We will no longer use `ccache` in the makefiles for our local dependencies like
miniz, but they're so small anyway it doesn't really matter.

Closes #33285
2016-05-07 15:35:16 -04:00