Commit graph

89055 commits

Author SHA1 Message Date
Mazdak Farrokhzad
fb7721a594
Rollup merge of #57971 - jethrogb:jb/sgx-panic, r=alexcrichton
SGX target: improve panic & exit handling

Implement this part of the spec:

> The enclave must not rely on userspace to terminate other threads still running. Similarly, the enclave must not trust that it will no longer be entered by userspace, and it must safeguard against that in the entrypoints.

Also use `UserRef` to access panic buffer

r? @alexcrichton

cc @VardhanThigle
2019-01-31 02:10:45 +01:00
Mazdak Farrokhzad
e8173a654d
Rollup merge of #57934 - dwijnand:from-Arc/Rc-to-NonNull, r=alexcrichton
Introduce into_raw_non_null on Rc and Arc

None
2019-01-31 02:10:44 +01:00
Mazdak Farrokhzad
01346563c1
Rollup merge of #57920 - euclio:source-date-epoch, r=Mark-Simulacrum
use `SOURCE_DATE_EPOCH` for man page time if set

Fixes #57776.
2019-01-31 02:10:42 +01:00
Mazdak Farrokhzad
7ebb0a8c8e
Rollup merge of #57106 - matthiaskrgr:trim_must_use, r=sfackler
Mark str::trim.* functions as #[must_use].

The functions return a reference to a new object and do not modify in-place
as the following code shows:
````
let s = String::from("   hello   ");
s.trim();
assert_eq!(s, "   hello   ");
````

The new reference should be bound to a variable as now indicated by #[must_use].
2019-01-31 02:10:41 +01:00
Mazdak Farrokhzad
ab844daadb
Rollup merge of #57008 - Knium:misleading-try-adding-parentheses-in-match-with-comma, r=oli-obk
suggest `|` when `,` founds in invalid match value

Issue #54807
I get stuck on (what | how) I should implement...
2019-01-31 02:10:40 +01:00
bors
147311c5fc Auto merge of #57974 - llogiq:vec-deque-try-fold, r=alexcrichton
override `VecDeque`'s `Iter::try_fold`

This should improve performance (wherever it is used), but I haven't found the time to benchmark it yet.
2019-01-30 21:04:06 +00:00
bors
d9a2e3b1cc Auto merge of #57495 - jamesmunns:mdbook-compat, r=steveklabnik
Support multiple versions of MdBook for docs

Only the compatibility items from the embedded book PR. PR with embedded book components: https://github.com/rust-lang/rust/pull/56291

CC @steveklabnik, @ehuss, and https://github.com/rust-lang-nursery/edition-guide/pull/134
2019-01-30 16:20:15 +00:00
James Munns
f8a9a28421 Add exception for new dependency in license checker 2019-01-30 09:25:12 -05:00
James Munns
de76369f93 Update to newer version of mdbook(2) 2019-01-30 09:25:12 -05:00
James Munns
9004b44b99 Remove stable feature 2019-01-30 09:13:17 -05:00
James Munns
b98a1e1710 No consumers of MdBook2 yet 2019-01-30 09:13:17 -05:00
James Munns
7389f97cde Only the compatibility items from the embedded book PR
PR: https://github.com/rust-lang/rust/pull/56291
2019-01-30 09:13:17 -05:00
bors
e4a9b5c623 Auto merge of #57988 - RalfJung:miri, r=oli-obk
update miri

r? @oli-obk
2019-01-30 13:20:32 +00:00
Ralf Jung
c397ba0420 update miri 2019-01-30 12:58:33 +01:00
bors
43b4c4a36b Auto merge of #57932 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
submodules: update clippy from f1753522 to 6ce78d12

Should fix clippy toolstate

