Commit graph

89005 commits

Author SHA1 Message Date
Andre Bogus
b062b75559 override VecDeque's Iter::try_fold 2019-01-30 09:11:17 +01:00
bors
106b3e9fa4 Auto merge of #57862 - hsivonen:buildneon, r=alexcrichton
Build the standard library for thumbv7neon-unknown-linux-gnueabihf in CI

Using the `dist-armv7-linux` image instead of `dist-various-1` in order to use the ARMv7 toolchain available in `dist-armv7-linux`.

Closes #57030.
2019-01-29 09:42:13 +00:00
bors
5f60208ba1 Auto merge of #57957 - Centril:rollup, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #57045 (Kill remaining uses of mem::uninitialized in libcore, liballoc)
 - #57674 (Avoid erase_regions_ty queries if there are no regions to erase)
 - #57833 (Print a slightly clearer message when failing to launch a thread)
 - #57859 (Fix invalid background color)
 - #57904 (add typo suggestion to unknown attribute error)
 - #57915 (Pretty print `$crate` as `crate` or `crate_name` in more cases)
 - #57950 (Extend E0106, E0261)

Failed merges:

r? @ghost
2019-01-29 05:22:51 +00:00
Mazdak Farrokhzad
d77db2e99e
Rollup merge of #57950 - QuietMisdreavus:lifetime-err-desc, r=estebank
Extend E0106, E0261

This is a reopening of https://github.com/rust-lang/rust/pull/57310 with review comments addressed because the original author has since deleted their fork.

From the author (@purple-ice):

> Added an example that points out hardly obvious mistake one could make when writing impl for a new type.

r? @rust-lang/docs
2019-01-28 22:25:49 +01:00
Mazdak Farrokhzad
3fe8b4c043
Rollup merge of #57915 - petrochenkov:notto-disu, r=zackmdavis
Pretty print `$crate` as `crate` or `crate_name` in more cases

