Commit graph

89104 commits

Author SHA1 Message Date
bors
741a3d42cb Auto merge of #58002 - oli-obk:deprecated_sugg, r=zackmdavis
Add suggestions to deprecation lints

Clippy used to do this suggestion, but the clippy lints happen after the deprecation lints so we ended up never seeing the structured suggestions.
2019-02-01 01:06:15 +00:00
bors
f29b4fbd74 Auto merge of #56696 - jonas-schievink:weak-counts, r=alexcrichton
Implement Weak::{strong_count, weak_count}

The counters are also useful on `Weak`, not just on strong references (`Rc` or `Arc`).

In situations where there are still strong references around, you can also get these counts by temporarily upgrading and adjusting the values accordingly. Using the methods introduced here is simpler to do, less error-prone (since you can't forget to adjust the counts), can also be used when no strong references are around anymore, and might be more efficient due to not having to temporarily create an `Rc`.

This is mainly useful in assertions or tests of complex data structures. Data structures might have internal invariants that make them the sole owner of a `Weak` pointer, and an assertion on the weak count could be used to ensure that this indeed happens as expected. Due to the presence of `Weak::upgrade`, the `strong_count` becomes less useful, but it still seems worthwhile to mirror the API of `Rc`.

TODO:
* [X] Tracking issue - https://github.com/rust-lang/rust/issues/57977

Closes https://github.com/rust-lang/rust/issues/50158
2019-01-31 19:20:14 +00:00
bors
63505b84a6 Auto merge of #57914 - jethrogb:jb/sgx-unwind-version, r=alexcrichton
SGX target: clean up dist builder, update libunwind

This incorporates https://github.com/fortanix/llvm-project/pull/4

Fixes https://github.com/fortanix/rust-sgx/issues/65

r? @alexcrichton
2019-01-31 16:21:39 +00:00
bors
8a0e5faec7 Auto merge of #58003 - nikic:saturating-add, r=nagisa
Use LLVM intrinsics for saturating add/sub

Use the `[su](add|sub).sat` LLVM intrinsics, if we're compiling against LLVM 8, as they should optimize and codegen better than IR based on `[su](add|sub).with.overlow`.

For the fallback for LLVM < 8 I'm using the same expansion that target lowering in LLVM uses, which is not the same as Rust currently uses (in particular due to the use of selects rather than branches).

Fixes #55286.
Fixes #52203.
Fixes #44500.

r? @nagisa
2019-01-31 13:40:11 +00:00
Vardhan Thigle
b025557e97 Updated commit id for building libunwind. 2019-01-31 17:42:08 +05:30
bors
d30b99f9c2 Auto merge of #57514 - michaelwoerister:xlto-tests, r=alexcrichton
compiletest: Support opt-in Clang-based run-make tests and use them for testing xLTO.

Some cross-language run-make tests need a Clang compiler that matches the LLVM version of `rustc`. Since such a compiler usually isn't available these tests (marked with the `needs-matching-clang`
directive) are ignored by default.

For some CI jobs we do need these tests to run unconditionally though. In order to support this a `--force-clang-based-tests` flag is added to compiletest. If this flag is specified, `compiletest` will fail if it can't detect an appropriate version of Clang.

@rust-lang/infra The PR doesn't yet enable the tests yet. Do you have any recommendation for which jobs to enable them?

cc #57438

r? @alexcrichton
2019-01-31 11:07:41 +00:00
bors
f40aaa6827 Auto merge of #58016 - Centril:rollup, r=Centril
Rollup of 12 pull requests

Successful merges:

 - #57008 (suggest `|` when `,` founds in invalid match value)
 - #57106 (Mark str::trim.* functions as #[must_use].)
 - #57920 (use `SOURCE_DATE_EPOCH` for man page time if set)
 - #57934 (Introduce into_raw_non_null on Rc and Arc)
 - #57971 (SGX target: improve panic & exit handling)
 - #57980 (Add the edition guide to the bookshelf)
 - #57984 (Improve bug message in check_ty)
 - #57999 (Add MOVBE x86 CPU feature)
 - #58000 (Fixes and cleanups)
 - #58005 (update docs for fix_start/end_matches)
 - #58007 (Don't panic when accessing enum variant ctor using `Self` in match)
 - #58008 (Pass correct arguments to places_conflict)

Failed merges:

r? @ghost
2019-01-31 03:47:17 +00:00
Mazdak Farrokhzad
877dee7c67
Rollup merge of #58008 - matthewjasper:places-conflict-args, r=oli-obk
Pass correct arguments to places_conflict

The borrow place *must* be a place that we track borrows for, otherwise
we will likely ICE.

Closes #57989
2019-01-31 02:10:53 +01:00
Mazdak Farrokhzad
bc7be96cb9
Rollup merge of #58007 - estebank:issue-58006, r=petrochenkov
Don't panic when accessing enum variant ctor using `Self` in match

