Commit Graph

87109 Commits

Author SHA1 Message Date
Oliver Scherer
1c2a29e29a Expand on a few comments 2018-12-13 12:54:57 +01:00
Oliver Scherer
5df6af49a7 Update tests to show diagnostics 2018-12-13 12:54:49 +01:00
Oliver Scherer
25a4f76d63 Fix indent 2018-12-13 12:24:38 +01:00
Oliver Scherer
46c1da6740 Doc comment format 2018-12-13 12:23:49 +01:00
Oliver Scherer
7d1b19cfe3 Diagnostics improvement! 2018-12-11 09:05:06 +01:00
Oliver Scherer
8a9414ae19 Add a few more tests of edge cases 2018-12-10 16:34:44 +01:00
Oliver Scherer
8f2ce3d839 Document and simplify pattern matching with constants as patterns 2018-12-10 16:34:44 +01:00
Oliver Scherer
a5a7fcbde3 Don't depend on Allocation sizes for pattern length 2018-12-10 16:34:44 +01:00
bors
3a75e80557 Auto merge of #56157 - RalfJung:park, r=nagisa
expand thread::park explanation

Cc @carllerche @parched @stjepang
2018-12-10 12:19:47 +00:00
bors
9567a1cf59 Auto merge of #56624 - RalfJung:miri, r=oli-obk
update miri

r? @oli-obk
2018-12-10 09:58:22 +00:00
bors
286dc37d1b Auto merge of #56369 - nnethercote:rm-Delimited, r=petrochenkov
Remove `tokenstream::Delimited`.

Because it's an extra type layer that doesn't really help; in a couple
of places it actively gets in the way, and overall removing it makes the
code nicer. It does, however, move `tokenstream::TokenTree` further away
from the `TokenTree` in `quote.rs`.

More importantly, this change reduces the size of `TokenStream` from 48
bytes to 40 bytes on x86-64, which is enough to slightly reduce
instruction counts on numerous benchmarks, the best by 1.5%.

Note that `open_tt` and `close_tt` have gone from being methods on
`Delimited` to associated methods of `TokenTree`.
2018-12-10 03:33:17 +00:00
Nicholas Nethercote
1fe2c03240 Remove tokenstream::Delimited.
Because it's an extra type layer that doesn't really help; in a couple
of places it actively gets in the way, and overall removing it makes the
code nicer. It does, however, move `tokenstream::TokenTree` further away
from the `TokenTree` in `quote.rs`.

More importantly, this change reduces the size of `TokenStream` from 48
bytes to 40 bytes on x86-64, which is enough to slightly reduce
instruction counts on numerous benchmarks, the best by 1.5%.

Note that `open_tt` and `close_tt` have gone from being methods on
`Delimited` to associated methods of `TokenTree`.
2018-12-10 12:10:10 +11:00
bors
e2c329c72c Auto merge of #56269 - nnethercote:_match-Matrix-SmallVec, r=simulacrum
Use a `SmallVec` within `_match::Matrix`.

This avoids allocations.
2018-12-10 01:08:05 +00:00
Nicholas Nethercote
cdc6633424 Use a SmallVec within _match::Matrix.
This commit also fixes up lifetimes a bit:

- Renames `'a` as `'p` when used with `Matrix` and `Pattern`, for
  consistency.

- Removes some unnecessary `'p` lifetimes on some function arguments.

- Adds some missing lifetime parameters.
2018-12-10 11:53:51 +11:00
bors
9cb38a84e7 Auto merge of #56463 - ljedrz:slice_concat_join, r=nikic
slice: tweak concat & join

- use `sum` instead of `fold` (readability)
- adjust the capacity for `join` - the number of separators is `n - 1`, not `n`; proof:
```
fn main() {
    let a = [[1, 2], [4, 5]];
    let v = a.join(&3);

    assert_ne!(v.len(), v.capacity()); // len is 5, capacity is 6
}
```
2018-12-09 22:39:44 +00:00
Nicholas Nethercote
ecf6cd4b3c Upgrade smallvec to 0.6.7 and use the new may_dangle feature. 2018-12-10 09:31:27 +11:00
bors
b755501043 Auto merge of #56444 - petrochenkov:uifull, r=davidtwco
Move compile-fail-fulldeps tests to UI

cc https://github.com/rust-lang/rust/issues/53353

r? @davidtwco
2018-12-09 18:49:12 +00:00
Vadim Petrochenkov
44fe586060 Fix rebase + Add missing // force-host 2018-12-09 21:10:19 +03:00
Vadim Petrochenkov
654cd09453 Remove compile-fail-fulldeps test suite 2018-12-09 19:56:30 +03:00
Vadim Petrochenkov
725d22e645 Move some tests from ui-fulldeps to ui 2018-12-09 19:56:30 +03:00
Vadim Petrochenkov
17ec290081 Move compile-fail-fulldeps tests to ui-fulldeps 2018-12-09 19:56:30 +03:00
Vadim Petrochenkov
4c9c70af38 Move former compile-fail-fulldeps tests to ui 2018-12-09 19:56:30 +03:00
bors
850fc6a479 Auto merge of #56644 - jens1o:patch-1, r=pietroalbini
Fix security link in CONTRIBUTING to its new place