Changes:
````
wildcard_match_arm: Update lint count.
wildcard_match_arm: add nesting issue to known.
wildcard_match_arm: lint only enum matches.
wildcard_match_arm: update ui test stderr
wildcard_match_arm: format test.
wilcard_match_arm: run rustfmt.
wildcard_match_arm: add lint properly.
wildcard_match_arm: rename function.
wildcard_match_arm: add simple ui test.
wildcard_match_arm: expand lint scope.
Change match_wild lint name to WILDCARD_MATCH_ARM.
Add match_wild lint (#3649).
fetch_prs_between: add .sh file ending
cargo fmt
Update various docs
Use built-in entry_fn detection over self-built
cargo fmt
Reorganize conditionals: Run faster checks first
Maybe fix ICE?
Add initial version of const_fn lint
Fix `unit_arg` false positive
Rustfmt
Check hypothetically failing conversion
Remove tests for deprecated items
Update more changed iterator paths
Atomics constants are now handled by the deprecation lint
Update changed iterator paths
Update const slice processing
update test stderr
run cargo fmt
rustup https://github.com/rust-lang/rust/pull/57907/
Fix documentation for `slow_vector_initialization`
rustup https://github.com/rust-lang/rust/pull/57726
Remove unsafe_vector_initialization from added lints
Prevent incorrect cast_lossless suggestion in const_fn
Incorporate review suggestions
Fix dogfood tests on Appveyor
test(versioncheck): Use .no_deps()
test(versioncheck): Fix version equality check
chore(cargo/dependencies/cargo-metadata): Upgrade to 0.7.1
dependencies: update itertools from 0.7 to 0.8
Add script to fetch GitHub PRs between two commits
gitattributes: Treat .fixed files as rust files
Update changelog with all changes since 0.0.212
Fix `expect_fun_call` lint suggestions
````

r? @oli-obk
2019-01-30 09:30:30 +00:00
Andre Bogus
b062b75559 override VecDeque's Iter::try_fold 2019-01-30 09:11:17 +01:00
Knium_
62867b4992 Suggest to add each of | and () when unexpected , is found in pattern 2019-01-30 13:50:44 +09:00
bors
d3d0bf0e9f Auto merge of #57975 - alexcrichton:debug-exit-appveyor, r=pietroalbini
Attempt to debug 259 exit code on AppVeyor

Let's try to dig in a bit more and see where this is coming from, it
looks like AppVeyor is also unsure where this is coming from!
2019-01-30 03:44:11 +00:00
Matthias Krüger
a27cf8a281 submodules: update clippy from f1753522 to 6ce78d12
Changes:
````
wildcard_match_arm: Update lint count.
wildcard_match_arm: add nesting issue to known.
wildcard_match_arm: lint only enum matches.
wildcard_match_arm: update ui test stderr
wildcard_match_arm: format test.
wilcard_match_arm: run rustfmt.
wildcard_match_arm: add lint properly.
wildcard_match_arm: rename function.
wildcard_match_arm: add simple ui test.
wildcard_match_arm: expand lint scope.
Change match_wild lint name to WILDCARD_MATCH_ARM.
Add match_wild lint (#3649).
fetch_prs_between: add .sh file ending
cargo fmt
Update various docs
Use built-in entry_fn detection over self-built
cargo fmt
Reorganize conditionals: Run faster checks first
Maybe fix ICE?
Add initial version of const_fn lint
Fix `unit_arg` false positive
Rustfmt
Check hypothetically failing conversion
Remove tests for deprecated items
Update more changed iterator paths
Atomics constants are now handled by the deprecation lint
Update changed iterator paths
Update const slice processing
update test stderr
run cargo fmt
rustup https://github.com/rust-lang/rust/pull/57907/
Fix documentation for `slow_vector_initialization`
rustup https://github.com/rust-lang/rust/pull/57726
Remove unsafe_vector_initialization from added lints
Prevent incorrect cast_lossless suggestion in const_fn
Incorporate review suggestions
Fix dogfood tests on Appveyor
test(versioncheck): Use .no_deps()
test(versioncheck): Fix version equality check
chore(cargo/dependencies/cargo-metadata): Upgrade to 0.7.1
dependencies: update itertools from 0.7 to 0.8
Add script to fetch GitHub PRs between two commits
gitattributes: Treat .fixed files as rust files
Update changelog with all changes since 0.0.212
Fix `expect_fun_call` lint suggestions
````
2019-01-30 01:25:05 +01:00
bors
40e6a0bd76 Auto merge of #57953 - mati865:cc-fix, r=alexcrichton
Do not set CC, CFLAGS, CXX, CXXFLAGS, AR, RANLIB in bootstrap, it breaks cross compilation

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

I tested it in AArch64 Ubuntu container with several days old tree to have all the tools buildable.

I did **not** test native builds (amd64 -> amd64), leaving it to CI.

r? @alexcrichton
2019-01-29 22:34:19 +00:00
bors
c1c3c4e95b Auto merge of #57808 - gnzlbg:ustdsimd, r=gnzlbg
Update stdsimd

This is the companion PR to https://github.com/rust-lang-nursery/stdsimd/pull/640

r? @alexcrichton
2019-01-29 19:40:51 +00:00
bors
7425663011 Auto merge of #57901 - lqd:issue_57362, r=nikomatsakis
Add information to higher-ranked lifetimes conflicts error messages

Make these errors go through the new "placeholder error" code path, to have self tys displayed and make them hopefully less confusing.

Should fix #57362.

r? @nikomatsakis — so we can iterate on the specific wording you wanted.
2019-01-29 16:58:15 +00:00
Alex Crichton
ce279a8e53 Attempt to debug 259 exit code on AppVeyor
Let's try to dig in a bit more and see where this is coming from, it
looks like AppVeyor is also unsure where this is coming from!
2019-01-29 07:45:54 -08:00
bors
ae1ba150a2 Auto merge of #57948 - Zoxc:parallel, r=michaelwoerister
Use multiple threads by default. Limits tests to one thread. Do some renaming.

r? @michaelwoerister
2019-01-29 13:32:13 +00:00
Jethro Beekman
a75ae00c63 SGX target: improve panic & exit handling 2019-01-29 17:12:56 +05:30
gnzlbg
938a814e87 Update stdsimd 2019-01-29 10:48:54 +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
Dale Wijnand
1e577269da
Introduce into_raw_non_null on Rc and Arc 2019-01-28 22:24:26 +00:00
Rémy Rakic
c97d135452 Refer to synthetically named lifetimes as "some specific lifetime" rather than "the specific lifetime" 2019-01-28 23:12:13 +01: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
Mateusz Mikuła
99d00c86f8 bootstrap: set toolchain variables on per target basis
Using CC, CFLAGS, CXX, CXXFLAGS, AR and RANLIB breaks cross compilation
because host is built first and has correct values. The same
values are incorrect for the target however.
2019-01-28 21:57:40 +01:00
John Kåre Alsaker
fd9d9ee3a2 Fix a comment 2019-01-28 19:24:07 +01:00
John Kåre Alsaker
a015f7f61f Fix CI 2019-01-28 19:22:55 +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
John Kåre Alsaker
975eb312ef Use multiple threads by default. Limits tests to one thread. Do some renaming. 2019-01-28 16:24:33 +01: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