Commit graph

98857 commits

Author SHA1 Message Date
Igor Matuszewski
c2249a4bf9 cargo update -p rustfmt-nightly 2019-09-09 18:18:21 +02:00
Igor Matuszewski
91dae2e233 Bump RLS and Rustfmt submodules 2019-09-09 18:18:03 +02:00
Eduard-Mihai Burtescu
625a9d6a4b lldb: avoid mixing "Hit breakpoint" message with other output. 2019-09-09 19:00:08 +03:00
Mazdak Farrokhzad
f7ee13040b
Rollup merge of #64312 - GuillaumeGomez:rustdoc-better-esc-handling, r=Mark-Simulacrum
Unify escape usage

Fixes #63443.

I chose to keep the search text when pressing escape so when we focus on the search bar, we got the results again without needing to load them again. I also unified a bit a few things (maybe I should have done it in another commit, sorry...).

r? @Mark-Simulacrum
2019-09-09 17:42:29 +02:00
Mazdak Farrokhzad
063740f25d
Rollup merge of #64306 - lukas-code:patch-1, r=jonas-schievink
Fix typo in config.toml.example
2019-09-09 17:42:27 +02:00
Mazdak Farrokhzad
1769a425fb
Rollup merge of #64278 - guanqun:check-git, r=Mark-Simulacrum
check git in bootstrap.py
2019-09-09 17:42:26 +02:00
Mazdak Farrokhzad
7e98ec5079
Rollup merge of #64121 - timvermeulen:iter_step_by_internal, r=scottmcm
Override `StepBy::{try_fold, try_rfold}`

Previous PR: https://github.com/rust-lang/rust/pull/51435

The previous PR was closed in favor of https://github.com/rust-lang/rust/pull/51601, which was later reverted. I don't think these implementations will make it harder to specialize `StepBy<Range<_>>` later, so we should be able to land this without any consequences.

This should fix https://github.com/rust-lang/rust/issues/57517 – in my benchmarks `iter` and `iter.step_by(1)` now perform equally well, provided internal iteration is used.
2019-09-09 17:42:24 +02:00
Mazdak Farrokhzad
457a23fabe
Rollup merge of #63468 - c410-f3r:attrs, r=petrochenkov
Resolve attributes in several places

Resolve attributes for Arm, Field, FieldPat, GenericParam, Param, StructField and Variant.

This PR is based on @petrochenkov work located at 83fdb8d598.
2019-09-09 17:42:23 +02:00
Alex Crichton
34662c6961 std: Add a backtrace module
This commit adds a `backtrace` module to the standard library, as
designed in [RFC 2504]. The `Backtrace` type is intentionally very
conservative, effectively only allowing capturing it and printing it.

Additionally this commit also adds a `backtrace` method to the `Error`
trait which defaults to returning `None`, as specified in [RFC 2504].
More information about the design here can be found in [RFC 2504] and in
the [tracking issue].

Implementation-wise this is all based on the `backtrace` crate and very
closely mirrors the `backtrace::Backtrace` type on crates.io. Otherwise
it's pretty standard in how it handles everything internally.

[RFC 2504]: https://github.com/rust-lang/rfcs/blob/master/text/2504-fix-error.md
[tracking issue]: https://github.com/rust-lang/rust/issues/53487

cc #53487
2019-09-09 08:20:34 -07:00
Mazdak Farrokhzad
20a26055b7 pacify tidy. 2019-09-09 17:05:41 +02:00
Guillaume Gomez
0d34fe42f7 Unify escape usage 2019-09-09 17:04:28 +02:00
Mazdak Farrokhzad
eeca6ee9c2 check_match: use pluralisee! 2019-09-09 16:52:58 +02:00
Mazdak Farrokhzad
7d4665b097 check_match: unify check_irrefutable & check_exhaustive more. 2019-09-09 16:44:23 +02:00
Mazdak Farrokhzad
b36a206a30 joined_uncovered_patterns: use slice pats & eta-reduce. 2019-09-09 16:44:23 +02:00
Mazdak Farrokhzad
5435b38456 check_match: extract joined_uncovered_patterns. 2019-09-09 16:44:23 +02:00
Mazdak Farrokhzad
e2640a51ee typeck: use .peel_refs() more. 2019-09-09 16:44:23 +02:00
Mazdak Farrokhzad
50a0ec91e0 check_match: refactor + improve non-exhaustive diag for default binding modes. 2019-09-09 16:44:23 +02:00
Guanqun Lu
b117bd7366 check git in bootstrap.py when trying to update submodule 2019-09-09 22:28:57 +08:00
Oliver Scherer
3d7040bdef Update miri submodule 2019-09-09 14:56:08 +02:00
Lzu Tao
851a5fd997 Update clippy 2019-09-09 12:50:29 +00:00
bors
45859b7ca7 Auto merge of #63118 - Centril:stabilize-bind-by-move, r=matthewjasper
Stabilize `bind_by_move_pattern_guards` in Rust 1.39.0

