Commit Graph

70799 Commits

Author SHA1 Message Date
Thayne McCombs
37335d3f43 Add Drop impl for linked_list::DrainFilter 2017-12-07 22:20:25 -07:00
bors
5f4b09ee48 Auto merge of #46574 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

- Successful merges: #46416, #46444, #46526, #46539, #46548
- Failed merges:
2017-12-08 02:36:15 +00:00
Guillaume Gomez
0b47f02267 Rollup merge of #46548 - jonathanstrong:master, r=dtolnay
Recommends lazily evaluated alternatives for `Option::or` and `Result::or`

Adds language to docs for `Option` and `Result` recommending the use of lazily evaluated alternatives when appropriate. These comments are intended to echo a [clippy lint] on the same topic. The [reddit discussion] may also be of interest.

[clippy lint]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#or_fun_call
[reddit discussion]: https://www.reddit.com/r/rust/comments/7hutqn/perils_of_optionor_and_resultor/
2017-12-07 23:59:04 +01:00
Guillaume Gomez
655303ce9b Rollup merge of #46539 - oli-obk:cargo_lock, r=alexcrichton
Do not automatically merge `Cargo.lock`

It essentially never does what it's supposed to and often leaves the `Cargo.lock` in a state where it needs manual adjustments or resetting to master/yourbranch. With this setting git will always choose your `Cargo.lock` over the one from master and report a merge error (if both master and your branch touched `Cargo.lock`). Now you can run `./x.py help` and it should normally update the `Cargo.lock` to be one that has everything needed by master and your branch.
2017-12-07 23:59:03 +01:00
Guillaume Gomez
1b7ea6d2d4 Rollup merge of #46526 - GuillaumeGomez:mobile-sidebar, r=QuietMisdreavus
Greatly improve sidebar when width < 700px

Fixes #36531.

r? @QuietMisdreavus

A few screenshots:

<img width="1440" alt="screen shot 2017-12-06 at 00 41 36" src="https://user-images.githubusercontent.com/3050060/33636875-6ad8b1a6-da1e-11e7-8d5b-d6d530ea5258.png">
<img width="1440" alt="screen shot 2017-12-06 at 00 41 40" src="https://user-images.githubusercontent.com/3050060/33636876-6af58196-da1e-11e7-82ab-b82768958037.png">
2017-12-07 23:59:02 +01:00
Guillaume Gomez
14f2bc0405 Rollup merge of #46444 - GuillaumeGomez:css-cleanup, r=QuietMisdreavus
Move colors to main.css

r? @QuietMisdreavus
2017-12-07 23:59:01 +01:00
Guillaume Gomez
912def328f Rollup merge of #46416 - liigo:cfg-macro, r=steveklabnik
doc: macro `cfg!` evaluating at compile-time
2017-12-07 23:59:00 +01:00
Guillaume Gomez
eb84f4243f fix markdown file differences 2017-12-07 23:56:21 +01:00
Guillaume Gomez
8b1fc4b842 Generate difference warnings for markdown files as well 2017-12-07 23:31:23 +01:00
Jeffrey Seyfried
a3517bbeda Add test for #44128. 2017-12-07 14:15:55 -08:00
Guillaume Gomez
423e5ac6f3 Fix JS errors 2017-12-07 22:55:14 +01:00
Guillaume Gomez
71b70feb1f Greatly improve sidebar when width < 700px 2017-12-07 22:42:46 +01:00
bors
c8ddf28527 Auto merge of #46497 - AgustinCB:issue-46311, r=petrochenkov
Modify message for keyword as identifier name

This is a temporary solution to #46311.

The message is generic enough to cover both cases and is probably a fine enough solution to the specific problem described in the task. However, the underlying reason for this to be wrong is that `next_token_inner` returns `Lifetime` even if the token is a label. That's not simple, as the syntax for both can be quite similar and it may need to take a look to the next token to make a decision. I'm not sure I have enough knowledge about the project to be able to solve that (yet!), so I thought I'll fix the immediate problem first.
2017-12-07 21:05:49 +00:00
Agustin Chiappe Berrini
75fc11806d Ignore unsopported constant expr error 2017-12-07 14:33:28 -05:00
bors
9c49f401fe Auto merge of #46532 - est31:master, r=est31
Allow feature-gate tests to live in ui/ and migrate most of the tests from compile-fail

