Commit Graph

78652 Commits

Author SHA1 Message Date
Zack M. Davis
078486b9f6 in which NodeMap and friends are macrotized! 2018-05-28 09:20:14 -07:00
Zack M. Davis
1329605a3d operate on HirId in hir::Pat::each_binding, and consequences of that
Changing the `each_binding` utility method to take the `HirId` of a
binding pattern rather than its `NodeId` seems like a modest first step
in support of the `HirId`ification initiative #50928. (The inspiration
for choosing this in particular came from the present author's previous
work on diagnostics issued during liveness analysis, which is the most
greatly affected module in this change.)
2018-05-28 09:20:14 -07:00
bors
2b1d69d6b5 Auto merge of #51118 - nrc:update, r=oli-obk
Update RLS, Rustfmt, and Cargo

r? @Mark-Simulacrum

Should fix broken rustfmt and RLS builds - Cargo update is needed for compatibility with RLS
2018-05-28 12:39:03 +00:00
bors
16cd84ee22 Auto merge of #50724 - zackmdavis:applicability_rush, r=Manishearth
add suggestion applicabilities to librustc and libsyntax

A down payment on #50723. Interested in feedback on whether my `MaybeIncorrect` vs. `MachineApplicable` judgement calls are well-calibrated (and that we have a consensus on what this means).

r? @Manishearth
cc @killercup @estebank
2018-05-28 10:11:26 +00:00
bors
68e0e58df7 Auto merge of #50612 - Zoxc:thin-slice, r=michaelwoerister
Make &Slice a thin pointer

Split out from https://github.com/rust-lang/rust/pull/50395

r? @michaelwoerister
2018-05-28 07:59:21 +00:00
Nick Cameron
0e6fff80c7 Update RLS, Rustfmt, and Cargo 2018-05-28 14:12:18 +12:00
bors
d0456c6f8f Auto merge of #50892 - davidtwco:issue-50004, r=alexcrichton
Added rustdoc documentation to compiler docs.

Fixes #50004.

r? @alexcrichton
(since you reviewed the last PR about compiler docs)
2018-05-28 01:28:14 +00:00
bors
5f308ee419 Auto merge of #48309 - mark-i-m:anon_param_lint, r=nikomatsakis
Make anon params lint warn-by-default

This is intended as a followup on anonymous parameters deprecation.

Cross-posting from #41686:

> After having read a bit more of the discussion that I can find, I propose a more aggressive deprecation strategy:
> - We make the lint warn-by-default as soon as possible
> - We make anon parameters a hard error at the epoch boundary

cc @matklad @est31 @aturon
2018-05-27 22:28:11 +00:00
bors
ad2591cffc Auto merge of #51062 - mati865:cargo_update, r=alexcrichton
Update cargo

There are few nice fixes waiting already.
2018-05-27 20:27:48 +00:00
Mark Mansi
0e53b78830 Make anon params lint warn-by-default 2018-05-27 14:08:45 -05:00
bors
f9f66c134a Auto merge of #51108 - simartin:issue_51022_follow-up, r=estebank
Address comments in pull request #51084.

This is a follow-up to https://github.com/rust-lang/rust/pull/51084, that's already been integrated into mainline.
2018-05-27 18:08:26 +00:00
bors
dcb405667c Auto merge of #51078 - GuillaumeGomez:stabilize-formatter, r=SimonSapin
Stabilize Formatter alignment

Fixes #27726.

cc @SimonSapin
2018-05-27 16:01:32 +00:00
John Kåre Alsaker
fb4e3b62e0 Add fields to Slice 2018-05-27 17:28:35 +02:00
John Kåre Alsaker
0b6586b989 Add assertions for TyS and TypeVariants sizes 2018-05-27 17:28:35 +02:00
John Kåre Alsaker
6c2d875261 Make &Slice a thin pointer 2018-05-27 17:28:35 +02:00
Simon Martin
9bb939d610 Address comments in pull request #51084. 2018-05-27 17:04:27 +02:00
bors
63b107097c Auto merge of #51105 - uuttff8:master, r=GuillaumeGomez
lib.rs don't beautiful
2018-05-27 13:49:52 +00:00
Guillaume Gomez
fb447f118d Stabilize Formatter alignment 2018-05-27 14:07:43 +02:00
bors
a52b01bc67 Auto merge of #51101 - 11Takanori:fix-typo, r=frewsxcv
Fix typo in macro_parser.rs

innacurate -> inaccurate
2018-05-27 11:43:26 +00:00
bors
7d218fc72f Auto merge of #51084 - simartin:issue_51022, r=estebank
Issue #51022: Improve E0131 message when lifetimes are involved.

Fixes #51022
2018-05-27 09:22:27 +00:00
uuttff8
bbd790ced3
lib.rs don't beautiful 2018-05-27 11:53:43 +03:00
bors
3fd82a5e6b Auto merge of #51090 - kennytm:tidy-check-missing-tracking-issue, r=alexcrichton
Ensure every unstable language feature has a tracking issue.

