Commit Graph

67322 Commits

Author SHA1 Message Date
Ralf Jung
7d9e26f788 Fix alloc_jemalloc debug feature
At least, I think that's how it should be.  'debug' is how the feature is called in Cargo.toml.
2017-08-29 16:10:13 +02:00
Ariel Ben-Yehuda
9be155d88e remove the hacky selection impl in method::probe 2017-08-29 14:34:43 +03:00
Ariel Ben-Yehuda
75d6820ae0 Track closure signatures & kinds in freshened types
This allows caching closure signatures and kinds in the normal selection
and evaluation caches, and fixes the exponential worst-case in
@remram44's example, which is a part of #43787.

This improvement is complenentary to #43999 - they fix different cases.
2017-08-29 14:17:15 +03:00
Ariel Ben-Yehuda
fceab9fb34 make probe priority logic clearer 2017-08-29 14:09:19 +03:00
bors
faf477a8c2 Auto merge of #44111 - zackmdavis:feature_attr_error_span, r=nikomatsakis
feature error span on attribute for fn_must_use, SIMD/align reprs, macro reëxport

There were several feature-gated attributes for which the feature-not-available
error spans would point to the item annotated with the gated attribute, when it
would make more sense for the span to point to the attribute itself: if the
attribute is removed, the function/struct/_&c._ likely still makes sense and the
program will compile. (Note that we decline to make the analogous change for
the `main`, `start`, and `plugin_registrar` features, for in those cases it
makes sense for the span to implicate the entire function, of which there is
little hope of using without the gated attribute.)

