Commit Graph

58943 Commits

Author SHA1 Message Date
iirelu
e593c3b893 Changed most vec! invocations to use square braces
Most of the Rust community agrees that the vec! macro is clearer when
called using square brackets [] instead of regular brackets (). Most of
these ocurrences are from before macros allowed using different types of
brackets.

There is one left unchanged in a pretty-print test, as the pretty
printer still wants it to have regular brackets.
2016-10-31 22:51:40 +00:00
Tim Neumann
f7107f32c2 rustbuild+configure: convert unix style paths on windows 2016-10-31 22:44:52 +01:00
Tim Neumann
5cb5c85152 rustbuild+configure: improve bin/exe joining 2016-10-31 22:44:52 +01:00
Tim Neumann
dce460028e detect gdb version & rust support in compiletest 2016-10-31 21:12:59 +01:00
Tim Neumann
6554fb0d8d add gdb_native_rust config to compiletest 2016-10-31 21:12:59 +01:00
Tim Neumann
9253e1206e adapt debuginfo tests for gdb with native rust support 2016-10-31 21:12:59 +01:00
arthurprs
eba93c3a0f Don't reuse RandomState seeds 2016-10-31 21:12:27 +01:00
nwin
1b39c0a602 Remove remark about poor code style
The current wording [seems to be confusing](https://www.reddit.com/r/rust/comments/5aat03/why_is_implementing_traits_on_primitive_types/). As an explanation when and why this could be considered as poor style would go beyond of the scope of this chapter I suggest to remove this remark.
2016-10-31 19:43:50 +01:00
Christopher Serr
b926e8d089 Add missing space in mutable_transmutes lint 2016-10-31 19:41:22 +01:00
bors
f26eedb571 Auto merge of #37191 - zackmdavis:we_heard_you_the_first_time_really, r=nikomatsakis
introing one-time diagnostics: only emit "lint level defined here" once

This is a revised resubmission of PR #34084 (which was closed due to inactivity on account of time constraints on the author's part).
---

We introduce a new `one_time_diagnostics` field on
`rustc::session::Session` to hold a hashset of diagnostic messages we've
set once but don't want to see again (as uniquified by span and message
text), "lint level defined here" being the motivating example dealt with
here.

This is in the matter of #24690.
---

r? @nikomatsakis
2016-10-31 10:56:25 -07:00
Alex Crichton
20c301330c rustc: Add knowledge of Windows subsystems.
This commit is an implementation of [RFC 1665] which adds support for the
`#![windows_subsystem]` attribute. This attribute allows specifying either the
"windows" or "console" subsystems on Windows to the linker.

[RFC 1665]: https://github.com/rust-lang/rfcs/blob/master/text/1665-windows-subsystem.md

Previously all Rust executables were compiled as the "console" subsystem which
meant that if you wanted a graphical application it would erroneously pop up a
console whenever opened. When compiling an application, however, this is
undesired behavior and the "windows" subsystem is used instead to have control
over user interactions.

This attribute is validated, but ignored on all non-Windows platforms.

cc #37499
2016-10-31 10:03:41 -07:00
bors
bf5b824c1c Auto merge of #37494 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

- Successful merges: #37438, #37458, #37462, #37475, #37486
- Failed merges:
2016-10-31 07:22:58 -07:00
Seo Sanghyeon
07c8a25f42 Remove unused type aliases 2016-10-31 23:14:27 +09:00
Bunts Thy Unholy
8483732c9a Removed commented main functions entirely. This fits in with other examples in the Closures section 2016-10-31 23:41:38 +11:00
Bunts Thy Unholy
32fb2527d9 Commented out final 'main' function in order to fit within pattern of other examples and prevent incorrect indentation 2016-10-31 22:45:03 +11:00
Guillaume Gomez
0a59eba0e8 Rollup merge of #37486 - msiglreith:pr_doc_bitandassign, r=apasel422
Fix typo in the BitAndAssign operator documentation

The name of the operator should be `&=` instead of `&`.
2016-10-31 12:27:24 +01:00
Guillaume Gomez
aa80a8c0a9 Rollup merge of #37475 - AndiDog:feature/error-explanation-E0532, r=GuillaumeGomez
Add E0532 error explanation

This resolves one of the error list in https://github.com/rust-lang/rust/issues/35347 - just because I stumbled over it today.

I assumed the error code should be removed from `register_diagnostics!` because it's now defined above.

Since that is my first code contribution, please check that all is in order. It would be helpful to know how to run the test for the `compile_fail,E0532` part. I did `make check-stage1-cfail NO_REBUILD=1` but that doesn't test the inlined example.

r? @GuillaumeGomez
2016-10-31 12:27:24 +01:00
Guillaume Gomez
46cfba29cf Rollup merge of #37462 - Mark-Simulacrum:remove-obsolete-fixme, r=petrochenkov
Remove outdated fixme comment.

