Commit Graph

53340 Commits

Author SHA1 Message Date
Geordon Worley
4dcb63707e change unstable to stable on traits and set version properly 2016-05-01 04:26:39 -04:00
Geordon Worley
666dd57c80 fix implementation of Ord for Cell<T> and RefCell<T> where T: Ord 2016-05-01 04:07:47 -04: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
Guillaume Gomez
27c01cb497 Add process types documentation 2016-05-01 01:04:45 +02: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
Cyryl Płotnicki-Chudyk
18dafe83b5 Code cleanup in download() in bootstrap.py
Make download() receive less parameters and use it explicitly 2 times
in get().
2016-04-30 08:43:01 +02:00
Cyryl Płotnicki-Chudyk
f5884f6824 Get a file during bootstrap to a temp location.
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.

The temporary files are deleted in case of an exception.
2016-04-30 08:09:53 +02: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
Simonas Kazlauskas
603a833480 Temporary hack for 32959
Gets rid of the warning
2016-04-29 03:16:29 +03: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
Michael Woerister
0fc9f9a200 Make the codegen unit partitioner also emit item declarations. 2016-04-28 16:53:00 -04:00
bors
115c6c810c Auto merge of #33217 - aochagavia:fileloader, r=nrc
rustc_driver: Allow running the compiler with a FileLoader

cc @nrc. I chose to implement this in such a way that it doesn't break anything. Please let me know if you want me to change anything.
2016-04-28 12:27:27 -07:00
Michael Woerister
7f04d35cc6 Add FixedUnitCount codegen unit partitioning strategy. 2016-04-28 14:36:34 -04:00
Michael Woerister
c61f22932d Let the translation item collector make a distinction between drop-glue kinds 2016-04-28 14:36:34 -04:00
bors
02acf0917f Auto merge of #33211 - alexcrichton:android-back-in-time, r=nagisa
std: Add compatibility with android-9

The Gecko folks currently use Android API level 9 for their builds, so they're
requesting that we move back our minimum supported API level from 18 to 9. Turns
out, ABI-wise at least, there's not that many changes we need to take care of.
The `ftruncate64` API appeared in android-12 and the `log2` and `log2f` APIs
appeared in android-18. We can have a simple shim for `ftruncate64` which falls
back on `ftruncate` and the `log2` function can be approximated with just
`ln(f) / ln(2)`.

This should at least get the standard library building on API level 9, although
the tests aren't quite happening there just yet. As we seem to be growing a
number of Android compatibility shims, they're now centralized in a common
`sys::android` module.
2016-04-28 10:17:44 -07:00
Timothy McRoy
0cfb5a0bb6 Add detailed error message for E0434 #32777 2016-04-28 10:56:32 -05:00
Georg Brandl
815987b4ce Clarify std::fmt width docs w.r.t. dollar syntax and give example. 2016-04-28 17:50:12 +02:00
bors
ea6b3ddee9 Auto merge of #33257 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests

- Successful merges: #32991, #33056, #33095, #33152, #33212, #33218, #33234
- Failed merges: #32912
2016-04-28 07:59:02 -07:00
Steve Klabnik
b9dd8aa4c2 Rollup merge of #33234 - TomasHubelbauer:TomasHubelbauer-patch-1, r=GuillaumeGomez
Fix use of the `move` command in the Windows shell

`move` works both in `cmd` and in Powershell. `mv` works only in Powershell and the book says nothing about which shell is recommended so this could confuse beginners.

Closes #33219.
2016-04-28 09:51:44 -04:00
Steve Klabnik
68f7fc52fd Rollup merge of #33218 - oli-obk:interned_str_cmp, r=nikomatsakis
allow InternedString to be compared to &str directly
2016-04-28 09:51:44 -04:00
Steve Klabnik
7c2a98570c Rollup merge of #33212 - bombless:scope-of-function-body, r=nikomatsakis
Improve error message about regions of function body

"scope of parameters for functions" is harder for me to read than "scope of function body", I hope others feel the same, as in <https://play.rust-lang.org/?gist=b4df68b395b807698bd2ba98cf3d5ce3&version=stable&backtrace=0&run=1>
 Thank @Aatch for the help :)
2016-04-28 09:51:44 -04:00
Steve Klabnik
c72a771dd8 Rollup merge of #33152 - bwinterton:master, r=steveklabnik
Make HashSet::Insert documentation more consistent

I have made the HashSet::Insert documentation more consistent in the use of the term 'value' vs 'key'. Also clarified that if _this_ value is present true is returned, instead of the ambiguous 'a value present'.

r? @steveklabnik
2016-04-28 09:51:44 -04:00
Steve Klabnik
32db236342 Rollup merge of #33095 - xogeny:xogeny-patch-1, r=steveklabnik
Tweaks to sections related to Ownership

Reading through these sections, I thought the intro text could be improved slightly.  So
here is a PR that addresses what was bugging me about it. :-)

Main issue was the wording of the opening sentence ("guide" is not clearly defined and the
wording was a bit too terse in my opinion).  I also took issue with the term "one of the most
unique".  Uniqueness is a `bool`, not an `f64`. :-)

r? @steveklabnik
2016-04-28 09:51:44 -04:00
Steve Klabnik
385a54f4d4 Rollup merge of #33056 - GuillaumeGomez:as_mut_ptr_example, r=steveklabnik
Improve as_mut ptr method example

r? @steveklabnik
2016-04-28 09:51:43 -04:00