![feature_attr_error_span](https://user-images.githubusercontent.com/1076988/29746531-fd700bfe-8a91-11e7-9c5b-6f5324083887.png)
2017-08-29 10:22:14 +00:00
bors
6f82dea299 Auto merge of #44059 - oli-obk:ok_suggestion, r=nikomatsakis
Suggest `Ok(())` when encountering `Result::<(), E>::Ok()`
2017-08-29 06:18:23 +00:00
Jeremy Sorensen
5009a222e0 use an optional bool to keep track of ignore-git setting, if not specified by the end, use the channel to determine its value 2017-08-28 20:45:04 -07:00
Alex Crichton
ecd127d23f rustbuild: Fix dependencies of build-manifest
No need to depend on librustc! All we need is libstd

Closes #44140
2017-08-28 18:42:08 -07:00
Alex Crichton
7007a44cf2 rustbuild: Fix uplifting stage1 on cross builds
When we pass `--host` the `self.hosts` array doesn't contain `self.build`, so
check `self.build` to see if we can uplift.
2017-08-28 18:32:29 -07:00
Nick Cameron
d66f0c2072 Rename the rls component to rls-preview on beta/stable 2017-08-29 13:27:57 +12:00
bors
d2d50691aa Auto merge of #44049 - alexcrichton:nounwind-allocators, r=BurntSushi
std: Mark allocation functions as nounwind

This commit flags all allocation-related functions in liballoc as "this can't
unwind" which should largely resolve the size-related issues found on #42808.
The documentation on the trait was updated with such a restriction (they can't
panic) as well as some other words about the relative instability about
implementing a bullet-proof allocator.

Closes #42808
2017-08-29 00:58:17 +00:00
bors
bef07b859d Auto merge of #43999 - arielb1:immediate-project, r=nikomatsakis
clear out projection subobligations after they are processed

After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.

This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching.

r? @nikomatsakis
2017-08-28 20:42:27 +00:00
Guillaume Gomez
f50bf8636e Fix invalid linker position 2017-08-28 22:40:09 +02:00
bors
9a59d69323 Auto merge of #43076 - Zoxc:gen, r=arielb1
Generator support

This adds experimental support for generators intended to land once https://github.com/rust-lang/rfcs/pull/2033 is approved.

This is not yet ready to be merged. Things to do:
- [x] Make closure arguments on generators an error
- [x] Spot FIXMEs
- [x] Pass make tidy
- [x] Write tests
- [x] Document the current syntax and semantics for generators somewhere
- [x] Use proper error message numbers
- [x] ~~Make the implicit argument type default to `()`~~
2017-08-28 16:36:03 +00:00
Jeremy Sorensen
fb30dd70ce getting rid of all changes due to this PR thus far, starting from a clean slate 2017-08-28 08:43:35 -07:00
Alex Crichton
b6f554b6dc std: Mark allocation functions as nounwind
This commit flags all allocation-related functions in liballoc as "this can't
unwind" which should largely resolve the size-related issues found on #42808.
The documentation on the trait was updated with such a restriction (they can't
panic) as well as some other words about the relative instability about
implementing a bullet-proof allocator.

Closes #42808
2017-08-28 08:06:52 -07:00
Alex Crichton
e5b123cba2 Update the libc submodule
Brings in a few fixes for wasm/asmjs
2017-08-28 07:58:19 -07:00
Michael Layzell
2f19383742 Update test issue-41783.rs for new attribute highlighting behaviour 2017-08-28 10:52:49 -04:00
Alex Crichton
a996d5eec7 Tweak rls submodule again 2017-08-28 07:32:25 -07:00
Corey Farwell
10bd39e7af Rewrite std::net::ToSocketAddrs doc examples.
in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios
2017-08-28 09:23:06 -04:00
Oliver Schneider
0b72497307
Suggest Ok(()) when encountering Ok() 2017-08-28 14:13:14 +02:00
Thomas Jespersen
2bffa310a8 compiletest: Change Config comments to doc comments 2017-08-28 13:35:53 +02:00
bors
5caca6fa02 Auto merge of #44114 - daboross:patch-1, r=dtolnay
Clarify that VecDeque::swap can panic

The previous documentation mentioned this, but ambiguously used the term "fail".

This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.

If there's anything else I can do to improve this PR, I'd be happy to do so! Just saw this when reading through the docs in passing - it was slightly unclear what "fail" meant.
2017-08-28 10:42:11 +00:00
Sergio Benitez
8be132e9d7 Initial diagnostic API for proc-macros.
This commit introduces the ability to create and emit `Diagnostic`
structures from proc-macros, allowing for proc-macro authors to emit
warning, error, note, and help messages just like the compiler does.
2017-08-28 02:58:22 -07:00
Zack M. Davis
8bb29465d0 feature error span on attr. for fn_must_use, SIMD/align, macro reëxport
There were several feature-gated attributes for which the
feature-not-available error spans would point to the item annotated with
the gated attribute, when it would make more sense for the span to point
to the attribute itself: if the attribute is removed, the
function/struct/&c. likely still makes sense and the program will
compile. (Note that we decline to make the analogous change for the
`main`, `start`, and `plugin_registrar` features, for in those cases it
makes sense for the span to implicate the entire function, of which
there is little hope of using without the gated attribute.)
2017-08-28 00:58:41 -07:00
Alex Crichton
876278f395 Ignore a threaded test on emscripten 2017-08-27 23:37:50 -07:00
Eduard-Mihai Burtescu
c76a024121 rustc: treat impl associated consts like const items for constness. 2017-08-28 09:27:58 +03:00
Eduard-Mihai Burtescu
9b61771ea8 rustc_mir: conservatively deny non-noop drops in constant contexts. 2017-08-28 09:27:05 +03:00
Eduard-Mihai Burtescu
b8c05fe90b rustc: use rvalue scope semantics for constant initializers. 2017-08-28 09:27:05 +03:00
bors
a0c3bd2d23 Auto merge of #44107 - alexcrichton:no-shell-configure, r=Mark-Simulacrum
rustbuild: Rewrite the configure script in Python

This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
Closes #43295
Closes #42255
Closes #38058
Closes #32176
2017-08-28 06:04:10 +00:00
Alex Crichton
9eff522c6d Update the rls submodule again 2017-08-27 21:01:16 -07:00
Tatsuyuki Ishi
45d31ac2f2 bootstrap: remove unneeded extern crate
The crate itself is internally referenced by serde_derive.
2017-08-28 12:52:02 +09:00
Alex Crichton
a9b0a7ba93 rustbuild: Rewrite the configure script in Python
This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
2017-08-27 18:53:30 -07:00
Alex Crichton
8a9e32b3fa Update lock file 2017-08-27 18:52:02 -07:00
John Kåre Alsaker
d29af37999 Merge branch 'master' of https://github.com/rust-lang/rust into gen 2017-08-28 02:41:16 +02:00
John Kåre Alsaker
7c5780b356 Update rls 2017-08-28 02:39:17 +02:00
Michal 'vorner' Vaner
6fc35de5e8
Fail ./x.py on invalid command
Make the ./x.py script fail when run with an invalid command, like:

  ./x.py nonsense

This helps in case of chaining multiple runs, eg.:

  ./x.py biuld && ./x.py test
2017-08-27 19:20:03 +02:00
bors
e266888240 Auto merge of #44110 - alexcrichton:docker-init, r=Mark-Simulacrum
ci: Remove the need for `dumb-init`

Newer versions of Docker have a `--init` argument which spawns an init process
in the container, which we should be able to use everywhere now.
2017-08-27 15:31:11 +00:00
Ariel Ben-Yehuda
7534f7375b clear out projection subobligations after they are processed
After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.

This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching
2017-08-27 18:13:23 +03:00
bors
eb8f2586eb Auto merge of #44060 - taleks:issue-43205, r=arielb1
Fixes issue #43205: ICE in Rvalue::Len evaluation.

- fixes evaluation of array length for zero-sized type referenced by rvalue operand.
- adds test to verify fix.

*Cause of the issue*.

Zero-sized aggregates are handled as operands, not lvalues. Therefore while visiting `Assign` statement by `LocalAnalyser`, `mark_as_lvalue()` is not called for related `Local`. This behaviour is controlled by `rvalue_creates_operand()` method.

As result it causes error later, when rvalue operand is evaluated in `trans_rvalue_operand()` while handling `Rvalue::Len` case. Array length evaluation invokes `trans_lvalue()` which expects referenced `Local` to be value, not operand.

*How it is fixed*.

In certain cases result of `Rvalue::Len` can be evaluated without calling
`trans_lvalue()`. Method `evaluate_array_len()` is introduced to handle length
evaluation for zero-sized types referenced by Locals.

*Some concerns*.

- `trans_lvalue()` has two other entry points in `rvalue.rs`: it is invoked while handling `Rvalue::Ref` and `Rvalue::Discriminant`. There is a chance those may produce the same issue, but I've failed to write a specific test that leads to this.
- `evaluate_array_len()` performs the same check (matches lvalue and `Local`), which is performed again in `trans_lvalue()`. Without changing `trans_lvalue()` signature to make it aware that caller deals with rvalue, it seems there is no cheap solution to avoid this check.
2017-08-27 12:53:48 +00:00
David Ross
f1b91f4037 Clarify that VecDeque::swap can panic
The previous documentation mentioned this, but ambiguously used the term "fail".

This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.
2017-08-27 03:22:53 -07:00
bors
78e95bb7ac Auto merge of #42588 - ishitatsuyuki:patch-1, r=petrochenkov
Make unused-extern-crate warn-by-default

Apart from enabling the lint, this pull request also removes existing unused crates in the codebase, and fix some amount of false positives on crates with special purposes.

Now that all false positive issues are closed, it should be possible to make it available to wider users.

Quote:
> Now that macro modularization is implemented, this is true today! *https://github.com/rust-lang/rust/issues/30849#issuecomment-286573218*

Concerns: can break some `#[deny(warnings)]`.

Close #42591
2017-08-27 10:02:51 +00:00
Tatsuyuki Ishi
a91bdf4ad5 Update Cargo submodule 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
2140a1e5c6 Whitelist for dummy_jemalloc 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
7a8d38e522 Additional libc cleanup 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
7f054990b6 Platform gate libc in libtest 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
bf9bdefe8a Whitelist unwind import in std
This is a part of libbacktrace linkage and thus the compiler cannot detect if it's used or not.
2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
6e18fe4d22 Add missing dependency for Windows 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
8309a4c43b Address review comments, second turn 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
611b111139 Move unused-extern-crate to late pass 2017-08-27 19:02:24 +09:00