The PR consists of three commits:

1. change tidy to allow feature-gate tests to live in ui/
2. migrate some feature gate tests to ui/ with renaming only
3. migrate some feature gate tests to ui/ with also removing `// gate-test-...` lines and renaming them to the standard `feature-gate-<feat-name>.rs` format.
2017-12-07 18:13:10 +00:00
Jonathan Strong
5847d0babd adds links to methods, removes trailing whitespace 2017-12-07 12:19:24 -05:00
Michael Woerister
0bfc2b92c3 Make CGU-local globals private so they don't show up in the local symbol table. 2017-12-07 17:08:33 +01:00
bors
a8437a0acc Auto merge of #46509 - nikomatsakis:nll-master-to-rust-master-3, r=arielb1
closure handling for NLL

This branch overhauls how we handle closures and universally quantified regions in the NLL code. The goal is to lay the groundwork for "region erasure" by the HIR-based type checker, as well as to avoid "crazy hacks" when it comes to closures. This means that when we type-check a closure, we cannot make use of *any* of the precise values of free regions in its signature, since those are inferred by the HIR type-checker. Therefore, the new code handles closures by:

- Creating fresh regions for every free region that appears in the closure's type, which now includes both its signature and the types of all upvars.
    - This means that the closure is type-checked without knowing about the connections.
- When we encounter some region relationship that we can't locally verify, we propagate it to the closure's creator.
- During MIR typeck, the closure creators then validates those relationships.

For a good example and explanation, see e.g. the test `src/test/nll/closure-requirements/propagate-despite-same-free-region.rs`.

Upcoming changes in the next NLL PR (not included in this PR in order to keep it manageable):

- Improvements to the MIR type checker so that it handles a lot of stuff presently overlooked
- Refactor how we store region values to make it more efficient, better encapsulated
- Propagate "type-outlives" relationships like `T: 'a` in a similar fashion to the one covered in this PR (still in the works, but close)
- Improvements to error reporting (still in the works)

r? @arielb1 or @pnkfelix
2017-12-07 14:59:24 +00:00
Alex Crichton
17fb43bdc6 rustc: Further tweak linkage in ThinLTO
In #46382 the logic around linkage preservation with ThinLTO ws tweaked but the
loop that registered all otherwise exported GUID values as "don't internalize
me please" was erroneously too conservative and only asking "external" linkage
items to not be internalized. Instead we actually want the inversion of that
condition, everything *without* "local" linkage to be internalized.

This commit updates the condition there, adds a test, and...

Closes #46543
2017-12-07 06:53:49 -08:00
bors
ee25791df5 Auto merge of #46523 - CrockAgile:update-fingerprint-tests-macros, r=michaelwoerister
Update fingerprint tests macros

Part of #44924

r? @michaelwoerister
2017-12-07 12:21:28 +00:00
Niko Matsakis
1db58d7fa5 rename Binder::new_not_binding to Binder::dummy
per pnkfelix's suggestion
2017-12-07 05:28:04 -05:00
Niko Matsakis
47037705dc add test comparing free region to bound region
suggested by arielb1
2017-12-07 05:28:04 -05:00
Niko Matsakis
86e7b5c12a use -Znll -Zborrowck=mir -Zverbose consistently 2017-12-07 05:28:04 -05:00
Niko Matsakis
75cf482651 region-ebr-does-not-outlive-static: reuse old test instead 2017-12-07 05:28:04 -05:00
Niko Matsakis
b8e9eaf3ae propagate-approximated-ref: include FIXME comment 2017-12-07 05:28:03 -05:00
Niko Matsakis
2a17b9390b test more failure cases for approximating the "longer" side
as suggested by arielb1
2017-12-07 05:28:03 -05:00
Niko Matsakis
ca60826110 test approximations of the "shorter side" that resort to 'static
This includes the additional case suggested by arielb1.
2017-12-07 05:28:03 -05:00
Niko Matsakis
3c42f18c37 delete stray file 2017-12-07 05:28:03 -05:00
Niko Matsakis
6ee31e2af7 escape-upvar-ref: patch comment per arielb1 2017-12-07 05:28:03 -05:00
Niko Matsakis
8b657d378e escape-upvar-nested: patch "dangling reference" to renamed test 2017-12-07 05:28:02 -05:00
Niko Matsakis
782b9f5c0a escape-argument: improve comment per arielb1's suggestion 2017-12-07 05:28:02 -05:00
Niko Matsakis
dac59ac93a escape-argument-callee: improve comment per arielb1's suggestions 2017-12-07 05:28:02 -05:00
Niko Matsakis
05977fe751 rewrite comment on how to get closure sig, per arielb1's suggestion 2017-12-07 05:28:02 -05:00
Niko Matsakis
47b8ef51d4 don't print self symbol's internal index unless gensymed
It's just not useful. It also makes it hard to have tests that probe
internal state, since the interning number is very sensitive.

