Commit graph

100034 commits

Author SHA1 Message Date
Mazdak Farrokhzad
bea404f292 syntax: stylistic cleanup in item parsing. 2019-09-30 09:13:42 +02:00
Mazdak Farrokhzad
258e86a583 syntax: fuse more code paths together. 2019-09-30 08:53:59 +02:00
bors
bf8491e72e Auto merge of #64904 - ollie27:rustdoc_logo, r=Mark-Simulacrum
rustdoc: Fix default logo filename

This was a typo made in #64443. It's the reason the logo is missing on the [nightly docs](https://doc.rust-lang.org/nightly/std/).

r? @Mark-Simulacrum
2019-09-30 06:01:48 +00:00
Erin Power
96c8049b20
Remove legacy grammar 2019-09-30 07:46:10 +02:00
hman523
6c6d27d685 Fixed a misleading documentation issue #64844 2019-09-30 00:26:42 -05:00
Mazdak Farrokhzad
573a8d8d30 syntax: extract error_on_invalid_abi. 2019-09-30 06:47:35 +02:00
Mazdak Farrokhzad
66bf323a3b syntax: cleanup parse_visibility. 2019-09-30 06:42:56 +02:00
Mazdak Farrokhzad
5b80ead489 syntax: misc cleanup 2019-09-30 06:21:30 +02:00
Mazdak Farrokhzad
d9d0e5d36b syntax: cleanup parse_fn_decl. 2019-09-30 05:46:16 +02:00
Mazdak Farrokhzad
347deac455 syntax: reorder param parsing to make more sense. 2019-09-30 05:32:46 +02:00
Mazdak Farrokhzad
0492302dbd syntax refactor parse_self_param (5) 2019-09-30 04:36:57 +02:00
Mazdak Farrokhzad
4306d0037e syntax refactor parse_self_param (4) 2019-09-30 04:36:57 +02:00
Mazdak Farrokhzad
ac454e9af9 syntax refactor parse_self_param (3) 2019-09-30 04:36:57 +02:00
Mazdak Farrokhzad
f688f8aedf syntax refactor parse_self_param (2) 2019-09-30 04:36:57 +02:00
Mazdak Farrokhzad
40dc9da44c syntax refactor parse_self_param (1) 2019-09-30 04:36:57 +02:00
Mazdak Farrokhzad
4fa9c3bca3 syntax refactor parse_fn_params 2019-09-30 04:36:27 +02:00
bors
bd9a0aa627 Auto merge of #64881 - RalfJung:miri, r=RalfJung
bump Miri

Fixes https://github.com/rust-lang/rust/issues/64798
2019-09-30 02:09:43 +00:00
Mazdak Farrokhzad
378cc98cd9 syntax: is_named_argument -> is_named_param. 2019-09-30 03:31:09 +02:00
Mazdak Farrokhzad
f2904674e8 syntax: cleanup method parsing. 2019-09-30 03:31:09 +02:00
Alexander Regueiro
33ed03fea0 Cleaned up a few doc comments in libfmt_macros. 2019-09-30 01:15:48 +01:00
Alexander Regueiro
49c6c86faf Fixed stylistic convention for one diagnostic and blessed tests. 2019-09-30 01:15:25 +01:00
Alexander Regueiro
13b61b50d9 Fixed grammar in one diagnostic and blessed tests. 2019-09-30 01:15:25 +01:00
Alexander Regueiro
8a4af2f699 Fixed weird non-sequential indices for serialisation of SourceFile type. 2019-09-30 01:15:24 +01:00
Alexander Regueiro
fdd1a62a45 Added backticks for one diagnostic message. 2019-09-30 01:15:24 +01:00
Alexander Regueiro
d938a8079f Fixed grammar for some time fn calls and a diagnostic. 2019-09-30 01:15:24 +01:00
Nicholas Nethercote
5ca99b750e Avoid chain() in find_constraint_paths_between_regions().
This iterator can be hot, and chained iterators are slow. The second
half of the chain is almost always empty, so this commit changes the
code to avoid the chained iteration.

This change reduces instruction counts for the `wg-grammar` benchmark by
up to 1.5%.
2019-09-30 09:05:36 +10:00
bors
d16ee891c6 Auto merge of #64673 - Mark-Simulacrum:opt-match-ck, r=oli-obk
Optimize try_eval_bits to avoid layout queries

This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.

It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
2019-09-29 22:21:43 +00:00
Mark Rousskov
06c6e75aae Optimize try_eval_bits to avoid layout queries
This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.

It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
2019-09-29 17:52:20 -04:00
Oliver Middleton
dc295318fc rustdoc: Fix default logo filename 2019-09-29 22:17:03 +01:00
Tyler Mandry
2185710748 Use https for curl when building for linux 2019-09-29 13:33:12 -07:00
Nicholas Nethercote
a820672f6c Avoid the popping loop at the end of compress().
By collecting the done obligations (when necessary) in the main loop.
This makes the code cleaner.

