Commit Graph

52847 Commits

Author SHA1 Message Date
Georg Brandl
0e89f55982 E0269: add suggestion to check for trailing semicolons
In situations where the value of the last expression must be inferred,
rustc will not emit the "you might need to remove the semicolon" warning,
so at least note this in the extended description.

Fixes: #30497
2016-05-02 06:10:10 +02:00
bors
700d3e2374 Auto merge of #33190 - jseyfried:improve_diagnostics, r=nrc
resolve: improve diagnostics and lay groundwork for resolving before ast->hir

This PR improves diagnostics in `resolve` and lays some groundwork for resolving before ast->hir.

More specifically,
 - It removes an API in `resolve` intended for external refactoring tools (see #27493) that appears not to be in active use. The API is incompatible with resolving before ast->hir, but could be rewritten in a more compatible and less intrusive way.
 - It improves the diagnostics for pattern bindings that conflict with `const`s.
 - It improves the diagnostics for modules used as expressions (fixes #33186).
 - It refactors away some uses of the hir map, which is unavavailable before ast->hir lowering.

r? @eddyb
2016-05-01 20:39:33 -07:00
bors
855fb61922 Auto merge of #33296 - jseyfried:non_idempotent_lowering, r=nrc
Remove the requirement that ast->hir lowering be reproducible

This PR changes the ast->hir lowerer to be non-reproducible, and it removes the lowering context's id cache.

If the `hir` of an `ast` node needs to be reproduced, we can use the hir map instead of the lowerer -- for example, `tcx.map.expect_expr(expr.id)` instead of `lower_expr(lcx, expr)`.

r? @nrc
2016-05-01 18:28:24 -07:00
Jeffrey Seyfried
ef69ef81e3 Remove outdated comment 2016-05-02 00:43:02 +00:00
Jeffrey Seyfried
522b6ed8a7 Avoid keeping MTWT tables for save-analysis 2016-05-02 00:19:22 +00:00
Jeffrey Seyfried
298a1c056f Cleanup formatting 2016-05-02 00:19:19 +00:00
Jeffrey Seyfried
b8dc2a7c76 Remove the lowering context's id caching system 2016-05-01 23:49:12 +00:00
Jeffrey Seyfried
ca88c44a90 Avoid using the lowering context in librustc_save_analysis 2016-05-01 23:30:18 +00:00
Jeffrey Seyfried
02df9f32b1 Remove idempotent lowering test 2016-05-01 23:30:14 +00:00
bors
adda14a033 Auto merge of #33298 - drbo:patch-1, r=alexcrichton
Note that later versions of G++ are okay

G++ 4.7 is the minimum requirement, but later versions are also okay.
2016-05-01 16:17:29 -07:00
Georg Brandl
ffba7b7254 typeck: remove confusing suggestion for calling a fn type
* It is not clear what a "base function" is.
* The suggestion just adds parens, so suggests calling without args.

The second point could be fixed with e.g. `(...)` instead of `()`,
but the preceding "note: X is a function, perhaps you wish to call it"
should already be clear enough.

Fixes: #31341
2016-05-01 22:24:39 +02:00
bors
a4b0481d1c Auto merge of #33317 - michaelwoerister:fix-partitioning-tests-race, r=alexcrichton
Fix a race condition caused by concurrently executed codegen unit tests.

This hopefully fixes issue #33315.

This short-term solution just makes sure that every test uses its own directory so they can't get into conflict with each other.

As a more long-term solution, I'd probably prefer to make the partitioning scheme specifiable via `-Ccodegen-units` (e.g. like `-Ccodegen-units=per-module`) so that we don't have to rely on `-Zincremental` in these test cases.

r? @alexcrichton
2016-05-01 12:59:25 -07:00
Georg Brandl
b51698ad60 match check: note "catchall" patterns in unreachable error
Caught as catchall patterns are:

* unconditional name bindings
* references to them
* tuple bindings with catchall elements

Fixes #31221.
2016-05-01 21:58:46 +02:00
Stephen Mather
018c595574 doc/book/getting-started.md: Removed references to creating a new executable from 'Converting to Cargo'. 2016-05-01 19:45:38 +01:00
Timothy McRoy
3f49920495 Add error explanation for E0501 2016-05-01 13:41:11 -05:00
Stephen Mather
538098c7a4 doc/book/getting-started.md: Corrected spelling of 'Internet'. 2016-05-01 19:15:33 +01:00
Michael Woerister
a4128e5950 Fix a race condition caused by concurrently executed codegen unit tests. 2016-05-01 13:53:39 -04:00
Oliver Middleton
e8cbcef86e Fix alloc_jemalloc on windows gnu targets
jemalloc prefixes the symbols by default on Windows so we need to account
for that to avoid link errors such as: `undefined reference to `mallocx'`
when using alloc_jemalloc.
2016-05-01 13:16:06 +01:00
Georg Brandl
41861691eb libsyntax/pp: replace manual ring buffer with a VecDeque 2016-05-01 12:26:34 +02:00
Georg Brandl
3eef0831cb libsyntax/pp: minor modernizations
* implement Display on Token instead of custom tok_str() fn
* use expression returns
* remove redundant parens in asserts
* remove "/* bad */" comments that appear to be related to early
  changes in memory management
* and a few individual idiomatic changes
2016-05-01 12:26:34 +02:00
James Miller
3906aef5c6 Handle coercion casts properly when building the MIR
Coercion casts (`expr as T` where the type of `expr` can be coerced to
`T`) are essentially no-ops, as the actual work is done by a coercion.
Previously a check for type equality was used to avoid emitting the
redundant cast in the MIR, but this failed for coercion casts of
function items that had lifetime parameters. The MIR trans code doesn't
handle `FnPtr -> FnPtr` casts and produced an error.

Also fixes a bug with type ascription expressions not having any
adjustments applied.

Fixes #33295
2016-05-01 17:56:07 +12:00
Jeffrey Seyfried
0649942a46 Panic on relowering an AST node with a cached node id 2016-04-30 21:33:27 +00:00
Demetri Obenour
08207c9b52 Note that later versions of G++ are okay
G++ 4.7 is the minimum requirement, but later versions are also okay.
2016-04-30 17:21:18 -04:00
bors
2a815a26c8 Auto merge of #33276 - bwinterton:btreeset-insert-doc-fix, r=GuillaumeGomez
Make BTreeSet::Insert docs more consistent

Made the BTreeSet::Insert documentation consistent with the HashSet::Insert documentation by using the term 'value' instead of 'key'.

r? @steveklabnik
2016-04-30 08:59:46 -07:00
bors
9e17622449 Auto merge of #33279 - brson:insert-diatribe-against-github-here, r=alexcrichton
configure: Add a sanity check for tarballs without submodules

Because GitHub publishes broken tarballs on our behalf that we can't
disable, this adds a check that src/liblibc exists, and then
complains if not.

Tested.
2016-04-30 04:55:28 -07:00
Georg Brandl
e6201cfb5c Implement find() on Chain iterators
This results in a roughly 2x speedup compared to the default impl
"inherited" from Iterator.
2016-04-30 11:16:35 +02:00
bors
b0aefff714 Auto merge of #32846 - jseyfried:allow_unconfigured_gated_expanded_items, r=nrc
Avoid gated feature checking unconfigured expanded items

Avoid gated feature checking unconfigured macro-expanded items (fixes #32840).
Unconfigured items that are not macro-expanded are already not gated feature checked.
r? @nrc
2016-04-30 02:07:33 -07:00
Brandon Edens
16eaecbe43 Emit warning to user when attempting to use optimize for size on non-nightly builds. 2016-04-29 22:45:24 -07:00
bors
46504e9a9d Auto merge of #33148 - sfackler:entry-key, r=alexcrichton
Add Entry::key

This method was present on both variants of Entry, but not the enum

cc #32281

r? @alexcrichton
2016-04-29 18:11:25 -07:00
Simonas Kazlauskas
04f8ba2ece Impl int/uint::MIN/MAX in terms of min/max_value 2016-04-30 03:40:34 +03:00
Simonas Kazlauskas
5f956103c8 Fix patterns of the constants that are const meth
See the regression test for the sample code this fixes
2016-04-30 03:40:09 +03:00
bors
9b63263d0d Auto merge of #33229 - timothy-mcroy:master, r=guillaumegomez
Explain E0434
2016-04-29 12:59:39 -07:00
Brian Anderson
6bc9318318 configure: Add a sanity check for tarballs without submodules
Because GitHub publishes broken tarballs on our behalf that we can't
disable, this adds a check that src/liblibc exists, and then
complains if not.
2016-04-29 19:39:22 +00:00
Georg Brandl
84bd1ce984 Fix std::fmt format spec: named args are allowed with "$" syntax 2016-04-29 21:17:22 +02:00
Jeffrey Seyfried
a70e42a953 Remove use of ast_map.expect_item() and improve diagnostics (fixes #33186) 2016-04-29 18:34:49 +00:00
Jeffrey Seyfried
5a4e0b14e3 Remove use of ast_map.span_if_local() and improve diagnostics 2016-04-29 18:34:40 +00:00
Jeffrey Seyfried
60c8f7dbf5 Revert #27493 2016-04-29 18:34:13 +00:00
bors
8b1dcf40f2 Auto merge of #33232 - jseyfried:resolve_ast_groundwork, r=nrc
resolve: cleanup and groundwork for resolving the AST

Cleanup `resolve` and refactor away uses of the hir map (incorrectly named `ast_map`).
r? @nrc
2016-04-29 09:02:36 -07:00
Brayden Winterton
3c1d08744d Make Btreeset::Insert docs more consistent 2016-04-29 09:59:39 -06:00
bors
e07e34c4b0 Auto merge of #33272 - Manishearth:rollup, r=Manishearth
Rollup of 4 pull requests

- Successful merges: #33239, #33248, #33253, #33258
- Failed merges:
2016-04-29 06:49:45 -07:00
Manish Goregaokar
f30058facf Rollup merge of #33258 - birkenfeld:fmt-dollar-syntax, r=brson
Clarify std::fmt width docs w.r.t. dollar syntax and give example.

The previous version only said "the `2$` syntax", which while introduced in the grammar is not very self-explanatory.
2016-04-29 19:17:59 +05:30
Manish Goregaokar
3a0efffc9d Rollup merge of #33253 - ergenekonyigit:master, r=alexcrichton
rustdoc: fixed some RFCs

r? @alexcrichton
2016-04-29 19:17:58 +05:30
Manish Goregaokar
13c1956f7c Rollup merge of #33248 - jseyfried:fix_save_analysis_bug, r=nrc
rustc_save_analysis: fix a bug in which glob imports are not dumped

This fixes #33213, a bug that prevents glob imports from being included in the save-analysis data.
r? @nrc
2016-04-29 19:17:57 +05:30
bors
c0c08e2d77 Auto merge of #33093 - alexcrichton:rustbuild-rmake, r=nikomatsakis
test: Move run-make tests into compiletest

Forcing them to be embedded in makefiles precludes being able to run them in
rustbuild, and adding them to compiletest gives us a great way to leverage
future enhancements to our "all encompassing test suite runner" as well as just
moving more things into Rust.

All tests are still Makefile-based in the sense that they rely on `make` being
available to run them, but there's no longer any Makefile-trickery to run them
and rustbuild can now run them out of the box as well.
2016-04-28 23:34:00 -07:00
Brandon Edens
49d28258a7 Place optimize for size and minsize rustc invocation options behind a nightly
compiler check to prevent their inclusion in the stable / beta compilers.
2016-04-28 23:08:30 -07:00
Brandon Edens
8a8493a565 Add opt-level=s and opt-level=z tests to the existing tests that confirm proper
compiler of other opt-levels.
2016-04-28 23:08:30 -07:00
Brandon Edens
b1337d309a Add opt-level options for optimizing for size and minimum size. This attempts
to mimic the behavior of clang's options Os and Oz.
2016-04-28 23:08:30 -07:00
Alex Crichton
126e09e5e5 test: Move run-make tests into compiletest
Forcing them to be embedded in makefiles precludes being able to run them in
rustbuild, and adding them to compiletest gives us a great way to leverage
future enhancements to our "all encompassing test suite runner" as well as just
moving more things into Rust.

All tests are still Makefile-based in the sense that they rely on `make` being
available to run them, but there's no longer any Makefile-trickery to run them
and rustbuild can now run them out of the box as well.
2016-04-28 21:46:40 -07:00
Jeffrey Seyfried
e9c42257d5 Fix #33213, a bug in which glob imports are not included in save-analysis data 2016-04-28 22:04:39 +00:00
bors
8da2bcac5d Auto merge of #33171 - michaelwoerister:collector-drop-glue, r=nikomatsakis
Some preliminary work towards making trans "collector driven".

The `trans::collector` already collects all translation items and `trans::partitioning` distributes these translation items into codegen units. The changes in this PR provide the following extensions to this functionality:

1. Drop-glue is handled more accurately now, knowing about the difference between `DropGlueKind::Ty` and `DropGlueKind::TyContents`.
2. The partitioning module now supports the `FixedUnitCount` strategy which more or less corresponds to the partitioning one gets via supplying `-Ccodegen-units` today.
3. The partitioning scheme also takes care of assigned LLVM declarations to codegen units, not just definitions (declarations for external items not yet implemented).

It's debatable whether declarations should be handled by the partitioning scheme or whether they should just be emitted on demand.
2016-04-28 14:37:30 -07:00