Closes https://github.com/rust-lang/rust/issues/15287.

After stabilizing `#![feature(bind_by_move_pattern_guards)]`, you can now use bind-by-move bindings in patterns and take references to those bindings in `if` guards of `match` expressions. For example, the following now becomes legal:

```rust
fn main() {
    let array: Box<[u8; 4]> = Box::new([1, 2, 3, 4]);

    match array {
        nums
//      ---- `nums` is bound by move.
            if nums.iter().sum::<u8>() == 10
//                 ^------ `.iter()` implicitly takes a reference to `nums`.
        => {
            drop(nums);
//          --------- Legal as `nums` was bound by move and so we have ownership.
        }
        _ => unreachable!(),
    }
}
```

r? @matthewjasper
2019-09-09 12:46:59 +00:00
Caio
63a5f399ae Resolve attributes in several places
Arm, Field, FieldPat, GenericParam, Param, StructField and Variant
2019-09-09 09:27:15 -03:00
Lukas
4c62950d4f
Fix typo in config.toml.example 2019-09-09 12:18:07 +00:00
bors
824383d4ab Auto merge of #64237 - estebank:tweak-method-not-found, r=Centril
Give method not found a primary span label
2019-09-09 08:39:59 +00:00
bors
1e869133b9 Auto merge of #64195 - mark-i-m:update-rustc-guide-1, r=ehuss
Update rustc-guide

r? @ehuss
2019-09-09 04:44:18 +00:00
Esteban Küber
5799fb419c Give method not found a primary span label 2019-09-08 18:27:02 -07:00
mark
7c2dad292e update guide 2019-09-08 20:25:09 -05:00
Mark Mansi
19db48ae38 update rustc-guide 2019-09-08 20:25:09 -05:00
bors
7eb65dfe66 Auto merge of #64108 - estebank:issue-36836, r=Centril
Do not complain about unconstrained params when Self is Ty Error

Fix #36836.
2019-09-09 00:58:38 +00:00
bors
a6624ed980 Auto merge of #64293 - Centril:rollup-blnhxwl, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #64078 (compiletest: disable -Aunused for run-pass tests)
 - #64263 (Replace "feature gated" wording with "unstable".)
 - #64280 (Factor out pluralisation into syntax::errors)
 - #64288 (use 'get_toml' instead of regular expression)

Failed merges:

r? @ghost
2019-09-08 20:51:22 +00:00
Mazdak Farrokhzad
51b110fc68
Rollup merge of #64288 - guanqun:use-get-toml, r=Mark-Simulacrum
use 'get_toml' instead of regular expression
2019-09-08 22:34:26 +02:00
Mazdak Farrokhzad
1716678450
Rollup merge of #64280 - V1shvesh:master, r=Centril
Factor out pluralisation into syntax::errors

Fixes #64238.
2019-09-08 22:34:24 +02:00
Mazdak Farrokhzad
7cfad41e5f
Rollup merge of #64263 - crlf0710:improve_wording, r=petrochenkov
Replace "feature gated" wording with "unstable".
2019-09-08 22:34:23 +02:00
Mazdak Farrokhzad
510976b4e6
Rollup merge of #64078 - Mark-Simulacrum:compiletest-lint-unused, r=petrochenkov
compiletest: disable -Aunused for run-pass tests

Disabled the flag, but that led to quite a bit of fall out -- I think most of it is benign but I've not investigated thoroughly.

r? @petrochenkov
2019-09-08 22:34:22 +02:00
Esteban Küber
9a561872c4 Always emit unresolved import errors and hide unused import lint 2019-09-08 11:11:26 -07:00
V1shvesh
7457ef8580 Dedent macro definition 2019-09-08 23:01:43 +05:30
V1shvesh
fc4375a895 Remove extra trailing newline 2019-09-08 22:58:28 +05:30
bors
2b8116dced Auto merge of #63994 - Centril:refactor-qualify-consts, r=spastorino,oli-obk
Refactor the `MirPass for QualifyAndPromoteConstants`

This is an accumulation of drive-by commits while working on `Vec::new` as a stable `const fn`.
The PR is probably easiest read commit-by-commit.

r? @oli-obk

cc @eddyb @ecstatic-morse -- your two PRs https://github.com/rust-lang/rust/pull/63812 and https://github.com/rust-lang/rust/pull/63860 respectively will conflict with this a tiny bit but it should be trivial to reintegrate your changes atop of this.
2019-09-08 16:49:39 +00:00
Guanqun Lu
85e09c6531 use 'get_toml' instead of regular expression 2019-09-09 00:21:05 +08:00
Mark Rousskov
6fdbece55f Update test stderr with results of enabling unused lints 2019-09-08 11:32:28 -04:00
bors
2c0931e168 Auto merge of #64281 - Centril:rollup-inyqjf8, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #62205 (Add Iterator comparison methods that take a comparison function)
 - #64152 (Use backtrace formatting from the backtrace crate)
 - #64265 (resolve: Mark more erroneous imports as used)
 - #64267 (rustdoc: fix diagnostic with mixed code block styles)