Dumping the number in the case of gensym is not ideal but will do for
now.
2017-12-07 05:28:01 -05:00
Niko Matsakis
681f54f795 fix filter to support & and | 2017-12-07 05:28:01 -05:00
Niko Matsakis
b4d71ea6f8 make fn_sig().subst() ICE when used with a closure
It's inefficient, and the substitution there doesn't account for the
extra regions used by NLL inference, so it's a bad thing to encourage.

As it happens all callers already know if they have a closure or not,
from what I can tell.
2017-12-07 05:28:01 -05:00
Niko Matsakis
d5ef3e262f replace InferCtxt::fn_sig with closure_sig 2017-12-07 05:28:01 -05:00
Niko Matsakis
05441abd2b add closure requirement tests, improve debugging output
The overall format is now easier to read. Also, There is now graphviz
output, as well as a `#[rustc_regions]` annotation that dumps internal
state.
2017-12-07 05:28:00 -05:00
Niko Matsakis
ab1c1bc6bc mir-borrowck returns closure requirements, mir-typeck enforces 2017-12-07 05:28:00 -05:00
Niko Matsakis
2ec959fc35 extend MIR dump with detailed, extra information 2017-12-07 05:27:58 -05:00
Niko Matsakis
e5dc4ba280 renumber types in ty::Const and relate them to mir::Constant 2017-12-07 05:27:03 -05:00
bors
bb1bd88ec3 Auto merge of #46221 - GuillaumeGomez:doc-script-load-speedup, r=nrc
Speedup search loading when search url is received

Fixes #45971.

r? @nrc

cc @rust-lang/docs
2017-12-07 09:47:01 +00:00
est31
6dba3e68e6 Migrate even more feature gate tests to ui
We also rename some of the files to conform to the
feature-gate-<feat_name>.rs pattern that is most common.
2017-12-07 10:14:41 +01:00
est31
38438c618c Migrate a few feature gate tests to ui
Renames only in this commit, and obviously
.stderr file additions.
2017-12-07 10:14:39 +01:00
est31
8ba9f9ecf0 Tidy: allow feature-gate tests to be ui tests
ui tests are the future, especially since the
recent improvement where we have gained
checking and requiring of //~ERROR comments.

The tidy feature-gate test check is intended
to be 50% an actual insurance that there is
a check, and 50% to be a teacher that such
checks are required.

With this commit applied, newbies might
interpret stuff wrongly and create tests
that don't fail but succeed instead.

This is not what feature gate tests are
for though. Therefore, in a later step,
when only ui tests are allowed to be feature
gate tests, we will add checking to ensure
that a file marked as gate test is actually
required to be a compilation failure.

Right now implementing such a check is a
bit annoying as one needs to only do it
when the compile-fail test is in the
ui test suite :/.
2017-12-07 10:11:21 +01:00
Agustin Chiappe Berrini
29e2680602 remove unnecessary change 2017-12-07 04:01:59 -05:00
Agustin Chiappe Berrini
dd41929509 remove unused test 2017-12-07 04:00:22 -05:00
Agustin Chiappe Berrini
8647b9da48 remove unnecessary changes 2017-12-07 03:58:44 -05:00
Agustin Chiappe Berrini
fb8ab18f50 remove unnecessary function 2017-12-07 03:56:31 -05:00
Agustin Chiappe Berrini
ce1fed7f52 address comments 2017-12-07 03:52:25 -05:00