The commit also changes the order in which successful obligations are
returned -- they are now returned in the registered order, rather than
reversed. Because this order doesn't actually matter, being only used by
tests, the commit uses `sort()` to make the test agnostic w.r.t. the
order.
2019-09-30 05:25:25 +10:00
Nicholas Nethercote
2883c258f1 Remove an out-of-date sentence in a comment. 2019-09-30 05:23:07 +10:00
Nicholas Nethercote
8a62bb1a1d Rename nodes_len and use it in a few more places. 2019-09-30 05:23:07 +10:00
Nicholas Nethercote
9e67f19eee Convert some match expressions to ifs.
These make the code more concise.
2019-09-30 05:23:07 +10:00
Nicholas Nethercote
6fb1f37888 Introduce some intermediate variables that aid readability. 2019-09-30 05:23:07 +10:00
Nicholas Nethercote
22943ee27c Remove unnecessary uses of ObligationForest::scratch.
They don't help performance at all, and just complicate things.
2019-09-30 05:23:07 +10:00
Nicholas Nethercote
ea726501e1 Use filter and map in to_errors. 2019-09-30 05:23:07 +10:00
Nicholas Nethercote
7130e6c073 Tweak the control flow in process_obligations(). 2019-09-30 05:23:07 +10:00
Nicholas Nethercote
85a56cbd88 Inline mark_as_waiting_from.
It has a single call site, and the code is easier to read this way.
2019-09-30 05:23:07 +10:00
Nicholas Nethercote
4a7fb8b13a Rename node_index as index.
For consistency with other variables in this file.
2019-09-30 05:23:07 +10:00
Nicholas Nethercote
3b506d9694 Remove NodeState::OnDfsStack.
It's not necessary; cycles (which are rare) can be detected by looking
at the node stack.

This change speeds things up slightly, as well as simplifying the code a
little.
2019-09-30 05:23:07 +10:00
bors
8431f261dd Auto merge of #64902 - Centril:rollup-1i431vs, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #64691 (Point at definition when misusing ADT)
 - #64735 (Add long error explanation for E0533)
 - #64825 (Point at enclosing match when expecting `()` in arm)
 - #64858 (Add support for relating slices in `super_relate_consts`)
 - #64894 (syntax: fix dropping of attribute on first param of non-method assocated fn)
 - #64898 (fixed typo)

Failed merges:

r? @ghost
2019-09-29 18:35:04 +00:00
Mazdak Farrokhzad
50940ae952
Rollup merge of #64898 - jakevossen5:master, r=jonas-schievink
fixed typo

Accidentally had a typo in https://github.com/rust-lang/rust/pull/64884, sorry!
2019-09-29 20:34:19 +02:00
Mazdak Farrokhzad
64afa26253
Rollup merge of #64894 - Centril:fix-64682, r=petrochenkov
syntax: fix dropping of attribute on first param of non-method assocated fn

Fixes #64682.

The general idea is that we bake parsing of `self` into `parse_param_general` and then we just use standard list parsing. Overall, this simplifies the parsing and makes it more consistent.

r? @petrochenkov cc @c410-f3r
2019-09-29 20:34:18 +02:00
Mazdak Farrokhzad
4ada68e325
Rollup merge of #64858 - skinny121:str-const-generics, r=varkor
Add support for relating slices in `super_relate_consts`

This allows passing strings as generic arguments.

Fixes #63773
Fixes #60813

r? @varkor
2019-09-29 20:34:16 +02:00
Mazdak Farrokhzad
8109332a4c
Rollup merge of #64825 - estebank:match-unit, r=Centril
Point at enclosing match when expecting `()` in arm

When encountering code like the following:

```rust
fn main() {
    match 3 {
        4 => 1,
        3 => {
            println!("Yep it maches.");
            2
        }
        _ => 2
    }
    println!("Bye!")
}
```

point at the enclosing `match` expression and suggest ignoring the
returned value:

```
error[E0308]: mismatched types
  --> $DIR/match-needing-semi.rs:8:13
   |
LL | /     match 3 {
LL | |         4 => 1,
LL | |         3 => {
LL | |             2
   | |             ^ expected (), found integer
LL | |         }
LL | |         _ => 2
LL | |     }
   | |     -- help: consider using a semicolon here
   | |_____|
   |       expected this to be `()`
   |
   = note: expected type `()`
              found type `{integer}
```

Fix #40799.
2019-09-29 20:34:15 +02:00
Mazdak Farrokhzad
f34e2b1e7c
Rollup merge of #64735 - GuillaumeGomez:long-err-explanation-E0533, r=Centril
Add long error explanation for E0533

Part of https://github.com/rust-lang/rust/issues/61137
2019-09-29 20:34:14 +02:00
Mazdak Farrokhzad
0a2ddcc346
Rollup merge of #64691 - estebank:unexpected-variant, r=Centril
Point at definition when misusing ADT

When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
2019-09-29 20:34:12 +02:00
Ralf Jung
17fa7fe77e bump Miri 2019-09-29 13:57:26 -04:00
csmoe
64f61c7888 remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00