Commit Graph

80283 Commits

Author SHA1 Message Date
Oliver Schneider
87005c0fd9 Remove unused field 2018-06-30 11:45:11 +02:00
Oliver Schneider
6641233b34 Reduce repetition around lower_method_sig 2018-06-30 11:45:11 +02:00
Oliver Schneider
82091d421a Deduplicate IsAsync::Async match 2018-06-30 11:45:10 +02:00
bors
bfc1ee4968 Auto merge of #51762 - petrochenkov:oh-hi-mark, r=oli-obk
hygiene: Implement transparent marks and use them for call-site hygiene in proc-macros

Fixes https://github.com/rust-lang/rust/issues/50050
2018-06-30 09:19:21 +00:00
bors
acf50b79be Auto merge of #51806 - oli-obk:lowering_cleanups1, r=cramertj
Lowering cleanups [1/N]
2018-06-30 07:10:18 +00:00
Zack M. Davis
6cc78bf8d7 in which we plug the crack where ?-desugaring leaked into errors
Most of the time, it's not a problem that the types of the arm bodies in
a desugared-from-`?` match are different (that is, specifically: in `x?`
where x is a `Result<A, B>`, the `Ok` arm body is an `A`, whereas the
`Err` arm diverges to return a `Result<A, B>`), because they're being
assigned to different places. But in tail position, the types do need to
match, and our error message was explicitly referring to "match arms",
which is confusing when there's no `match` in the sweetly sugared
source.

