]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #51401 - estebank:warn-repr, r=cramertj
Mark Rousskov [Fri, 8 Jun 2018 23:21:05 +0000 (17:21 -0600)]
Rollup merge of #51401 - estebank:warn-repr, r=cramertj

Warn on `repr` without hints

Fix #51376.

6 years agoRollup merge of #51396 - SimonSapin:option-nonzero-layout, r=SimonSapin
Mark Rousskov [Fri, 8 Jun 2018 23:21:04 +0000 (17:21 -0600)]
Rollup merge of #51396 - SimonSapin:option-nonzero-layout, r=SimonSapin

Make the size of Option<NonZero*> a documented guarantee.

Closes #49137, the tracking issue for `NonZero*`, as this was the last remaining open question.

Note that `ptr::NonNull<T>` already documents a similar guarantee.

6 years agoRollup merge of #51394 - nnethercote:NCA-depths, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:21:03 +0000 (17:21 -0600)]
Rollup merge of #51394 - nnethercote:NCA-depths, r=nikomatsakis

Use scope tree depths to speed up `nearest_common_ancestor`.

This patch adds depth markings to all entries in the `ScopeTree`'s
`parent_map`. This change increases memory usage somewhat, but permits a
much faster algorithm to be used:

- If one scope has a greater depth than the other, the deeper scope is
  moved upward until they are at equal depths.

- Then we move the two scopes upward in lockstep until they match.

This avoids the need to keep track of which scopes have already been
seen, which was the major part of the cost of the old algorithm. It also
reduces the number of child-to-parent moves (which are hash table
lookups) when the scopes start at different levels, because it never
goes past the nearest common ancestor the way the old algorithm did.

Finally, the case where one of the scopes is the root is now handled in
advance, because that is moderately common and lets us skip everything.

This change speeds up runs of several rust-perf benchmarks, the best by
6%.

A selection of the bigger improvements:
```
clap-rs-check
        avg: -2.6%      min: -6.6%      max: 0.0%
syn-check
        avg: -2.2%      min: -5.0%      max: 0.0%
style-servo-check
        avg: -2.9%?     min: -4.8%?     max: 0.0%?
cargo-check
        avg: -1.3%      min: -2.8%      max: 0.0%
sentry-cli-check
        avg: -1.0%      min: -2.1%      max: 0.0%
webrender-check
        avg: -0.9%      min: -2.0%      max: 0.0%
style-servo
        avg: -0.9%?     min: -1.8%?     max: -0.0%?
ripgrep-check
        avg: -0.7%      min: -1.8%      max: 0.1%
clap-rs
        avg: -0.9%      min: -1.6%      max: -0.2%
regex-check
        avg: -0.2%      min: -1.3%      max: 0.1%
syn
        avg: -0.6%      min: -1.3%      max: 0.1%
hyper-check
        avg: -0.5%      min: -1.1%      max: 0.0%
```
The idea came from multiple commenters on my blog and on Reddit. Thank you!

r? @nikomatsakis

6 years agoRollup merge of #51391 - estebank:docspan, r=GuillaumeGomez
Mark Rousskov [Fri, 8 Jun 2018 23:21:02 +0000 (17:21 -0600)]
Rollup merge of #51391 - estebank:docspan, r=GuillaumeGomez

Use spans pointing at the inside of a rustdoc attribute

Follow up to #51111.

Point to the link in a rustdoc attribute where intralink resolution failed, instead of the full rustdoc attribute's span.

r? @GuillaumeGomez cc @kennytm

6 years agoRollup merge of #51360 - estebank:braces-around-literal-structs, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:21:00 +0000 (17:21 -0600)]
Rollup merge of #51360 - estebank:braces-around-literal-structs, r=nikomatsakis

Suggest parentheses when a struct literal needs them

When writing a struct literal in an expression that expects a block to
be started afterwards (like an `if` statement), do not suggest using the
same struct literal:

```
did you mean `S { /* fields * /}`?
```

Instead, suggest surrounding the expression with parentheses:

```
did you mean `(S { /* fields * /})`?
```

Fix #47360, #50090. Leaving #42982 open to come back to this problem with a better solution.

6 years agoRollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:20:59 +0000 (17:20 -0600)]
Rollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakis

Stabilize unit tests with non-`()` return type

References #48854

6 years agoRollup merge of #51276 - Havvy:dyn-trait-send-send, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:20:58 +0000 (17:20 -0600)]
Rollup merge of #51276 - Havvy:dyn-trait-send-send, r=nikomatsakis

Dedup auto traits in trait objects.

Fixes #47010

Note that the test file `run-pass/trait-object-auto-dedup.rs` passes before and after this change. It's the `ui` test that changed from compiling to not compiling. Which does make this a breaking change, but I cannot imagine anybody actually being broken by it.

6 years agoRollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebank
Mark Rousskov [Fri, 8 Jun 2018 23:20:57 +0000 (17:20 -0600)]
Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebank

Fix Issue 38777

When looking through for a closing bracket in the loop condition, adds them to expecteds.
https://github.com/rust-lang/rust/issues/38777

6 years agoRollup merge of #50143 - petrochenkov:mexuniq, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:20:55 +0000 (17:20 -0600)]
Rollup merge of #50143 - petrochenkov:mexuniq, r=nikomatsakis

Add deprecation lint for duplicated `macro_export`s

cc https://github.com/rust-lang/rust/issues/35896#issuecomment-381370556

6 years agoBuilt, corrected, and run tests. Added expected stderr files.
Crazycolorz5 [Fri, 8 Jun 2018 21:25:53 +0000 (17:25 -0400)]
Built, corrected, and run tests. Added expected stderr files.

6 years agoAuto merge of #51410 - oli-obk:cargo_bump, r=nikomatsakis
bors [Fri, 8 Jun 2018 17:04:14 +0000 (17:04 +0000)]
Auto merge of #51410 - oli-obk:cargo_bump, r=nikomatsakis

Update the cargo submodule

This allows the next nightly to publish crates that are on the 2018 edition (in an unstable way)

6 years agoAuto merge of #51426 - kennytm:rollup, r=kennytm
bors [Thu, 7 Jun 2018 23:06:39 +0000 (23:06 +0000)]
Auto merge of #51426 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #51186 (Remove two redundant .nll.stderr files)
 - #51283 (Deny #[cfg] and #[cfg_attr] on generic parameters.)
 - #51368 (Fix the use of closures within #[panic_implementation])
 - #51380 (Remove dependency on fmt_macros from typeck)
 - #51389 (rustdoc: Fix missing stability and src links for inlined external macros)
 - #51399 (NLL performance boost)
 - #51407 (Update RLS and Rustfmt)
 - #51417 (Revert #49719)
 - #51420 (Tries to address the recent network issues)

Failed merges:

6 years agoRollup merge of #51420 - kennytm:some-network-issues, r=Mark-Simulacrum
kennytm [Thu, 7 Jun 2018 23:05:48 +0000 (07:05 +0800)]
Rollup merge of #51420 - kennytm:some-network-issues, r=Mark-Simulacrum

Tries to address the recent network issues

1. Set the DNS server to 8.8.8.8/8.8.4.4/1.1.1.1/1.0.0.1 to workaround the daily "Cannot resolve host" error these two weeks.
2. Remove the unnecessary command `gem update --system` (originally added as experiment of the "Could not find a valid gem" error, which turns out to be useless).

6 years agoRollup merge of #51417 - pietroalbini:revert-49719, r=nikomatsakis
kennytm [Thu, 7 Jun 2018 23:05:47 +0000 (07:05 +0800)]
Rollup merge of #51417 - pietroalbini:revert-49719, r=nikomatsakis

Revert #49719

This also needs to be backported into beta.

Fixes #51416.
r? @nikomatsakis

6 years agoRollup merge of #51407 - nrc:update, r=Mark-Simulacrum
kennytm [Thu, 7 Jun 2018 23:05:45 +0000 (07:05 +0800)]
Rollup merge of #51407 - nrc:update, r=Mark-Simulacrum

Update RLS and Rustfmt

r? @Mark-Simulacrum

Fixes tests

6 years agoRollup merge of #51399 - ngg:nll-performance, r=nikomatsakis
kennytm [Thu, 7 Jun 2018 23:05:44 +0000 (07:05 +0800)]
Rollup merge of #51399 - ngg:nll-performance, r=nikomatsakis

NLL performance boost

This makes compilation of the [inflate](https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector/benchmarks/inflate) benchmark compile 2 times faster on my computer when NLL is enabled.
This does not fix the #51377 perfectly, it's still 4-5 times slower than without NLL, but it's a start.

6 years agoRollup merge of #51389 - ollie27:rustdoc_cross_macro_src_stab, r=QuietMisdreavus
kennytm [Thu, 7 Jun 2018 23:05:43 +0000 (07:05 +0800)]
Rollup merge of #51389 - ollie27:rustdoc_cross_macro_src_stab, r=QuietMisdreavus

rustdoc: Fix missing stability and src links for inlined external macros

Fixes #38951

r? @QuietMisdreavus

6 years agoRollup merge of #51380 - Mark-Simulacrum:remove-fmt-macros, r=oli-obk
kennytm [Thu, 7 Jun 2018 23:05:42 +0000 (07:05 +0800)]
Rollup merge of #51380 - Mark-Simulacrum:remove-fmt-macros, r=oli-obk

Remove dependency on fmt_macros from typeck

None

6 years agoRollup merge of #51368 - varkor:panic_implementation-closures, r=eddyb
kennytm [Thu, 7 Jun 2018 23:05:41 +0000 (07:05 +0800)]
Rollup merge of #51368 - varkor:panic_implementation-closures, r=eddyb

Fix the use of closures within #[panic_implementation]

Fixes #51365.

6 years agoRollup merge of #51283 - kennytm:fix-51279-preempt-the-warning-song-and-dance, r...
kennytm [Thu, 7 Jun 2018 23:05:39 +0000 (07:05 +0800)]
Rollup merge of #51283 - kennytm:fix-51279-preempt-the-warning-song-and-dance, r=nikomatsakis

Deny #[cfg] and #[cfg_attr] on generic parameters.

Fix #51279.

Attributes on generic parameters are not expanded, meaning `#[cfg]`, `#[cfg_attr]` and attribute proc macros are entirely ignored on them.

This PR makes using the first two attributes an error, because if they are correctly expanded will affect the AST and change code behavior.

I'm beta-nominating this, because generic parameter attributes are stabilizing in 1.27, and if we did not reserve their usage, we may never be able to repurpose the meaning of these attributes in the Rust 2015 edition.

6 years agoRollup merge of #51186 - pnkfelix:remove-unneccessary-nll-stderr-files, r=oli-obk
kennytm [Thu, 7 Jun 2018 23:05:38 +0000 (07:05 +0800)]
Rollup merge of #51186 - pnkfelix:remove-unneccessary-nll-stderr-files, r=oli-obk

Remove two redundant .nll.stderr files

It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck, and thus we can just fallback on those `.stderr` files that already exist for AST-borrowck.

Bravo!

(it is a good idea to remove these files, because it slightly reduces the amount of time humans will spend reviewing the .nll.stderr fileset...)

((it *might* be worthwhile trying to change the `compiletest` code to even issue a warning when two such files have equivalent contents... but I am not going so far as to try to implement that right now...))

6 years agoUse public DNS server instead of 169.254.169.254 on CI.
kennytm [Thu, 7 Jun 2018 20:33:46 +0000 (04:33 +0800)]
Use public DNS server instead of 169.254.169.254 on CI.

Tries to workaround travis-ci/travis-ci#9696.

6 years agoRemove the `gem update` from `.travis.yml`
kennytm [Thu, 7 Jun 2018 20:31:30 +0000 (04:31 +0800)]
Remove the `gem update` from `.travis.yml`

It has no effect on deployment error and may cause further network issues.

6 years agoUse `from_inner_byte_pos` for cleaner code
Esteban Küber [Thu, 7 Jun 2018 16:47:09 +0000 (09:47 -0700)]
Use `from_inner_byte_pos` for cleaner code

6 years agoRevert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"
Pietro Albini [Thu, 7 Jun 2018 15:07:05 +0000 (17:07 +0200)]
Revert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"

This reverts commit d6ba1b9b021c408fcad60ee52acf8af5e1b2eb00, reversing
changes made to 8de5353f75dcde04abe947e0560dc5edd861cf3a.

6 years agoUpdate the cargo submodule
Oliver Schneider [Thu, 7 Jun 2018 09:51:43 +0000 (11:51 +0200)]
Update the cargo submodule

6 years agoUse Ord::cmp for auto traits since stable sort not needed
Havvy [Thu, 7 Jun 2018 05:11:37 +0000 (22:11 -0700)]
Use Ord::cmp for auto traits since stable sort not needed

6 years agoUpdate RLS and Rustfmt
Nick Cameron [Thu, 7 Jun 2018 03:14:49 +0000 (15:14 +1200)]
Update RLS and Rustfmt

6 years agoDo not account for inner/outer attr
Esteban Küber [Thu, 7 Jun 2018 00:39:58 +0000 (17:39 -0700)]
Do not account for inner/outer attr

6 years agoUse consistent span for repr attr suggestion
Esteban Küber [Wed, 6 Jun 2018 22:48:08 +0000 (15:48 -0700)]
Use consistent span for repr attr suggestion

6 years agoAuto merge of #50699 - Zoxc:blocking-queries, r=mw
bors [Wed, 6 Jun 2018 22:24:07 +0000 (22:24 +0000)]
Auto merge of #50699 - Zoxc:blocking-queries, r=mw

Blocking Rayon queries

r? @michaelwoerister

6 years agoAdd i/u size
Esteban Küber [Wed, 6 Jun 2018 21:34:07 +0000 (14:34 -0700)]
Add i/u size

6 years agoChange repr documentation link
Esteban Küber [Wed, 6 Jun 2018 21:33:07 +0000 (14:33 -0700)]
Change repr documentation link

6 years agoExpand (fix) u* and i* `repr` hints
Esteban Küber [Wed, 6 Jun 2018 21:25:57 +0000 (14:25 -0700)]
Expand (fix) u* and i* `repr` hints

6 years agoAdd `transparent` as valid `repr` hint
Esteban Küber [Wed, 6 Jun 2018 21:18:13 +0000 (14:18 -0700)]
Add `transparent` as valid `repr` hint

6 years agoTurn warning into lint
Esteban Küber [Wed, 6 Jun 2018 21:11:48 +0000 (14:11 -0700)]
Turn warning into lint

6 years agoIt turns out that the diagnostics generated from NLL for these cases are now exactly...
Felix S. Klock II [Tue, 29 May 2018 21:25:53 +0000 (23:25 +0200)]
It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck. Bravo!

6 years agoAuto merge of #51263 - cramertj:futures-in-core, r=aturon
bors [Wed, 6 Jun 2018 19:42:19 +0000 (19:42 +0000)]
Auto merge of #51263 - cramertj:futures-in-core, r=aturon

Add Future and task system to the standard library

This adds preliminary versions of the `std::future` and `std::task` modules in order to unblock development of async/await (https://github.com/rust-lang/rust/issues/50547). These shouldn't be considered as final forms of these libraries-- design questions about the libraries should be left on https://github.com/rust-lang/rfcs/pull/2418. Once that RFC (or a successor) is merged, these APIs will be adjusted as necessary.

r? @aturon

6 years agoExpand output and suggestions, fix tests
Esteban Küber [Wed, 6 Jun 2018 19:31:43 +0000 (12:31 -0700)]
Expand output and suggestions, fix tests

6 years agoAdd Future and task system to the standard library
Taylor Cramer [Thu, 31 May 2018 01:23:10 +0000 (18:23 -0700)]
Add Future and task system to the standard library

6 years agoWarn on `repr` without hints
Esteban Küber [Wed, 6 Jun 2018 17:02:09 +0000 (10:02 -0700)]
Warn on `repr` without hints

6 years agoAuto merge of #51333 - GuillaumeGomez:reexport-fmt-alignment, r=SimonSapin
bors [Wed, 6 Jun 2018 17:01:56 +0000 (17:01 +0000)]
Auto merge of #51333 - GuillaumeGomez:reexport-fmt-alignment, r=SimonSapin

Reexport fmt::Alignment into std

Follow-up of #51078.

6 years agoWhen unable to sinthesize link span, fallback to previous behavior
Esteban Küber [Wed, 6 Jun 2018 16:14:09 +0000 (09:14 -0700)]
When unable to sinthesize link span, fallback to previous behavior

6 years agoUse spans pointing at the inside of a rustdoc attribute
Esteban Küber [Wed, 6 Jun 2018 07:30:25 +0000 (00:30 -0700)]
Use spans pointing at the inside of a rustdoc attribute

6 years agoNLL performance boost
Gergely Nagy [Wed, 6 Jun 2018 15:31:22 +0000 (17:31 +0200)]
NLL performance boost

6 years agofix stderrs
dylan_DPC [Wed, 6 Jun 2018 15:21:57 +0000 (20:51 +0530)]
fix stderrs

6 years agoAuto merge of #51201 - estebank:dotdot, r=petrochenkov
bors [Wed, 6 Jun 2018 14:04:06 +0000 (14:04 +0000)]
Auto merge of #51201 - estebank:dotdot, r=petrochenkov

Accept `..` in incorrect position to avoid further errors

We currently give a specific message when encountering a `..` anywhere
other than the end of a pattern. Modify the parser to accept it (while
still emitting the error) so that we don't also trigger "missing fields
in pattern" errors afterwards.

Add suggestions to either remove trailing `,` or moving the `..` to the
end.

Follow up to #49268.

6 years agoUpdate Cargo
John Kåre Alsaker [Wed, 6 Jun 2018 13:25:47 +0000 (15:25 +0200)]
Update Cargo

6 years agoReduce the amount of unsafe code and mark handle_deadlock as unsafe
John Kåre Alsaker [Tue, 5 Jun 2018 21:12:19 +0000 (23:12 +0200)]
Reduce the amount of unsafe code and mark handle_deadlock as unsafe

6 years agoAdd comments
John Kåre Alsaker [Thu, 31 May 2018 21:04:21 +0000 (23:04 +0200)]
Add comments

6 years agoMake QueryWaiter use safe code
John Kåre Alsaker [Thu, 31 May 2018 18:24:56 +0000 (20:24 +0200)]
Make QueryWaiter use safe code

6 years agoCreate thread-pool
John Kåre Alsaker [Sun, 27 May 2018 11:10:12 +0000 (13:10 +0200)]
Create thread-pool

6 years agoAdd comments and misc changes
John Kåre Alsaker [Sun, 27 May 2018 11:05:41 +0000 (13:05 +0200)]
Add comments and misc changes

6 years agoUse raw pointers
John Kåre Alsaker [Sun, 27 May 2018 07:01:57 +0000 (09:01 +0200)]
Use raw pointers

6 years agoAdd and use OnDrop::disable
John Kåre Alsaker [Sun, 27 May 2018 05:47:44 +0000 (07:47 +0200)]
Add and use OnDrop::disable

6 years agoUse try_lock in collect_active_jobs
John Kåre Alsaker [Sun, 27 May 2018 05:46:19 +0000 (07:46 +0200)]
Use try_lock in collect_active_jobs

6 years agoUpdate Rayon version
John Kåre Alsaker [Mon, 14 May 2018 01:00:52 +0000 (03:00 +0200)]
Update Rayon version

6 years agoMake queries block and handle query cycles
John Kåre Alsaker [Fri, 6 Apr 2018 10:56:59 +0000 (12:56 +0200)]
Make queries block and handle query cycles

6 years agoMake the size of Option<NonZero*> a documented guarantee.
Simon Sapin [Wed, 6 Jun 2018 11:46:51 +0000 (13:46 +0200)]
Make the size of Option<NonZero*> a documented guarantee.

Closes #49137, the tracking issue for `NonZero*`,
as this was the last remaining open question.

Note that `ptr::NonNull<T>` already documents a similar guarantee.

6 years agoAuto merge of #51316 - oli-obk:const_err, r=nikomatsakis
bors [Wed, 6 Jun 2018 11:17:15 +0000 (11:17 +0000)]
Auto merge of #51316 - oli-obk:const_err, r=nikomatsakis

Refactor the const eval diagnostic API

* no longer report "const eval error" for things that have typeck errors
* errors and lints have saner spans and messages
* unified the diagnostic logic (const eval errors were slightly different depending on where they were reported, and there was also code duplication between the different reporters)
* report errors if an erroneous constant is used inside a promoted (fixes most of #50814)

6 years agoUse scope tree depths to speed up `nearest_common_ancestor`.
Nicholas Nethercote [Wed, 6 Jun 2018 02:44:05 +0000 (12:44 +1000)]
Use scope tree depths to speed up `nearest_common_ancestor`.

This patch adds depth markings to all entries in the `ScopeTree`'s
`parent_map`. This change increases memory usage somewhat, but permits a
much faster algorithm to be used:

- If one scope has a greater depth than the other, the deeper scope is
  moved upward until they are at equal depths.

- Then we move the two scopes upward in lockstep until they match.

This avoids the need to keep track of which scopes have already been
seen, which was the major part of the cost of the old algorithm. It also
reduces the number of child-to-parent moves (which are hash table
lookups) when the scopes start at different levels, because it never
goes past the nearest common ancestor the way the old algorithm did.

Finally, the case where one of the scopes is the root is now handled in
advance, because that is moderately common and lets us skip everything.

This change speeds up runs of several rust-perf benchmarks, the best by
6%.

6 years agoAuto merge of #50844 - bjorn3:adhoc_compiller_calls, r=nrc
bors [Wed, 6 Jun 2018 08:14:11 +0000 (08:14 +0000)]
Auto merge of #50844 - bjorn3:adhoc_compiller_calls, r=nrc

Add AdHocCalls and pass self to build_controller as Box<Self>

This makes it easier to write custom drivers.

6 years agoappend unused variables with _
dylan_DPC [Wed, 6 Jun 2018 06:52:38 +0000 (12:22 +0530)]
append unused variables with _

6 years agorustdoc: Fix missing stability and src links for inlined external macros
Oliver Middleton [Wed, 6 Jun 2018 03:13:55 +0000 (04:13 +0100)]
rustdoc: Fix missing stability and src links for inlined external macros

6 years agoRemove fmt_macros dependency
Mark Simulacrum [Tue, 5 Jun 2018 21:55:07 +0000 (15:55 -0600)]
Remove fmt_macros dependency

6 years agoRebase fallout
Oliver Schneider [Tue, 5 Jun 2018 19:08:43 +0000 (21:08 +0200)]
Rebase fallout

6 years agoAdd source information the const propagation of places
Oliver Schneider [Tue, 5 Jun 2018 17:54:50 +0000 (19:54 +0200)]
Add source information the const propagation of places

6 years agoRemove another unused error variant
Oliver Schneider [Tue, 5 Jun 2018 17:06:29 +0000 (19:06 +0200)]
Remove another unused error variant

6 years agoRemove unused IndexOutOfBounds variant
Oliver Schneider [Tue, 5 Jun 2018 17:02:03 +0000 (19:02 +0200)]
Remove unused IndexOutOfBounds variant

6 years agoSatisfy the untiring tidy
Oliver Schneider [Sun, 3 Jun 2018 01:39:26 +0000 (03:39 +0200)]
Satisfy the untiring tidy

6 years agoProperly report transitive errors
Oliver Schneider [Sun, 3 Jun 2018 01:01:06 +0000 (03:01 +0200)]
Properly report transitive errors

6 years agoReferring to erroneous constants in promoteds must abort the build
Oliver Schneider [Sun, 3 Jun 2018 00:04:20 +0000 (02:04 +0200)]
Referring to erroneous constants in promoteds must abort the build

6 years agoRefactor the const eval diagnostic API
Oliver Schneider [Sat, 2 Jun 2018 21:38:57 +0000 (23:38 +0200)]
Refactor the const eval diagnostic API

6 years agoremove redundant match branch
dylan_DPC [Tue, 5 Jun 2018 18:14:42 +0000 (23:44 +0530)]
remove redundant match branch

6 years agoflag changed to none
dylan_DPC [Tue, 5 Jun 2018 17:58:32 +0000 (23:28 +0530)]
flag changed to none

6 years agoAdd comment
bjorn3 [Mon, 4 Jun 2018 10:14:50 +0000 (12:14 +0200)]
Add comment

6 years agoImpl CompilerCalls for CompileController instead of AdHocCompilerCalls
bjorn3 [Sun, 27 May 2018 18:02:51 +0000 (20:02 +0200)]
Impl CompilerCalls for CompileController instead of AdHocCompilerCalls

6 years agoAdd AdHocCalls and pass self to build_controller as Box<Self>
bjorn3 [Thu, 17 May 2018 18:32:09 +0000 (20:32 +0200)]
Add AdHocCalls and pass self to build_controller as Box<Self>

6 years agoAccount for comma in suggestion
Esteban Küber [Wed, 30 May 2018 18:04:39 +0000 (11:04 -0700)]
Account for comma in suggestion

6 years agoImprove diagnostics for incorrect `..` usage
Esteban Küber [Wed, 30 May 2018 05:31:00 +0000 (22:31 -0700)]
Improve diagnostics for incorrect `..` usage

When using `..` somewhere other than the end, parse the rest of the
pattern correctly while still emitting an error.

Add suggestions to either remove trailing `,` or moving the `..` to the
end.

6 years agoAccept `..` in incorrect position to avoid further errors
Esteban Küber [Tue, 29 May 2018 23:37:06 +0000 (16:37 -0700)]
Accept `..` in incorrect position to avoid further errors

We currently give a specific message when encountering a `..` anywhere
other than the end of a pattern. Modify the parser to accept it (while
still emitting the error) so that we don't also trigger "missing fields
in pattern" errors afterwards.

6 years agoAuto merge of #51369 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Tue, 5 Jun 2018 15:26:26 +0000 (15:26 +0000)]
Auto merge of #51369 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 7 pull requests

Successful merges:

 - #50852 (Add doc comment to hiding portions of code example)
 - #51183 (Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function)
 - #51255 (Fix confusing error message for sub_instant)
 - #51256 (Fix crate-name option in rustdoc)
 - #51308 (Check array indices in constant propagation)
 - #51343 (test: Ignore some problematic tests on sparc and sparc64)
 - #51358 (Tests that #39963 is fixed on MIR borrowck)

Failed merges:

6 years agoRollup merge of #51358 - barzamin:tests-39963, r=oli-obk
Mark Simulacrum [Tue, 5 Jun 2018 14:33:51 +0000 (08:33 -0600)]
Rollup merge of #51358 - barzamin:tests-39963, r=oli-obk

Tests that #39963 is fixed on MIR borrowck

As title.

fixes #39963

6 years agoRollup merge of #51343 - glaubitz:sparc64-tests, r=shepmaster
Mark Simulacrum [Tue, 5 Jun 2018 14:33:49 +0000 (08:33 -0600)]
Rollup merge of #51343 - glaubitz:sparc64-tests, r=shepmaster

test: Ignore some problematic tests on sparc and sparc64

This updates the list of tests which can be safely ignored on sparc and sparc64.

6 years agoRollup merge of #51308 - fanzier:const-prop-array-bounds-check, r=oli-obk
Mark Simulacrum [Tue, 5 Jun 2018 14:33:48 +0000 (08:33 -0600)]
Rollup merge of #51308 - fanzier:const-prop-array-bounds-check, r=oli-obk

Check array indices in constant propagation

Previously, uses of constant weren't correctly propagated.
This fixes #48920.

r? @oli-obk because you suggested it

6 years agoRollup merge of #51256 - GuillaumeGomez:fix-rustdoc-crate-name, r=QuietMisdreavus
Mark Simulacrum [Tue, 5 Jun 2018 14:33:47 +0000 (08:33 -0600)]
Rollup merge of #51256 - GuillaumeGomez:fix-rustdoc-crate-name, r=QuietMisdreavus

Fix crate-name option in rustdoc

Fixes #51229.

r? @QuietMisdreavus

6 years agoRollup merge of #51255 - avdv:patch-1, r=kennytm
Mark Simulacrum [Tue, 5 Jun 2018 14:33:46 +0000 (08:33 -0600)]
Rollup merge of #51255 - avdv:patch-1, r=kennytm

Fix confusing error message for sub_instant

When subtracting an Instant from another, the function will panick when `RHS > self`, but the error message confusingly displays a different error:

```rust
let i = Instant::now();
let other = Instant::now();
if other > i {
    println!("{:?}", i - other);
}
```
This results in a panic:
```
thread 'test_instant' panicked at 'other was less than the current instant', libstd/sys/unix/time.rs:292:17
```
But clearly, `other` was actually greater than the current instant.

6 years agoRollup merge of #51183 - teiesti:rustdoc-book-termination, r=steveklabnik
Mark Simulacrum [Tue, 5 Jun 2018 14:33:45 +0000 (08:33 -0600)]
Rollup merge of #51183 - teiesti:rustdoc-book-termination, r=steveklabnik

Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function

Closes #50721.

I suggest that someone double-checks my English since I am not a native speaker.

r? @steveklabnik

6 years agoRollup merge of #50852 - mandeep:fix-rustdoc-example-testing, r=GuillaumeGomez
Mark Simulacrum [Tue, 5 Jun 2018 14:33:43 +0000 (08:33 -0600)]
Rollup merge of #50852 - mandeep:fix-rustdoc-example-testing, r=GuillaumeGomez

Add doc comment to hiding portions of code example

fixes #50816

Not sure if this is all that's needed, but I think it's a good start. One thing to note is that the code block is a text block where it could possibly be a rust block.

6 years agoFix the use of closures within #[panic_implementation]
varkor [Tue, 5 Jun 2018 13:36:36 +0000 (14:36 +0100)]
Fix the use of closures within #[panic_implementation]

6 years agoAuto merge of #51246 - vakaras:select_polonius_algo_via_env_var, r=nikomatsakis
bors [Tue, 5 Jun 2018 12:49:40 +0000 (12:49 +0000)]
Auto merge of #51246 - vakaras:select_polonius_algo_via_env_var, r=nikomatsakis

Select Polonius algorithm via `POLONIUS_ALGORITHM` environment variable

This pull request allows selecting the Polonius algorithm being used by providing an environment variable `POLONIUS_ALGORITHM`.

Example usage:
```
POLONIUS_ALGORITHM=compare RUST_LOG=rustc_mir::borrow_check::nll=trace  ./x.py test --stage 1 --compare-mode polonius -- src/test/ui/nll/issue-47680.rs
...
stderr:
------------------------------------------
 INFO 2018-05-31T17:35:31Z: rustc_mir::borrow_check::nll: Using Polonius algorithm: Compare
 INFO 2018-05-31T17:35:31Z: rustc_mir::borrow_check::nll: Using Polonius algorithm: Compare

------------------------------------------
...
```

r? @nikomatsakis

6 years agoImprove wording
Tobias Stolzmann [Thu, 31 May 2018 18:01:03 +0000 (20:01 +0200)]
Improve wording

6 years agoUpdate rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function
Tobias Stolzmann [Tue, 29 May 2018 19:43:10 +0000 (21:43 +0200)]
Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function

6 years agoAuto merge of #51140 - GuillaumeGomez:doc-keyword, r=QuietMisdreavus
bors [Tue, 5 Jun 2018 10:00:08 +0000 (10:00 +0000)]
Auto merge of #51140 - GuillaumeGomez:doc-keyword, r=QuietMisdreavus

rustdoc: introduce the #[doc(keyword="")] attribute for documenting keywords

Part of #34601.

r? @QuietMisdreavus

6 years agoFix tests
Fabian Zaiser [Sun, 3 Jun 2018 21:39:02 +0000 (23:39 +0200)]
Fix tests

6 years agoFix tidy
Fabian Zaiser [Sun, 3 Jun 2018 19:05:22 +0000 (21:05 +0200)]
Fix tidy

6 years agoPropagate uses of constants correctly so that array index checks work
Fabian Zaiser [Sun, 3 Jun 2018 18:57:45 +0000 (20:57 +0200)]
Propagate uses of constants correctly so that array index checks work

6 years agoAuto merge of #51324 - oli-obk:debug_overflow, r=estebank
bors [Tue, 5 Jun 2018 07:14:52 +0000 (07:14 +0000)]
Auto merge of #51324 - oli-obk:debug_overflow, r=estebank

Also prevent overflow in debug builds

r? @estebank

6 years agoChanged a few tests, and changed the folder of a few of them.
Crazycolorz5 [Tue, 5 Jun 2018 02:35:39 +0000 (22:35 -0400)]
Changed a few tests, and changed the folder of a few of them.

6 years agoSuggest braces when a struct literal needs them
Esteban Küber [Tue, 5 Jun 2018 01:47:47 +0000 (18:47 -0700)]
Suggest braces when a struct literal needs them

When writing a struct literal in an expression that expects a block to
be started afterwards (like an `if` statement), do not suggest using the
same struct literal:

```
did you mean `S { /* fields * /}`?
```

Instead, suggest surrounding the expression with parentheses:

```
did you mean `(S { /* fields * /})`?
```