Fix #58006.

r? @petrochenkov
2019-01-31 02:10:52 +01:00
Mazdak Farrokhzad
c76456c253
Rollup merge of #58005 - vitiral:docs_trim_start_matches, r=Manishearth
update docs for fix_start/end_matches

fixes #57686:
2019-01-31 02:10:51 +01:00
Mazdak Farrokhzad
880f6334f7
Rollup merge of #58000 - oli-obk:fixes_and_cleanups, r=RalfJung
Fixes and cleanups

Address the points raised in https://github.com/rust-lang/rust/pull/57677/files by @eddyb and @RalfJung
2019-01-31 02:10:50 +01:00
Mazdak Farrokhzad
bb91a192c0
Rollup merge of #57999 - jethrogb:jb/movbe-feature, r=alexcrichton
Add MOVBE x86 CPU feature

I have no idea if this is correct. I basically copied the ADX feature. I verified the feature is also called `movbe` in LLVM.

I marked this to become stable immediately, as part of the RFC 2045.

r? @alexcrichton
2019-01-31 02:10:49 +01:00
Mazdak Farrokhzad
dfc8ff549f
Rollup merge of #57984 - phansch:improve_check_ty_error, r=zackmdavis
Improve bug message in check_ty

This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.

It's also in line with the other `bug!` messages in `check_ty`.
2019-01-31 02:10:47 +01:00
Mazdak Farrokhzad
9b3aedf5b0
Rollup merge of #57980 - siddharthasahu:patch-1, r=QuietMisdreavus
Add the edition guide to the bookshelf
2019-01-31 02:10:46 +01:00
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
Matthew Jasper
6fe370c7ce Pass correct arguments to places_conflict
The borrow place *must* be a place that we track borrows for, otherwise
we will likely ICE.
2019-01-30 19:49:31 +00:00
Esteban Küber
74675fed68 Don't panic when accessing enum variant ctor using Self in match 2019-01-30 11:39:56 -08:00
Oliver Scherer
8c26c590b4 Failure resistent trait implementing 2019-01-30 19:29:10 +01:00
Philipp Hansch
037fdb8213
Improve bug message in check_ty
This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.

It's also in line with the other `bug!` messages in `check_ty`.
2019-01-30 19:17:06 +01:00
Rett Berg
4a3caca978 fix #57686: update docs for fix_start/end_matches 2019-01-30 10:12:49 -08:00
Oliver Scherer
765fa81a6e Swap the names of LocalValue and LocalState 2019-01-30 17:51:59 +01:00
Oliver Scherer
a7a5cb620f Prefer macro over manual implementation 2019-01-30 17:50:46 +01:00
Oliver Scherer
4056b575e2 Add suggestions to deprecation lints 2019-01-30 17:49:04 +01: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
Jethro Beekman
a3f0af2e67 Add MOVBE feature 2019-01-30 21:07:48 +05:30
Michael Woerister
b17c10de46 CI: Use lld for linking LLVM in the x86_64-gnu-debug image. 2019-01-30 16:21:43 +01:00
Michael Woerister
dc20c8cc25 bootstrap: Expose LLVM_USE_LINKER cmake option to config.toml. 2019-01-30 16:21:43 +01:00
Michael Woerister
4f534ffbdb ci: Use clang as the C++ compiler for x86_64-gnu-debug. 2019-01-30 16:21:43 +01:00
Michael Woerister
9c29517af9 bootstrap: Make LLD available to run-make tests. 2019-01-30 16:21:43 +01:00
Michael Woerister
4460e7c919 Add missing packages. 2019-01-30 16:21:43 +01:00
Oliver Scherer
5aa713e1c3 Eliminate an unwrap 2019-01-30 15:51:20 +01:00
Oliver Scherer
4e0af1fee1 Monomorphize types when not going through layout_of_local 2019-01-30 15:42:00 +01: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
Oliver Scherer
7017927aaf Indent fixup 2019-01-30 15:24:41 +01: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
Oliver Scherer
ab708f5c6f The return place's layout is only used once per frame, so caching doesn't help 2019-01-30 15:08:59 +01:00
Oliver Scherer
4165c890ed Can't use layout_of_local for the frame currently being created 2019-01-30 15:05:50 +01:00
Oliver Scherer
154c54c875 Make priroda happy again 2019-01-30 15:01:42 +01:00
Oliver Scherer
bc528d93ec Allow layout_of_local to also use cached layouts 2019-01-30 14:55:31 +01: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
Oliver Scherer
7cfb05fd23 Merge locals and local_layouts fields 2019-01-30 14:16:18 +01:00
Ralf Jung
c397ba0420 update miri 2019-01-30 12:58:33 +01:00