Linked issue has been closed, but the comment was not removed.

If this is still an issue, then the comment should probably be updated.

r? @petrochenkov
2016-10-31 12:27:24 +01:00
Guillaume Gomez
6627cb8928 Rollup merge of #37458 - nrc:save-span-errs2, r=petrochenkov
Fix more spans in deriving::generic

r? @petrochenkov
2016-10-31 12:27:23 +01:00
Guillaume Gomez
48def35f1b Rollup merge of #37438 - Cobrand:index_doc, r=GuillaumeGomez
improve docs for Index and IndexMut

This mainly changes the boring example of Foo/Bar of `IndexMut` into a better one.

Also added explanations about syntactic sugar for `v[index]`.

Closes #36329
2016-10-31 12:27:23 +01:00
bors
074d30d030 Auto merge of #37465 - pftbest:rust-llvm-2016-10-29, r=alexcrichton
LLVM: Update submodule to rust-llvm-2016-10-29 branch.

Fixes #37227
2016-10-31 02:52:54 -07:00
Jeffrey Seyfried
6c4b551403 Cleanup Resolver::disallowed_shadowing. 2016-10-31 06:56:06 +00:00
bors
4497196ba5 Auto merge of #37439 - michaelwoerister:remove-sha256, r=alexcrichton
Replace all uses of SHA-256 with BLAKE2b.

Removes the SHA-256 implementation and replaces all uses of it with BLAKE2b, which we already use for debuginfo type guids and incremental compilation hashes. It doesn't make much sense to have two different cryptographic hash implementations in the compiler and Blake has a few advantages over SHA-2 (computationally less expensive, hashes of up to 512 bits).
2016-10-30 23:37:18 -07:00
bors
8f1fc86533 Auto merge of #37489 - nagisa:unnecessary-clone, r=eddyb
Do not clone Mir unnecessarily

r? @eddyb
2016-10-30 20:30:38 -07:00
Mark-Simulacrum
0dfc046772 Fix ICE when printing closures, and other similar types 2016-10-30 20:20:10 -06:00
Andreas Sommer
c8937e0e6a Add E0532 error explanation 2016-10-31 01:53:23 +01:00
Simonas Kazlauskas
8ec0b3a12a Do not clone Mir unnecessarily 2016-10-31 02:16:21 +02:00
bors
bfc9b29acc Auto merge of #37460 - nrc:save-imports, r=eddyb
save-analysis: change imports to carry a ref id rather than their own…

… node id

To make jump to def for imports work

r? @eddyb
2016-10-30 17:01:28 -07:00
Michael Woerister
9ef9194528 Make the crate disambiguator 128 bits instead of 256 bits. 2016-10-30 19:14:18 -04:00
Michael Woerister
bd1ce91249 Add rustc_data_structures to rustc_driver dependencies. 2016-10-30 19:14:18 -04:00
Michael Woerister
a2a2763e6d Replace all uses of SHA-256 with BLAKE2b. 2016-10-30 19:14:18 -04:00
Corey Farwell
c8c6d2c732 Use quieter test output when running tests on Travis CI.
Fixes https://github.com/rust-lang/rust/issues/36788.
2016-10-30 17:31:17 -04:00
bors
ea20ab107e Auto merge of #37459 - Mark-Simulacrum:closure-ice, r=eddyb
Fix ICE when attempting to print closure generics

Fixes #36622.

r? @eddyb or @arielb1
2016-10-30 13:36:58 -07:00
bors
f5a702dc78 Auto merge of #37445 - nnethercote:shrink-Expr_, r=eddyb
Shrink Expr_::ExprInlineAsm.

On 64-bit this reduces the size of `Expr_` from 144 to 64 bytes, and
reduces the size of `Expr` from 176 to 96 bytes.

For the workload in #36799 this reduces the RSS for the "lowering ast -> hir" phase and all subsequent phases by 50 MiB, which reduces the peak RSS for that workload by about 1%. Not huge, but it's a very easy improvement.

r? @eddyb
2016-10-30 10:12:20 -07:00
msiglreith
9802c4c5f4 Fix typo in the BitAndAssign operator documentation 2016-10-30 17:50:28 +01:00
Matthew Piziak
dd6e8c5f18 move overflow tests from rust-fail to run-pass 2016-10-30 12:04:57 -04:00
Konrad Borowski
9cc98612d7 Don't mention "*" dependency version in guessing game example
It's a bad practice as far [RFC 1241] is concerned, and introducing it
in early tutorial may as well make it feel legitimate.