avoiding an 404
2018-12-09 16:15:32 +00:00
Jens Hausdorf
38667104d6
Fix security link in CONTRIBUTING to its new place
avoiding an 404
2018-12-09 15:25:23 +01:00
bors
ea007c6b10 Auto merge of #56631 - matthiaskrgr:clippy, r=nikic
submodules: update clippy from 1df5766c to a3c77f6a

fixes clippy toolstate

Changes:
````
s/rustfmt-preview/rustfmt/
Swap if branches
Fix c_void false positive caused by libc refactoring
rustup https://github.com/rust-lang/rust/pull/56502 ( .hir -> .hir() )
typo: emum → enum
Fix format.
Add sysroot gettinh code to dogfood tests.
Add sysroot getting code to tests.
Don't try to determine sysroot. rustc_driver will use default value.
Fix suggestion for multiple derefs
Fix `clone_on_copy` not detecting derefs sometimes
````
r? @oli-obk
2018-12-09 11:56:32 +00:00
bors
b7da2c6e12 Auto merge of #56630 - sinkuu:core_iter, r=kennytm
Resolve FIXME in libcore/iter/mod.rs

and makes a few improvements.
2018-12-09 00:18:34 +00:00
bors
d7a9d961c3 Auto merge of #56615 - integer32llc:update-book, r=GuillaumeGomez
Update the book to fix some edition-related bugs

I'd love to have this included in a point release if one happens, but the changes aren't worth doing a point release on their own IMO. I'd definitely like to see this backported to beta.

The most urgent changes included here are:

- Chapter 19.6, on macros (including the macro changes that just stabilized), [is cut off](https://github.com/rust-lang/book/issues/1668) because of an ill-placed newline in a comment that [pulldown-cmark interprets incorrectly](https://github.com/raphlinus/pulldown-cmark/issues/124).
- [The `Cargo.toml` shown in the Guessing Game example in Chapter 2 (and one in Chapter 14) doesn't have `edition="2018"`](https://github.com/rust-lang/book/pull/1671), which can be confusing depending on whether the readers have it in theirs or not, think they should remove it if they have it, and the rest of the chapter assumes it's there and the code doesn't compile if you don't have it.
- The redirects implemented as part of only shipping the 2018 edition of the book sometimes lead to [having to click through 2 redirect pages](https://github.com/rust-lang/book/pull/1667) when it could be just one.

There are other small corrections included that were made since the last time the book was updated, but those aren't urgent.

cc @steveklabnik
2018-12-08 22:00:09 +00:00
bors
8db23425a3 Auto merge of #56616 - estebank:issue-56539, r=davidtwco
Encode `TraitAlias` as if they were `Trait`

Fix #56539.
2018-12-08 19:34:43 +00:00
bors
bdef56a324 Auto merge of #56632 - Eijebong:synup, r=Mark-Simulacrum
Reduce the number of syn versions compiled from 4 to 2

The last remaining one comes from mdbook. Unfortunately updating it
breaks everything
2018-12-08 17:06:19 +00:00
Shotaro Yamada
5728a043e8 Don't call size_hint of underlying iterator needlessly 2018-12-09 00:01:09 +09:00
Shotaro Yamada
e704ce9e8a Resolve FIXME and cleanup 2018-12-09 00:01:09 +09:00
Shotaro Yamada
fbe5aa57ed Override Cycle::try_fold
name                            old ns/iter  new ns/iter  diff ns/iter   diff %  speedup
 iter::bench_cycle_take_ref_sum  927,152      927,194                42    0.00%   x 1.00
 iter::bench_cycle_take_sum      938,129      603,492          -334,637  -35.67%   x 1.55
2018-12-09 00:01:09 +09:00
Bastien Orivel
5c4534a6d0 Reduce the numbers of syn versions compiled from 4 to 2
The last remaining one comes from mdbook. Unfortunately updating it
breaks everything
2018-12-08 15:11:47 +01:00
Matthias Krüger
83f47b7fea submodules: update clippy from 1df5766c to a3c77f6a
Changes:
````
s/rustfmt-preview/rustfmt/
Swap if branches
Fix c_void false positive caused by libc refactoring
rustup https://github.com/rust-lang/rust/pull/56502 ( .hir -> .hir() )
typo: emum → enum
Fix format.
Add sysroot gettinh code to dogfood tests.
Add sysroot getting code to tests.
Don't try to determine sysroot. rustc_driver will use default value.
Fix suggestion for multiple derefs
Fix `clone_on_copy` not detecting derefs sometimes
````
2018-12-08 15:02:12 +01:00
Ralf Jung
8578ba6229 update miri 2018-12-08 11:09:02 +01:00
bors
9772d02774 Auto merge of #56623 - Centril:rollup, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #56248 (Suggest an appropriate token when encountering `pub Ident<'a>`)
 - #56597 (Improve the usage message for `-Z dump-mir`.)
 - #56599 (codegen: Fix va_list - aarch64 iOS/Windows)
 - #56602 (Fix the just-introduced ptr::hash docs)
 - #56620 (resolve: Reduce some clutter in import ambiguity errors)
 - #56621 (Add missing comma in Generators)

Failed merges:

r? @ghost
2018-12-08 09:56:32 +00:00
Mazdak Farrokhzad
a8cc9166d4
Rollup merge of #56621 - Morganamilo:fix-generators-comma, r=Centril
Add missing comma in Generators
2018-12-08 08:43:50 +01:00
Mazdak Farrokhzad
9f7f949600
Rollup merge of #56620 - petrochenkov:noclutter, r=estebank
resolve: Reduce some clutter in import ambiguity errors

Noticed in https://www.reddit.com/r/rust/comments/a3pyrw/announcing_rust_131_and_rust_2018/eb8alhi/.
The first error is distracting, but unnecessary, it's a *consequence* of the ambiguity error and appears because one of the ambiguous `actix` modules (unsurprisingly) doesn't have the expected name in it.
2018-12-08 08:43:49 +01:00
Mazdak Farrokhzad
7f076fa521
Rollup merge of #56602 - dwijnand:fix-ptr-hash-docs, r=Centril
Fix the just-introduced ptr::hash docs

Follow-up to #56250.
2018-12-08 08:43:48 +01:00
Mazdak Farrokhzad
eb30d56d37
Rollup merge of #56599 - dlrobertson:fix_va_arg, r=eddyb
codegen: Fix va_list - aarch64 iOS/Windows

## Summary

Fix code generated for `VaList` on Aarch64 iOS/Windows.

## Details

According to the [Apple - ARM64 Function Calling Conventions]:

> ... the type va_list is an alias for char * rather than for the struct
> type specified in the generic PCS.

The current implementation uses the generic Aarch64 structure for `VaList`
for Aarch64 iOS. Switch to using the `char *` variant of the `VaList`
and use the corresponding `emit_ptr_va_arg` for the `va_arg` intrinsic.

Windows always uses the `char *` variant of the `VaList`. Update the `va_arg`
intrinsic to use `emit_ptr_va_arg`.

[Apple - ARM64 Function Calling Conventions]: https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html
2018-12-08 08:43:47 +01:00
Mazdak Farrokhzad
253c448886
Rollup merge of #56597 - vext01:dump-mir-usage, r=wesleywiser
Improve the usage message for `-Z dump-mir`.

Ouput now looks like this:
```
$ rustc -Z help
...
    -Z               arg-align-attributes -- emit align metadata for reference arguments
    -Z                       dump-mir=val -- dump MIR state to file.
        `val` is used to select which passes and functions to dump. For example:
        `all` matches all passes and functions,
        `foo` matches all passes for functions whose name contains 'foo',
        `foo & ConstProp` only the 'ConstProp' pass for function names containing 'foo',
        `foo | bar` all passes for function names containing 'foo' or 'bar'.
    -Z                   dump-mir-dir=val -- the directory the MIR is dumped into
...
```

Fixes #56558
2018-12-08 08:43:45 +01:00
Mazdak Farrokhzad
ac15b4f4bd
Rollup merge of #56248 - estebank:suggest-bare-pub, r=petrochenkov
Suggest an appropriate token when encountering `pub Ident<'a>`

Fix #55403. Follow up to #45997.
2018-12-08 08:43:43 +01:00
bors
1ccb5b219d Auto merge of #56583 - RalfJung:vergen, r=oli-obk
update vergen

Fixes https://github.com/rust-lang/rust/issues/56576

r? @oli-obk
2018-12-08 07:36:15 +00:00
morganamilo
2fc33f9b97
Add missing comma in Generators 2018-12-08 04:13:18 +00:00
bors
059e6a6f57 Auto merge of #56578 - alexreg:cosmetic-1, r=alexreg
Various minor/cosmetic improvements to code

r? @Centril 😄
2018-12-08 03:50:16 +00:00
Alexander Regueiro
003c5b796e Fixed nll stderr file. 2018-12-08 03:17:54 +00:00
Vadim Petrochenkov
2010b4f60b resolve: Reduce some clutter in import ambiguity errors 2018-12-08 04:19:29 +03:00
Alexander Regueiro
e14ff9bac6 Fixed line numbers in stderr file. 2018-12-07 23:53:34 +00:00
Alexander Regueiro
4d95f5b46d Fixed test stderr files. 2018-12-07 23:53:34 +00:00
Alexander Regueiro
ce9850b953 Fixed incorrect reference to issue #23121. 2018-12-07 23:53:34 +00:00