Failed merges:

r? @ghost
2019-09-08 13:02:54 +00:00
Mazdak Farrokhzad
832b47aee6
Rollup merge of #64267 - ehuss:rustdoc-fix-mixed-code-block, r=GuillaumeGomez
rustdoc: fix diagnostic with mixed code block styles

This fixes a relatively obscure issue where the diagnostic (emitted [here](ef54f57c5b/src/librustdoc/passes/check_code_block_syntax.rs (L69))) would get confused since the "is_fenced" flag wasn't reset properly.
2019-09-08 12:11:59 +02:00
Mazdak Farrokhzad
3a3280326e
Rollup merge of #64265 - petrochenkov:useerr, r=estebank
resolve: Mark more erroneous imports as used

Fixes https://github.com/rust-lang/rust/issues/63724
r? @estebank
2019-09-08 12:11:57 +02:00
Mazdak Farrokhzad
24172084e1
Rollup merge of #64152 - cramertj:update-backtrace, r=alexcrichton
Use backtrace formatting from the backtrace crate

r? @alexcrichton
2019-09-08 12:11:56 +02:00
Mazdak Farrokhzad
0ac09aef84
Rollup merge of #62205 - timvermeulen:iter_order_by, r=KodrAus
Add Iterator comparison methods that take a comparison function

This PR adds `Iterator::{cmp_by, partial_cmp_by, eq_by, ne_by, lt_by, le_by, gt_by, ge_by}`. We already have `Iterator::{cmp, partial_cmp, ...}` which are less general (but not any simpler) than the ones I'm proposing here.

I'm submitting this PR now because #61505 has been merged, so this change should not have a noticeable effect on the `Iterator` docs page size.

The diff is quite messy, here's what I changed:
- The logic of `cmp` / `partial_cmp` / `eq` is moved to `cmp_by` / `partial_cmp_by` / `eq_by` respectively, changing `x.cmp(&y)` to `cmp(&x, &y)` in the `cmp` method where `cmp` is the given comparison function (and similar for `partial_cmp_by` and `eq_by`).
- `ne_by` / `lt_by` / `le_by` / `gt_by` / `ge_by` are each implemented in terms of one of the three methods above.
- The existing comparison methods are each forwarded to their `_by` counterpart, passing one of `Ord::cmp` / `PartialOrd::partial_cmp` / `PartialEq::eq` as the comparison function.

The corresponding `_by_key` methods aren't included because they're not as fundamental as the `_by` methods and can easily be implemented in terms of them. Is that reasonable, or would adding the `_by_key` methods be desirable for the sake of completeness?

I didn't add any tests – I couldn't think of any that weren't already covered by our existing tests. Let me know if there's a particular test that would be useful to add.
2019-09-08 12:11:55 +02:00
V1shvesh
c255206581 Refactor Pluralisation
Modify files performing pluralisation checks to incorporate the
dedicated macro located in `syntax::errors`.
2019-09-08 15:09:50 +05:30
V1shvesh
38ab20dbf7 Add pluralise macro
Adress issue #64238. Create a macro to be used for pluralisation check
throughout rustc codebase.
2019-09-08 15:09:50 +05:30
bors
50362372d6 Auto merge of #64096 - GuillaumeGomez:theme-regex-fix, r=Mark-Simulacrum
Fix regex replacement in theme detection

Fixes #64061.

This is sadly a lot of bad luck: after making the changes and re-build the docs, I just forgot to force reload the page. Hence having the old (working) version with two replacements instead of the failing regex. Sorry again about that...

cc @fenhl
r? @Mark-Simulacrum
2019-09-08 06:06:39 +00:00
bors
4a8ccdbeeb Auto merge of #64044 - Mark-Simulacrum:rustdoc-clean-2, r=GuillaumeGomez
Rustdoc: formatting to buffers

This should be reviewed commit-by-commit.

I've not attempted to fully flesh out what the end state of this PR could look like yet as I wanted to get it up for some early feedback (I already think this has some wins, too, so we could land it as-is).

The primary idea with `Buffer` is that it internally tracks whether we're printing to HTML or text, and the goal is that eventually instead of branch on `fmt.alternate()` anywhere, we'd call a helper like `buf.nbsp()` which would either return `&nbsp;` or ` ` depending on the target we're printing to. Obviously, that's not included in this PR, in part because it was already getting quite big.
2019-09-08 02:12:24 +00:00
Charles Lew
8acab6bc56 Improve wording. 2019-09-08 09:41:59 +08:00