So, people do parse output of `--pretty=expanded` (sigh), so covering only the legacy proc-macro case (like it was done in https://github.com/rust-lang/rust/pull/57155) is not enough.

This PRs resolves all `$crate`s produced by macros, so they are all printed in the parseable form `$crate::foo` -> `crate::foo` or `crate_name::foo`.

Fixes https://github.com/rust-lang/rust/issues/38016#issuecomment-455851334
Fixes https://github.com/rust-lang/rust/pull/57155#issuecomment-455807195
2019-01-28 22:25:48 +01:00
Mazdak Farrokhzad
d3bb907eff
Rollup merge of #57904 - euclio:attribute-typos, r=davidtwco
add typo suggestion to unknown attribute error

Provides a suggestion using Levenshtein distance to suggest built-in attributes and attribute macros.

Fixes #49270.
2019-01-28 22:25:47 +01:00
Mazdak Farrokhzad
b1b67cdec1
Rollup merge of #57859 - GuillaumeGomez:fix-background, r=QuietMisdreavus
Fix invalid background color

As discussed in #57814.

r? @QuietMisdreavus
2019-01-28 22:25:45 +01:00
Mazdak Farrokhzad
42dae3adad
Rollup merge of #57833 - jethrogb:jb/thread-spawn-unwrap, r=alexcrichton
Print a slightly clearer message when failing to launch a thread

As discussed in #46345, the `io::Error` you get when a thread fails to launch is of type `io::ErrorKind::WouldBlock`. This is super uninformative when an arbitrary `thread::spawn` fails somewhere in your code:

```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 11,
kind: WouldBlock, message: "operation would block" }', src/libcore/result.rs:997:5
```

This PR improves the situation a little bit by using `expect` instead of `unwrap`. I don't consider this a complete fix for #46345 though.
2019-01-28 22:25:44 +01:00
Mazdak Farrokhzad
76dbfdd595
Rollup merge of #57674 - dotdash:erase_reg, r=varkor
Avoid erase_regions_ty queries if there are no regions to erase

It's overall faster to perform this extra check than to perform the
query, even if the result is already in the query cache.
2019-01-28 22:25:42 +01:00
Mazdak Farrokhzad
f21f83d117
Rollup merge of #57045 - RalfJung:kill-more-uninit, r=SimonSapin
Kill remaining uses of mem::uninitialized in libcore, liballoc

Kill remaining uses of mem::uninitialized in libcore and liballoc, and enable a lint that will warn when uses are added again in the future.

To avoid casting raw pointers around (which is always very dangerous because it is not typechecked at all -- it doesn't even get the "same size" sanity check that `transmute` gets), I also added two new functions to `MaybeUninit`:

```rust
    /// Get a pointer to the first contained values.
    pub fn first_ptr(this: &[MaybeUninit<T>]) -> *const T {
        this as *const [MaybeUninit<T>] as *const T
    }

    /// Get a mutable pointer to the first contained values.
    pub fn first_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T {
        this as *mut [MaybeUninit<T>] as *mut T
    }
```

I changed some of the existing code to use array-of-`MaybeUninit` instead of `MaybeUninit`-of-array, successfully removing raw pointer casts there as well.
2019-01-28 22:25:41 +01:00
Ralf Jung
489a79247d fix gdb debug printing 2019-01-28 17:33:29 +01:00
QuietMisdreavus
a2b75eda95 review comments 2019-01-28 09:30:43 -06:00
bors
d8a0dd7ae8 Auto merge of #55704 - Nemo157:pinned-generators, r=Zoxc
Use pinning for generators to make trait safe

I'm unsure whether there needs to be any changes to the actual generator transform. Tests are passing so the fact that `Pin<&mut T>` is fundamentally the same as `&mut T` seems to allow it to still work, but maybe there's something subtle here that could go wrong.

This is specified in [RFC 2349 § Immovable generators](https://github.com/rust-lang/rfcs/blob/master/text/2349-pin.md#immovable-generators) (although, since that RFC it has become safe to create an immovable generator, and instead it's unsafe to resume any generator; with these changes both are now safe and instead the unsafety is moved to creating a `Pin<&mut [static generator]>` which there are safe APIs for).

CC #43122
2019-01-28 14:12:15 +00:00
Ralf Jung
6a52ca3fb4 rename first_mut_ptr -> first_ptr_mut 2019-01-28 12:37:29 +01:00
Ralf Jung
33a969d9fa fix typos, improve docs 2019-01-28 11:04:30 +01:00
bors
a21bd75688 Auto merge of #57899 - davidtwco:issue-56685, r=estebank
Unused variable suggestions apply on all patterns.

Fixes #56685.

This PR extends existing suggestions to prefix unused variable bindings in match arms with an underscore so that it applies to all patterns in a match arm.

r? @estebank
cc @alexcrichton (since you filed the issue)
2019-01-28 09:52:31 +00:00
Ralf Jung
0e8fb93249 Use warn() for extra diagnostics; with -D warnings this leads to errors
This is needed to properly respect "deny_warnings = false" in config.toml
2019-01-28 10:49:11 +01:00
Ralf Jung
22a947f3aa add macro for creating uninitialized array 2019-01-28 10:48:38 +01:00
Ralf Jung
630aaa4e80 avoid some raw ptr casts in BTreeMap 2019-01-28 10:48:38 +01:00
Ralf Jung
ffd73df755 avoid mem::uninitialized in BTreeMap 2019-01-28 10:48:33 +01:00
Henri Sivonen
7dbb70eea3 Build the standard library for thumbv7neon-unknown-linux-gnueabihf in CI
Closes #57030.
2019-01-28 11:46:41 +02:00
David Wood
5f021e0023
Unused variable suggestions on all patterns.
This commit extends existing suggestions to prefix unused variable
bindings in match arms with an underscore so that it applies to all
patterns in a match arm.
2019-01-28 10:46:31 +01:00
Ralf Jung
a88414e007 libcore: avoid mem::uninitialized and raw ptr casts 2019-01-28 10:39:49 +01:00
Ralf Jung
c11e514e9d liballoc: remove unneeded allow(deprecated) 2019-01-28 10:39:49 +01:00
Ralf Jung
c775c2fe96 libcore: remove unneeded allow(deprecated) 2019-01-28 10:39:49 +01:00
bors
cc4d1e5bb0 Auto merge of #57691 - Zoxc:pass-skip, r=petrochenkov
Conditionally skip two passes if their related attributes were not found
2019-01-28 06:32:39 +00:00
John Kåre Alsaker
1bdd2f699b Conditionally skip two passes if their related attributes were not found 2019-01-28 05:46:53 +01:00
bors
c32515566f Auto merge of #57910 - Mark-Simulacrum:delete-test, r=petrochenkov
Delete long-ignored and useless test

cc @pnkfelix (https://github.com/rust-lang/rust/issues/13745#issuecomment-457599109)

r? @petrochenkov as you re-enabled this test in 21d67c45a3, https://github.com/rust-lang/rust/pull/55236
2019-01-28 03:46:25 +00:00
Andy Russell
5e67021172
add typo suggestion to unknown attribute error 2019-01-27 21:56:50 -05:00
bors
ec504def36 Auto merge of #57442 - oli-obk:lazy_const, r=RalfJung
Simplify `ConstValue::ScalarPair`

While looking at #57432 I realized that some of our types for representing constants are very big. This reduces `LazyConst` to 3/4th of its original size and simplifies some code around slices at the same time.

r? @RalfJung
2019-01-28 00:46:07 +00:00
Wim Looman
a21c95f08e Mark non-static generators as always Unpin 2019-01-27 22:59:00 +01:00
Wim Looman
c4bf5f9d63 Temporary workaround for travis diagnostic difference 2019-01-27 22:59:00 +01:00
Wim Looman
e7d66758cf Update generator upvar debug info 2019-01-27 22:58:59 +01:00
Wim Looman
be3989301a Update generator transform and generated function signature 2019-01-27 22:58:59 +01:00
Wim Looman
0c203965e2 impl Generator for Pin<Box<Generator>> 2019-01-27 22:58:59 +01:00
Wim Looman
730b18b6e5 Mark static generators as !Unpin 2019-01-27 22:58:59 +01:00
Wim Looman
a3fdee9a75 Change generator trait to use pinning 2019-01-27 22:58:53 +01:00
bors
da6ab956e1 Auto merge of #56932 - clarcharr:iter_refactor, r=Centril
Refactor core::iter module

A while back, I refactored `core::ops` in #42523 because the module had become a giant mess and was difficult to modify. Now, I'm doing the same with the `core::iter` module.

Like the `core::ops` refactor, things have been split up into multiple commits to make rebasing easier, and so that you can follow changes. Although the diffs are hard to decipher, the only actual code changes I've made in the first few commits are to modify exports and imports. I save all of the actual code refactoring, e.g. modifying what methods are called, for the end.
2019-01-27 20:50:17 +00:00
Oliver Scherer
fe50b4eb1d ConstValue::ScalarPair only needs to represent slices 2019-01-27 21:41:35 +01:00
Oliver Scherer
2a1748834e Add some size assertions for const eval types 2019-01-27 21:41:34 +01:00
Oliver Scherer
1578955500 Fix indentation 2019-01-27 20:30:35 +01:00
bors
8611577360 Auto merge of #57765 - Mark-Simulacrum:bootstrap-bump, r=alexcrichton
Bump bootstrap compiler to 1.33 beta

r? @alexcrichton or @pietroalbini

cc @rust-lang/release
2019-01-27 18:18:17 +00:00
Mark Rousskov
e0bc0ba281 Update comment in test which has changed its purpose 2019-01-27 08:59:58 -07:00
Mark Rousskov
cd39cf748e Update cargo to fix deprecation warnings
Implemented in rust-lang/cargo#6600
2019-01-27 08:54:56 -07:00
bors
71c365c380 Auto merge of #57826 - danielhenrymantilla:master, r=Centril
Fixed Deref coercion explanation for DerefMut using shared references
2019-01-27 15:33:45 +00:00
bors
01af12008d Auto merge of #57927 - Alexendoo:mem-drop-nll-docs, r=Centril
Remove lexical scope examples from std::mem::drop

The example no longer produces an error in the 2018 edition
2019-01-27 09:19:00 +00:00
bors
1484d0d123 Auto merge of #57907 - euclio:applicability-rename, r=estebank
remove deprecated suggestion functions

This PR removes the (now unused) deprecated suggestion functions and removes `_with_applicability` from their replacements' names.

This PR will break clippy, but I'll open a clippy PR once this is merged.
2019-01-27 06:35:51 +00:00
Andy Russell
0897ffc28f
remove _with_applicability from suggestion fns 2019-01-26 23:07:55 -05:00
Andy Russell
8eaa84c79f
document Applicability 2019-01-26 23:06:08 -05:00
bors
677064b979 Auto merge of #57925 - fintelia:riscv-cas, r=nagisa
Enable RISC-V atomic compare and swap

Fixes #56564
2019-01-27 03:57:54 +00:00