Filled in the missing numbers:

* `abi_ptx` → #38788
* `generators` → #43122
* `global_allocator` → #27389

Reused existing tracking issues because they were decomposed from a larger feature

* `*_target_feature` → #44839 (reusing the old `target_feature` number)
* `proc_macros_*` → #38356 (reusing the to-be-stabilized `proc_macros` number)

Filed new issues

* `exhaustive_patterns` → #51085
* `pattern_parentheses` → #51087
* `wasm_custom_section` and `wasm_import_module` → #51088
2018-05-27 07:02:17 +00:00
kennytm
509f414b4f
Ensure every unstable feature has a tracking issue. 2018-05-27 14:22:35 +08:00
bors
1a6bda68cd Auto merge of #51075 - estebank:and_the_case_of_the_confusable_float_exponent, r=eddyb
Check for confusable Unicode chars in float literal exponent

Fixing tests for #49989. Resolves #49746.
2018-05-27 03:32:47 +00:00
bors
f0805a4421 Auto merge of #51066 - est31:master, r=sfackler
Point to the current box syntax tracking issue

The issue was used for both box syntax as well as placement new.
It got closed due to placement new being unapproved.
So a new one got created for box syntax, yet neither
the unstable book nor feature_gate.rs got updated.
We are doing this now.

r? @aidanhs
2018-05-27 00:54:12 +00:00
Takanori Ishibashi
f386cdae19 innacurate -> inaccurate 2018-05-27 09:47:04 +09:00
Simon Martin
023137dc1e Issue #51022: Improve E0131 message when lifetimes are involved. 2018-05-27 00:28:49 +02:00
Mateusz Mikuła
05f15d45c3 Update cargo 2018-05-27 00:00:34 +02:00
bors
5015fa346c Auto merge of #51094 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 3 pull requests

Successful merges:

 - #51049 (Fix behaviour of divergence in while loop conditions)
 - #51057 (make ui tests robust with respect to NLL)
 - #51092 ([master] Release notes for 1.26.1)

Failed merges:
2018-05-26 19:05:39 +00:00
Esteban Küber
7dec8a4e99 Fix test 2018-05-26 12:03:50 -07:00
est31
20ab8841b1 Point to the current box syntax tracking issue
The issue was used for both box syntax as well as placement new.
It got closed due to placement new being unapproved.
So a new one got created for box syntax, yet neither
the unstable book nor feature_gate.rs got updated.
We are doing this now.
2018-05-26 19:27:21 +02:00
Mark Simulacrum
472b04d827
Rollup merge of #51092 - Mark-Simulacrum:release-notes-master, r=Mark-Simulacrum
[master] Release notes for 1.26.1

None
2018-05-26 11:22:55 -06:00
Mark Simulacrum
b1de3519c9
Rollup merge of #51057 - pnkfelix:issue-51025-make-ui-tests-robust-wrt-nll, r=nikomatsakis
make ui tests robust with respect to NLL

This PR revises the `ui` tests that I could quickly identify that:
 1. previously had successful compilations under non-lexical lifetimes (NLL) because they assumed lexical lifetimes, but
 2. such assumption of lexical lifetimes was actually not necessarily part of the spirit of the original issue/bug we want to witness.

In many cases, this is simply a matter of adding a use of a borrow so that it gets extended long enough to observe a conflict.

(In some cases the revision was more subtle, such as adding a destructor, or revising the order of declaration of some variables.)

----

With these test revisions in place, I subsequently updated the expected stderr output under the NLL compiletest mode. So now we should get even more testing of NLL than we were before.

Fix #51025
2018-05-26 11:22:54 -06:00
Mark Simulacrum
90b7bf6e0a
Rollup merge of #51049 - varkor:break-while-condition, r=nikomatsakis
Fix behaviour of divergence in while loop conditions

This fixes `'a: while break 'a {};` being treated as diverging, by tracking break expressions in the same way as in `loop` expressions.

Fixes #50856.

r? @nikomatsakis
2018-05-26 11:22:53 -06:00
Mark Simulacrum
ae80941b11 Copy release notes from stable branch to master 2018-05-26 11:19:21 -06:00
bors
1e504d301c Auto merge of #51072 - petrochenkov:ifield, r=eddyb
Use `Ident`s for fields in HIR

Continuation of https://github.com/rust-lang/rust/pull/49718, part of https://github.com/rust-lang/rust/issues/49300
2018-05-26 16:56:22 +00:00
bors
1594c6c650 Auto merge of #51052 - nikomatsakis:obsolete-arrow, r=petrochenkov
restore emplacement syntax (obsolete)

Fix https://github.com/rust-lang/rust/issues/50832

r? @petrochenkov
2018-05-26 14:30:30 +00:00
Vadim Petrochenkov
1e4269cb83 Add Ident::as_str helper 2018-05-26 15:20:23 +03:00
bors
7a0e6a837f Auto merge of #51082 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests

Successful merges:

 - #50987 (Underline multiple suggested replacements in the same line)
 - #51014 (Add documentation about env! second argument)
 - #51034 (Remove unused lowering field and method)
 - #51047 (Use AllFacts from polonius-engine)
 - #51048 (Add more missing examples for Formatter)
 - #51056 (Mention and use `Once::new` instead of `ONCE_INIT`)
 - #51059 (What does an expression look like, that consists only of special characters?)
 - #51065 (Update nomicon link in transmute docs)
 - #51067 (Add inner links in documentation)
 - #51070 (Fail typecheck if we encounter a bogus break)
 - #51073 (Rename TokenStream::empty to TokenStream::new)

Failed merges:
2018-05-26 12:03:28 +00:00
Vadim Petrochenkov
189c0a1297 Use Idents for fields in HIR 2018-05-26 14:41:58 +03:00
kennytm
84b2e14b9d
Rollup merge of #51073 - dtolnay:empty, r=alexcrichton
Rename TokenStream::empty to TokenStream::new

There is no precedent for the `empty` name -- we do not have `Vec::empty` or `HashMap::empty` etc.

I would propose landing this but reflecting it in a non-breaking release of proc-macro2 that provides both `new` and a deprecated `empty` constructor.

Tracking issue: #38356

r? @alexcrichton
2018-05-26 19:32:33 +08:00
kennytm
5089ebc568
Rollup merge of #51070 - est31:fix_break_const_ice, r=estebank
Fail typecheck if we encounter a bogus break

Lone breaks outside of loops create errors in the
loop check pass but as they are not fatal,
compilation continues.

MIR building code assumes all HIR break statements
to point to valid locations and fires ICEs if this
assumption is violated. In normal compilation,
this causes no issues, as code apparently prevents
MIR from being built if errors are present.

However, before that, typecheck runs and with it
MIR const eval. Here we operate differently
from normal compilation: it doesn't check for any
errors except for type checker ones and then
directly builds the MIR.

This constellation causes an ICE-on-error if
bogus break statements are being put into array
length expressions.

This commit fixes this ICE by letting typecheck
fail if bogus break statements are encountered.
This way, MIR const eval fails cleanly with a
type check error.

Fixes #50576
Fixes #50581
2018-05-26 19:32:32 +08:00
kennytm
239e3d2dd7
Rollup merge of #51067 - mcarton:patch-1, r=steveklabnik
Add inner links in documentation

From [this SO question](https://stackoverflow.com/q/50518757/2733851) it looks like this page isn't really clear.
I personally do think this page is quite clear, the only think I could think of was adding some references.
2018-05-26 19:32:30 +08:00
kennytm
18028eb217
Rollup merge of #51065 - mbrubeck:docs, r=rkruppe
Update nomicon link in transmute docs

The list of "invalid primitive values" has moved to a different URL within the Rustonomicon.
2018-05-26 19:32:29 +08:00
kennytm
5d95492d3a
Rollup merge of #51059 - oberien:patch-1, r=nikomatsakis
What does an expression look like, that consists only of special characters?

I had a lot of fun creating this together with @CryZe
2018-05-26 19:32:25 +08:00
kennytm
e0e598bb76
Rollup merge of #51056 - tbu-:pr_once_new, r=dtolnay
Mention and use `Once::new` instead of `ONCE_INIT`
2018-05-26 19:32:24 +08:00
kennytm
08b417084d
Rollup merge of #51048 - GuillaumeGomez:formatter-examples, r=QuietMisdreavus
Add more missing examples for Formatter

r? @QuietMisdreavus
2018-05-26 19:32:23 +08:00
kennytm
e667e7be60
Rollup merge of #51047 - spastorino:use_polonius_engine_facts, r=nikomatsakis
Use AllFacts from polonius-engine
2018-05-26 19:32:22 +08:00
kennytm
e66ba0fe8b
Rollup merge of #51034 - oli-obk:lowering, r=pnkfelix
Remove unused lowering field and method

r? @nikomatsakis

So while trying to understand lowering better, I found out that there's something related to creating definitions. Analyzing that further, I realized that it is entirely dead code.

The `parent_def` field was only ever used for setting and resetting the field itself. The field was never read anywhere else and thus its value was entirely unused.

Maybe the `unused_field` lint should detect when the only use of a field is the field being read without using the read value other than writing back to the field?

The diff is best viewed without whitespace changes getting in the way: https://github.com/rust-lang/rust/pull/51034/files?w=1
2018-05-26 19:32:21 +08:00
kennytm
ee18e92684
Rollup merge of #51014 - GuillaumeGomez:env_docs, r=QuietMisdreavus
Add documentation about env! second argument

Fixes #48044.

r? @QuietMisdreavus
2018-05-26 19:32:20 +08:00