It is not without some misgivings that we pollute the clarity-of-purpose
of `note_error_origin` with the suggestion to wrap with `Ok` (the other
branches are pointing out the odd-arm-out in the HIR that is the origin
of the error; the new branch that issues the `Ok` suggestion is serving
a different purpose), but it's the natural place to do it given that
we're already matching on `ObligationCauseCode::MatchExpressionArm {
arm_span, source }` there.

Resolves #51632.
2018-06-29 22:11:39 -07:00
Wesley Wiser
84fe0c40a1 Fix relocations to include repeated values 2018-06-30 00:44:58 -04:00
bors
87ecf5442c Auto merge of #51178 - GabrielMajeri:os-str-compare, r=SimonSapin
Implement PartialEq between &str and OsString

This fixes #49854.

It allows equality comparison between `OsString` values and `str` references, such as `os_string == "something"`.
2018-06-30 04:03:14 +00:00
Wesley Wiser
c431f3fab9 Inline a few UndefMask methods.
This saves 2.5 seconds on the test program.
2018-06-29 23:33:17 -04:00
Jorge Aparicio
807cd36381 rename rustc's lld to rust-lld
to not shadow the system installed LLD when linking with LLD.

Before:

- `-C linker=lld -Z linker-flavor=ld.lld` uses rustc's LLD
- It's not possible to use a system installed LLD that's named `lld`

With this commit:

- `-C linker=rust-lld -Z linker-flavor=ld.lld` uses rustc's LLD
- `-C linker=lld -Z linker-flavor=ld.lld` uses the system installed LLD
2018-06-29 22:20:00 -05:00
Taylor Cramer
a2b21e5819 Make Waker and LocalWaker Unpin
These types never project pinned-ness into their contents,
so it is safe for them to be `Unpin`.
2018-06-29 19:33:16 -07:00
Taylor Cramer
2ce61c0aed Implement Unpin for references
These don'town the backing storage for their data,
so projecting `PinMut` into their fields is already unsound.
2018-06-29 19:31:55 -07:00
Wesley Wiser
8f969ed376 Optimize copy_undef_mask() to use one pass
This saves 0.5 seconds on the test compilation.
2018-06-29 22:26:15 -04:00
Taylor Cramer
3265189b68 Use in-tree libbacktrace on Fuchsia 2018-06-29 18:04:26 -07:00
Wesley Wiser
1ffa99d218 Optimize copy_undef_mask() by lifting some loop invariant operations
This saves 4.5 seconds and takes the compile time down to 5.5 seconds.
2018-06-29 20:22:35 -04:00
Vadim Petrochenkov
84f1bc8b66 Address comments 2018-06-30 01:53:32 +03:00
Vadim Petrochenkov
b69d51162b Restore the old behavior of $crate in nested macro_rules
`$crate` is not resolved at def-site of a macro, but rather at "transitive def-site"
2018-06-30 01:53:32 +03:00
Vadim Petrochenkov
9f92fce77c Fortify dummy span checking 2018-06-30 01:53:32 +03:00
Vadim Petrochenkov
297109ea32 proc-macro: Use transparent marks for call-site hygiene 2018-06-30 01:53:32 +03:00
Vadim Petrochenkov
99ecdb3f5f hygiene: Implement transparent marks 2018-06-30 01:53:32 +03:00
Vadim Petrochenkov
09856c85b7 expansion: Give names to some fields of SyntaxExtension 2018-06-30 01:53:32 +03:00
Vadim Petrochenkov
1328bdeef8 resolve: Cleanup resolve_crate_root 2018-06-30 01:53:32 +03:00
Jorge Aparicio
ee52862460 update another cfail test 2018-06-29 17:34:08 -05:00
Jorge Aparicio
c67566ac27 rename the llvm-tools component to llvm-tools-preview and tweak its image 2018-06-29 16:13:40 -05:00
Jorge Aparicio
faaf250a91 improve the error message when #[panic_implementation] is missing
closes #51341
2018-06-29 16:00:34 -05:00
bors
1029775ad5 Auto merge of #46720 - estebank:issue-46302, r=nikomatsakis
Fix incorrect type mismatch label pointing at return type

CC #46302.
2018-06-29 20:22:03 +00:00
Andy Russell
28c4813920
use literal span for concrete type suggestion
Fixes #51874.
2018-06-29 13:51:35 -04:00
Esteban Küber
2636b314ec Fix incorrect type mismatch label pointing at return type 2018-06-29 10:36:32 -07:00
bors
2c1a715cbd Auto merge of #51569 - SimonSapin:liballoc, r=sfackler
Make the public API of the alloc crate a subset of std

This only affects **unstable** APIs.

I plan to submit an RFC proposing to stabilize the crate. The reason it isn’t stable yet (https://github.com/rust-lang/rust/issues/27783) is in case we end up merging the standard library crates into one. However the `core` crate is already stable, so if that happens we’ll need to keep it working somehow (likely by making replacing its contents by `pub use` items). We can do the same for `alloc`. This PR will hopefully make this easier, but even if that doesn’t happen consistency with `std` seems good.
2018-06-29 16:48:57 +00:00
bors
5fdcd3aa38 Auto merge of #51891 - glandium:llvm, r=alexcrichton
Update LLVM to 1c817c7a0c828b8fc8e8e462afbe5db41c7052d1

https://github.com/rust-lang/llvm/pull/118
https://github.com/rust-lang/llvm/pull/119
2018-06-29 14:43:40 +00:00
bors
ab8a67c12a Auto merge of #51729 - matthewjasper:move-errors, r=nikomatsakis
[NLL] Better move errors

Make a number of changes to improve the quality of NLL cannot move errors.

* Group errors that occur in the same `match` with the same cause.
* Suggest `ref`, `&` or removing `*` to avoid the move.
* Show the place being matched on.

Differences from AST borrowck:

* `&` is suggested over `ref` when matching on a place that can't be moved from.
* Removing `*` is suggested instead of adding `&` when applicable.
* Sub-pattern spans aren't used, this would probably need Spans on Places.

Closes #45699
Closes #46627
Closes #51187
Closes #51189

r? @pnkfelix
2018-06-29 12:40:12 +00:00
Simon Sapin
15bb6c431d liballoc docs: Remove “not intended for general usage” 2018-06-29 14:01:33 +02:00
Simon Sapin
c7638edf52 Rename alloc::arc to alloc::sync, to match std::sync 2018-06-29 14:01:33 +02:00
Simon Sapin
3394fb7bb7 Remove the Vec and String reexports at the root of the alloc crate
… since `std` has no corresponding reexports.

Use `alloc::vec::Vec` and `alloc::string::String` instead.
2018-06-29 14:01:33 +02:00
Simon Sapin
b0547cea0a Move core::alloc::CollectionAllocErr to alloc::collections 2018-06-29 14:01:33 +02:00
Simon Sapin
121b57b87a Move some alloc crate top-level items to a new alloc::collections module
This matches std::collections
2018-06-29 14:01:33 +02:00
Simon Sapin
26324d0abe Remove the unstable alloc::allocator module reexport, deprecated since 1.27 2018-06-29 14:01:33 +02:00
Simon Sapin
1acbb0a935 Make raw_vec perma-unstable and hidden 2018-06-29 14:01:33 +02:00
Gabriel Majeri
fbd3c92a88 Add run-pass test 2018-06-29 14:50:00 +03:00
Gabriel Majeri
fdcee4da79 Fix stability attributes 2018-06-29 14:50:00 +03:00
Gabriel Majeri
02503029b8 Implement PartialEq between &str and OsString
Allows for example `os_string == "something"`
2018-06-29 14:50:00 +03:00
bors
6e5e63a48c Auto merge of #50526 - moxian:just-fix, r=alexcrichton
Add a fallback for stacktrace printing for older Windows versions.

Some time ago we switched stack inspection functions of dbghelp.dll to their newer alternatives that also capture inlined context.
Unfortunately, said new alternatives are not present in older dbghelp.dll versions.
In particular Windows 7 at the time of writing has dbghelp.dll version 6.1.7601 from 2010, that lacks StackWalkEx and friends.

Tested on my Windows 7 - both msvc and gnu versions produce a readable stacktrace.

Fixes #50138
2018-06-29 09:42:40 +00:00
bors
2eb6969c6a Auto merge of #51290 - Pslydhh:master, r=alexcrichton
park/park_timeout: prohibit spurious wakeups in next park

<pre><code>
// The implementation currently uses the trivial strategy of a Mutex+Condvar
// with wakeup flag, which does not actually allow spurious wakeups.
</pre></code>

Because does not actually allow spurious wakeups.
so we have let thread.inner.cvar.wait(m) in the loop to prohibit spurious wakeups.
but if notified after we locked, this notification doesn't be consumed, it return, the next park will consume this notification...this is also 'spurious wakeup' case, 'one unpark() wakeups two  park()'.

We should improve this situation:
`thread.inner.state.store(EMPTY, SeqCst);`
2018-06-29 07:34:13 +00:00
Mike Hommey
998ce108df Update LLVM to 1c817c7a0c828b8fc8e8e462afbe5db41c7052d1
https://github.com/rust-lang/llvm/pull/118
https://github.com/rust-lang/llvm/pull/119
2018-06-29 13:58:17 +09:00
bors
3b50455c61 Auto merge of #50357 - seanmonstar:arc-weak-null, r=KodrAus
Arc: remove unused allocation from Weak::new()

It seems non-obvious that calling `Weak::new()` actually allocates space for the entire size of `T`, even though you can **never** access that data from such a constructed weak pointer. Besides that, if someone were to create many `Weak:new()`s, they could be unknowingly wasting a bunch of memory.

This change makes it so that `Weak::new()` allocates no memory at all. Instead, it is created with a null pointer. The only things done with a `Weak` are trying to upgrade, cloning, and dropping, meaning there are very few places that the code actually needs to check if the pointer is null.
2018-06-29 04:09:02 +00:00
Ixrec
d6cf1821bf
Fix inconsequential typo in GlobalAlloc doc example 2018-06-29 03:12:02 +01:00
bors
775ce97497 Auto merge of #51592 - GuillaumeGomez:fix-macro-doc-search, r=GuillaumeGomez
Fix macro missing from doc search

Fixes #51095.

r? @QuietMisdreavus
2018-06-29 01:05:02 +00:00
Nicholas Nethercote
08683f003c Rename IdxSet::clone_from.
The current situation is something of a mess.

- `IdxSetBuf` derefs to `IdxSet`.
- `IdxSetBuf` implements `Clone`, and therefore has a provided `clone_from`
  method, which does allocation and so is expensive.
- `IdxSet` has a `clone_from` method that is non-allocating and therefore
  cheap, but this method is not from the `Clone` trait.

As a result, if you have an `IdxSetBuf` called `b`, if you call
`b.clone_from(b2)` you'll get the expensive `IdxSetBuf` method, but if you call
`(*b).clone_from(b2)` you'll get the cheap `IdxSetBuf` method.
`liveness_of_locals()` does the former, presumably unintentionally, and
therefore does lots of unnecessary allocations.

Having a `clone_from` method that isn't from the `Clone` trait is a bad idea in
general, so this patch renames it as `overwrite`. This avoids the unnecessary
allocations in `liveness_of_locals()`, speeding up most NLL benchmarks, the
best by 1.5%. It also means that calls of the form `(*b).clone_from(b2)` can be
rewritten as `b.overwrite(b2)`.
2018-06-29 09:57:19 +10:00
bors
57dd722606 Auto merge of #51884 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 6 pull requests

Successful merges:

 - #51636 (Refactor error reporting of constants)
 - #51765 (Use assert_eq! in copy_from_slice)
 - #51822 (Provide existing ref suggestions for more E0308 errors)
 - #51839 (Detect overflows of non u32 shifts)
 - #51868 (Remove process::id from 'Stabilized APIs' in 1.27.0 release notes)
 - #51875 (Explicitely disable WASM code generation for Emscripten)

Failed merges:

r? @ghost
2018-06-28 22:20:14 +00:00
Mark Rousskov
3332c0c7e1
Rollup merge of #51875 - badboy:emscripten-no-wasm, r=nikomatsakis
Explicitely disable WASM code generation for Emscripten

Emscripten changed the default behavior recently:
bd050e64bb/ChangeLog.markdown (v1381-05172018)

It now defaults to WebAssembly and requires an explicit flag to generate asm.js.
WASM=0 is also valid for older emcc and thus doesn't break it.
2018-06-28 16:07:16 -06:00