[RFC 1241]: https://github.com/rust-lang/rfcs/blob/master/text/1241-no-wildcard-deps.md
2016-10-30 15:24:13 +01:00
Mark-Simulacrum
bdb399db01 Fix ICE when attempting to get closure generics. 2016-10-30 08:12:20 -06:00
bors
6062e7ed3d Auto merge of #37431 - jseyfried:refactor_crate_config, r=eddyb
Move `CrateConfig` from `Crate` to `ParseSess`

This is a syntax-[breaking-change]. Most breakage can be fixed by removing a `CrateConfig` argument.
r? @eddyb
2016-10-30 06:51:30 -07:00
Pieter Frenssen
956d44fb17 Update "Testing" chapter for 1.12
I followed the "Testing" chapter using Rust 1.12.1 but there are some differences. By default the `tests` module is now also generated by `cargo new`, and the console output is updated.
2016-10-30 15:42:31 +02:00
Srinivas Reddy Thatiparthy
f32ce9c142
run rustfmt on librustc_driver folder 2016-10-30 18:26:51 +05:30
Konrad Borowski
5704a531fd doc: guessing-game.md: Match output to newest language version
Cargo now informs that it has finished, and there is new error format.
2016-10-30 12:57:19 +01:00
bors
aef5ca5590 Auto merge of #37392 - alexcrichton:more-disable-jemalloc, r=brson
Disable jemalloc on aarch64/powerpc

Sounds like jemalloc is broken on systems which differ in page size than the
host it was compiled on (unless an option was passed). This unfortunately
reduces the portability of binaries created and can often make Rust segfault by
default. For now let's patch over this by disabling jemalloc until we can figure
out a better solution.

Closes #36994
Closes #37320
cc jemalloc/jemalloc#467
2016-10-30 03:31:00 -07:00
Matwey V. Kornilov
9b81f3c81b Add armv6l autodetection
Use arm-unknown-linux-gnueabihf for hardware floating point armv6 variant
2016-10-30 11:27:58 +03:00
Matwey V. Kornilov
10ce90fca2 Fix armv7 autodetection
armv7l is armv7 architecture and CFG_CPUTYPE should be armv7 in order to end up
with armv7-unknown-linux-gnueabihf.mk rather than
arm-unknown-linux-gnueabihf.mk
2016-10-30 11:26:25 +03:00
bors
12382665a9 Auto merge of #37401 - eddyb:lazy-2, r=nikomatsakis
[2/n] rustc_metadata: move is_extern_item to trans.

*This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37400) | [next](https://github.com/rust-lang/rust/pull/37402)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments.*
<hr>

Minor cleanup missed by #36551: `is_extern_item` is one of, if not the only `CrateStore` method who takes a `TyCtxt` but doesn't produce something cached in it, and such methods are going away.
2016-10-30 00:01:21 -07:00
bors
ef6f743407 Auto merge of #37400 - eddyb:lazy-1, r=nikomatsakis
[1/n] Move the MIR map into the type context.

*This is part of a series ([prev]() | [next](https://github.com/rust-lang/rust/pull/37401)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments.*
<hr>

The first commit reorganizes the `rustc::mir` module to contain the MIR types directly without an extraneous `repr` module which serves no practical purpose but is rather an eyesore.

The second commit performs the actual move of the MIR map into the type context, for the purposes of future integration with requesting analysis/lowering by-products through `TyCtxt`.

Local `Mir` bodies need to be mutated by passes (hence `RefCell`), and at least one pass (`qualify_consts`) needs simultaneous access to multiple `Mir` bodies (hence arena-allocation).
`Mir` bodies loaded from other crates appear as if immutably borrowed (by `.borrow()`-ing one `Ref` and subsequently "leaking" it) to avoid, at least dynamically, *any* possibility of their local mutation.

One caveat is that lint passes can now snoop at the MIR (helpful) or even mutate it (dangerous).
However, lints are unstable anyway and we can find a way to deal with this in due time.
Future work will result in a tighter API, potentially hiding mutation *completely* outside of MIR passes.
2016-10-29 20:46:20 -07:00
bors
248e7b302a Auto merge of #37399 - retep998:heap-of-trouble, r=alexcrichton
Print out the error when HeapFree failures do occur

cc https://github.com/rust-lang/rust/issues/37395

I'd prefer to use `assert!` instead of `debug_assert!` if the cost is acceptable.

r? @alexcrichton
2016-10-29 17:28:07 -07:00
Josh Triplett
07bff08e4f Copyediting on documentation for write! and writeln!
Fix various sentence fragments, missing articles, and other grammatical
issues in the documentation for write! and writeln!.

Also fix the links (and link names) for common return types.
2016-10-29 15:44:43 -07:00
Josh Triplett
955829cee9 Add documentation to write! and writeln! on using both io::Write and fmt::Write
Various existing code does this, but the documentation doesn't explain
how to do it.
2016-10-29 15:23:49 -07:00