]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoPin stabilization: fix doctests
Taylor Cramer [Tue, 18 Dec 2018 18:20:53 +0000 (10:20 -0800)]
Pin stabilization: fix doctests

5 years agoStabilize Pin
Taylor Cramer [Tue, 18 Dec 2018 02:14:07 +0000 (18:14 -0800)]
Stabilize Pin

5 years agoUpdate Pin API to match the one proposed for stabilization
Taylor Cramer [Tue, 18 Dec 2018 01:19:32 +0000 (17:19 -0800)]
Update Pin API to match the one proposed for stabilization

Remove pin::Unpin reexport and add Unpin to the prelude.
Change Pin associated functions to methods.
Rename get_mut_unchecked_ to get_unchecked_mut
Remove impl Unpin for Pin
Mark Pin repr(transparent)

5 years agoAuto merge of #56805 - mikeyhew:stabilize-pin-as-receiver, r=nikomatsakis
bors [Sat, 22 Dec 2018 01:42:25 +0000 (01:42 +0000)]
Auto merge of #56805 - mikeyhew:stabilize-pin-as-receiver, r=nikomatsakis

Stabilize `Rc`, `Arc` and `Pin` as method receivers

Replaces #55880
Closes  #55786
r? @nikomatsakis
cc @withoutboats @cramertj

This lets you write methods using `self: Rc<Self>`, `self: Arc<Self>`, `self: Pin<&mut Self>`, `self: Pin<Box<Self>`, and other combinations involving `Pin` and another stdlib receiver type, without needing the `arbitrary_self_types`. Other user-created receiver types can be used, but they still require the feature flag to use.

This is implemented by introducing a new trait, `Receiver`, which the method receiver's type must implement if the `arbitrary_self_types` feature is not enabled. To keep composed receiver types such as `&Arc<Self>` unstable, the receiver type is also required to implement `Deref<Target=Self>` when the feature flag is not enabled.

This lets you use `self: Rc<Self>` and `self: Arc<Self>` in stable Rust, which was not allowed previously. It was agreed that they would be stabilized in #55786. `self: Pin<&Self>` and other pinned receiver types do not require the `arbitrary_self_types` feature, but they cannot be used on stable because `Pin` still requires the `pin` feature.

5 years agoAuto merge of #57033 - nikic:inhabitedness-perf, r=varkor
bors [Fri, 21 Dec 2018 23:00:55 +0000 (23:00 +0000)]
Auto merge of #57033 - nikic:inhabitedness-perf, r=varkor

Remove "visited" set from inhabitedness checking (fix perf regression)

Now that references are no longer recursively checked, this should no longer be necessary, and it's a major performance bottleneck.

This should fix #57028.

r? @varkor

5 years agoAuto merge of #56779 - adrian-budau:master, r=alexcrichton
bors [Fri, 21 Dec 2018 20:08:11 +0000 (20:08 +0000)]
Auto merge of #56779 - adrian-budau:master, r=alexcrichton

On musl targets assume certain symbols exist (like pipe2 and accept4).

This fixes #56675.

I don't know if this is the best solution, or if I should also add some tests so I'm waiting for some feedback.

Thanks!

5 years agoProperly report ENOSYS by modifying errno
Adrian Budau [Fri, 21 Dec 2018 13:53:37 +0000 (15:53 +0200)]
Properly report ENOSYS by modifying errno

5 years agoAuto merge of #56813 - oli-obk:main_🧶, r=pnkfelix
bors [Fri, 21 Dec 2018 10:46:11 +0000 (10:46 +0000)]
Auto merge of #56813 - oli-obk:main_🧶, r=pnkfelix

Always run rustc in a thread

cc @ishitatsuyuki @eddyb

r? @pnkfelix

[Previously](https://github.com/rust-lang/rust/pull/48575) we moved to only producing threads when absolutely necessary. Even before we opted to only create threads in some cases, which [is unsound](https://github.com/rust-lang/rust/pull/48575#issuecomment-380635967) due to the way we use thread local storage.

5 years agoRemove "visited" set from inhabitedness checking
Nikita Popov [Fri, 21 Dec 2018 10:44:05 +0000 (11:44 +0100)]
Remove "visited" set from inhabitedness checking

Now that references are no longer recursively checked, this should
no longer be necessary, and it's a major performance bottleneck.

5 years agoAuto merge of #55798 - GuillaumeGomez:version-display-associated-const, r=QuietMisdreavus
bors [Fri, 21 Dec 2018 01:58:16 +0000 (01:58 +0000)]
Auto merge of #55798 - GuillaumeGomez:version-display-associated-const, r=QuietMisdreavus

Add version display for associated consts

Fixes #54030.

<img width="1440" alt="screenshot 2018-11-08 at 23 57 29" src="https://user-images.githubusercontent.com/3050060/48232648-99decf00-e3b2-11e8-9f41-6bd12a161c7d.png">

r? @QuietMisdreavus

5 years agoAuto merge of #54125 - varkor:less-conservative-uninhabitedness-check, r=nikomatsakis
bors [Thu, 20 Dec 2018 22:04:21 +0000 (22:04 +0000)]
Auto merge of #54125 - varkor:less-conservative-uninhabitedness-check, r=nikomatsakis

Less conservative uninhabitedness check

Extends the uninhabitedness check to structs, non-empty enums, tuples and arrays.

Pulled out of #47291 and #50262.

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

r? @nikomatsakis

5 years agoAuto merge of #56845 - GuillaumeGomez:const-docs, r=oli-obk
bors [Thu, 20 Dec 2018 19:26:12 +0000 (19:26 +0000)]
Auto merge of #56845 - GuillaumeGomez:const-docs, r=oli-obk

Don't render const keyword on stable

Fixes #55246.

Continuation of #55327.

r? @oli-obk

5 years agoRemove nil-enum test
varkor [Thu, 20 Dec 2018 19:24:16 +0000 (19:24 +0000)]
Remove nil-enum test

5 years agoAuto merge of #56647 - petrochenkov:dcrate2, r=alexcrichton
bors [Thu, 20 Dec 2018 12:42:54 +0000 (12:42 +0000)]
Auto merge of #56647 - petrochenkov:dcrate2, r=alexcrichton

Rework treatment of `$crate` in procedural macros

Important clarification: `$crate` below means "processed `$crate`" or "output `$crate`". In the input of a decl macro `$crate` is just two separate tokens, but in the *output of a decl macro* `$crate` is a single keyword identifier (https://github.com/rust-lang/rust/issues/55640#issuecomment-435692791).

First of all, this PR removes the `eliminate_crate_var` hack.
`$crate::foo` is no longer replaced with `::foo` or `::crate_name::foo` in the input of derive proc macros, it's passed to the macro instead with its precise span and hygiene data, and can be treated as any other path segment keyword (like `crate` or `self`) after that. (Note: `eliminate_crate_var` was never used for non-derive proc macros.)

This creates an annoying problem - derive macros still may stringify their input before processing and expect `$crate` survive that stringification and refer to the same crate (the Rust 1.15-1.29 way of doing things).
Moreover, the input of proc macro attributes and derives (but not fn-like proc macros) also effectively survives stringification before being passed to the macro (also for legacy implementation reasons).

So we kind of resurrect the `eliminate_crate_var` hack in reduced form, but apply it only to AST pretty-printing.
If an AST fragment is pretty-printed, the resulting *text* will have `$crate` replaced with `crate` or `::crate_name`. This should be enough to keep all the legacy cases working.

Closes https://github.com/rust-lang/rust/issues/55640
Closes https://github.com/rust-lang/rust/issues/56622
r? @ghost

5 years agoFix typo in comment
Adrian Budau [Thu, 20 Dec 2018 11:29:04 +0000 (13:29 +0200)]
Fix typo in comment

5 years agoFix pipe2 and accept4 on static linked executables on linux (like musl).
Adrian Budau [Wed, 19 Dec 2018 14:13:43 +0000 (16:13 +0200)]
Fix pipe2 and accept4 on static linked executables on linux (like musl).

5 years agoAuto merge of #56741 - RalfJung:retag-to-raw, r=oli-obk
bors [Thu, 20 Dec 2018 09:58:10 +0000 (09:58 +0000)]
Auto merge of #56741 - RalfJung:retag-to-raw, r=oli-obk

treat ref-to-raw cast like a reborrow: do a special kind of retag

r? @oli-obk

Cc @nikomatsakis

5 years agoAdd test for associated const version display
Guillaume Gomez [Thu, 20 Dec 2018 09:39:25 +0000 (10:39 +0100)]
Add test for associated const version display

5 years agoAuto merge of #56649 - davidtwco:issue-46589, r=pnkfelix
bors [Thu, 20 Dec 2018 07:22:15 +0000 (07:22 +0000)]
Auto merge of #56649 - davidtwco:issue-46589, r=pnkfelix

MIR borrowck doesn't accept the example of iterating and updating a mutable reference

Fixes #46589.

r? @pnkfelix or @nikomatsakis

5 years agoRefactor and add comments to code in receiver_is_valid
Michael Hewson [Sun, 16 Dec 2018 21:47:37 +0000 (16:47 -0500)]
Refactor and add comments to code in receiver_is_valid

also updated some error messages

removed the code manually checking for `receiver_ty: Deref<Target=self_ty>`, in favour of using autoderef but only doing one iteration. This will cause error messages to be more consistent. Before, a "mismatched method receiver" error would be emitted when `receiver_ty` was valid except for a lifetime parameter, but only when `feature(arbitrary_self_types)` was enabled, and without the feature flag the error would be "uncoercible receiver". Now it emits "mismatched method receiver" in both cases.

5 years agoadd a doc comment on `receiver_is_valid`
Michael Hewson [Fri, 14 Dec 2018 06:27:49 +0000 (01:27 -0500)]
add a doc comment on `receiver_is_valid`

5 years agoStabilize `Rc`, `Arc` and `Pin` as method receivers
Michael Hewson [Tue, 20 Nov 2018 16:50:50 +0000 (11:50 -0500)]
Stabilize `Rc`, `Arc` and `Pin` as method receivers

This lets you write methods using `self: Rc<Self>`, `self: Arc<Self>`, `self: Pin<&mut Self>`, `self: Pin<Box<Self>`, and other combinations involving `Pin` and another stdlib receiver type, without needing the `arbitrary_self_types`. Other user-created receiver types can be used, but they still require the feature flag to use.

This is implemented by introducing a new trait, `Receiver`, which the method receiver's type must implement if the `arbitrary_self_types` feature is not enabled. To keep composed receiver types such as `&Arc<Self>` unstable, the receiver type is also required to implement `Deref<Target=Self>` when the feature flag is not enabled.

This lets you use `self: Rc<Self>` and `self: Arc<Self>` in stable Rust, which was not allowed previously. It was agreed that they would be stabilized in #55786. `self: Pin<&Self>` and other pinned receiver types do not require the `arbitrary_self_types` feature, but they cannot be used on stable because `Pin` still requires the `pin` feature.

5 years agoAuto merge of #56219 - arielb1:never-coerce-box, r=nikomatsakis
bors [Thu, 20 Dec 2018 03:41:00 +0000 (03:41 +0000)]
Auto merge of #56219 - arielb1:never-coerce-box, r=nikomatsakis

trigger unsized coercions keyed on Sized bounds

This PR causes unsized coercions to not be disabled by `$0: Unsize<dyn
Object>` coercion obligations when we have an `$0: Sized` obligation somewhere.

This should be mostly backwards-compatible, because in these cases not doing the unsize coercion should have caused the `$0: Sized` obligation to fail.

Note that `X: Unsize<dyn Object>` obligations can't fail *as obligations* if `X: Sized` holds, so this still maintains some version of monotonicity (I think that an unsized coercion can't be converted to no coercion by unifying type variables).

Fixes #49593 (unblocking never_type).

r? @eddyb
cc @nikomatsakis

5 years agoAuto merge of #54252 - arielb1:deref-query, r=nikomatsakis
bors [Wed, 19 Dec 2018 22:51:39 +0000 (22:51 +0000)]
Auto merge of #54252 - arielb1:deref-query, r=nikomatsakis

process nested obligations in autoderef

Fixes #53843.

r? @nikomatsakis

5 years agoWorkaround issues with crate loading during cross-compilation
Vadim Petrochenkov [Tue, 18 Dec 2018 00:21:28 +0000 (03:21 +0300)]
Workaround issues with crate loading during cross-compilation

5 years agoDo not interpret mismatches from pretty-printed `$crate` as token stream invalidation
Vadim Petrochenkov [Mon, 10 Dec 2018 23:26:31 +0000 (02:26 +0300)]
Do not interpret mismatches from pretty-printed `$crate` as token stream invalidation

5 years agoReintroduce special pretty-printing for `$crate` when it's necessary for proc macros
Vadim Petrochenkov [Sun, 9 Dec 2018 14:46:12 +0000 (17:46 +0300)]
Reintroduce special pretty-printing for `$crate` when it's necessary for proc macros

5 years agoproc_macro: Accept `$crate` as an identifier if it comes from the compiler
Vadim Petrochenkov [Sun, 9 Dec 2018 14:31:12 +0000 (17:31 +0300)]
proc_macro: Accept `$crate` as an identifier if it comes from the compiler

5 years agoproc_macro: Validate tokens coming from the compiler again
Vadim Petrochenkov [Sat, 8 Dec 2018 18:00:39 +0000 (21:00 +0300)]
proc_macro: Validate tokens coming from the compiler again

5 years agoRemove `eliminate_crate_var` and special pretty-printing for `$crate`
Vadim Petrochenkov [Sat, 8 Dec 2018 17:30:38 +0000 (20:30 +0300)]
Remove `eliminate_crate_var` and special pretty-printing for `$crate`

5 years agoAuto merge of #56613 - Zoxc:query-perf1, r=michaelwoerister
bors [Wed, 19 Dec 2018 20:13:40 +0000 (20:13 +0000)]
Auto merge of #56613 - Zoxc:query-perf1, r=michaelwoerister

Tweak query code for performance

Split from https://github.com/rust-lang/rust/pull/56509

r? @michaelwoerister

5 years agoAuto merge of #56601 - Zoxc:lifetime-killer, r=nikomatsakis
bors [Wed, 19 Dec 2018 15:22:55 +0000 (15:22 +0000)]
Auto merge of #56601 - Zoxc:lifetime-killer, r=nikomatsakis

Make the 'a lifetime on TyCtxt useless

cc @rust-lang/compiler

r? @nikomatsakis

5 years agoAuto merge of #56977 - pietroalbini:rollup, r=pietroalbini
bors [Wed, 19 Dec 2018 12:49:32 +0000 (12:49 +0000)]
Auto merge of #56977 - pietroalbini:rollup, r=pietroalbini

Rollup of 15 pull requests

Successful merges:

 - #56363 (Defactored Bytes::read)
 - #56663 (Remove lifetime from Resolver)
 - #56689 (add a lint group for lints emitted by rustdoc)
 - #56772 (fix issue 54153 by not testing issue-18804 on Windows nor OS X.)
 - #56820 (format-related tweaks)
 - #56881 (Implement Eq, PartialEq and Hash for atomic::Ordering)
 - #56907 (Fix grammar in compiler error for array iterators)
 - #56908 (rustc: Don't ICE on usage of two new target features)
 - #56910 (Do not point at delim spans for complete correct blocks)
 - #56913 (Enable stack probes for UEFI images)
 - #56918 (Profiler: simplify total_duration, improve readability)
 - #56931 (Update release notes for Rust 1.31.1)
 - #56947 (Add targets thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf)
 - #56948 (Update LLVM submodule)
 - #56959 (Fix mobile menu rendering collision with tooltip.)

Failed merges:

 - #56914 (Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le)

r? @ghost

5 years agoRollup merge of #56959 - JohnHeitmann:mobile-z-fix, r=GuillaumeGomez
Pietro Albini [Wed, 19 Dec 2018 10:47:23 +0000 (11:47 +0100)]
Rollup merge of #56959 - JohnHeitmann:mobile-z-fix, r=GuillaumeGomez

Fix mobile menu rendering collision with tooltip.

Bring the mobile-mode menu in front of the â“˜ icon.

Here's what the bug looks like:

![screen shot 2018-12-18 at 1 53 46 pm](https://user-images.githubusercontent.com/4282480/50185501-cbf62180-02cc-11e9-927e-3c6469901323.png)

5 years agoRollup merge of #56948 - jethrogb:jb/update-llvm, r=nikic
Pietro Albini [Wed, 19 Dec 2018 10:47:21 +0000 (11:47 +0100)]
Rollup merge of #56948 - jethrogb:jb/update-llvm, r=nikic

Update LLVM submodule

This includes https://github.com/rust-lang/llvm/pull/133

Fixes #56942

5 years agoRollup merge of #56947 - hsivonen:neon, r=alexcrichton
Pietro Albini [Wed, 19 Dec 2018 10:47:20 +0000 (11:47 +0100)]
Rollup merge of #56947 - hsivonen:neon, r=alexcrichton

Add targets thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf

These two targets enable both thumb-mode and NEON for ARMv7 CPUs.

This another attempt at #49902, which cannot be reopened. Between that PR and this one, some subrepos with C code whose build systems were failing went away.

5 years agoRollup merge of #56931 - pietroalbini:relnotes-1.31.1, r=pietroalbini
Pietro Albini [Wed, 19 Dec 2018 10:47:19 +0000 (11:47 +0100)]
Rollup merge of #56931 - pietroalbini:relnotes-1.31.1, r=pietroalbini

Update release notes for Rust 1.31.1

Backport from the stable branch.

r? @ghost

5 years agoRollup merge of #56918 - ljedrz:profiler_nits, r=wesleywiser
Pietro Albini [Wed, 19 Dec 2018 10:47:17 +0000 (11:47 +0100)]
Rollup merge of #56918 - ljedrz:profiler_nits, r=wesleywiser

Profiler: simplify total_duration, improve readability

r? @wesleywiser

5 years agoRollup merge of #56913 - tirr-c:uefi-stack-probes, r=alexcrichton
Pietro Albini [Wed, 19 Dec 2018 10:47:16 +0000 (11:47 +0100)]
Rollup merge of #56913 - tirr-c:uefi-stack-probes, r=alexcrichton

Enable stack probes for UEFI images

When building UEFI images, we don't link to any CRT libraries so we need to provide a stack probe. Without `__rust_probestack`, the linker looks for `__chkstk` and fails to link if there is a function with large local variables.

r? @alexcrichton

5 years agoRollup merge of #56910 - estebank:unclosed-eof, r=oli-obk
Pietro Albini [Wed, 19 Dec 2018 10:47:14 +0000 (11:47 +0100)]
Rollup merge of #56910 - estebank:unclosed-eof, r=oli-obk

Do not point at delim spans for complete correct blocks

Fix #56834.

5 years agoRollup merge of #56908 - alexcrichton:new-features, r=oli-obk
Pietro Albini [Wed, 19 Dec 2018 10:47:13 +0000 (11:47 +0100)]
Rollup merge of #56908 - alexcrichton:new-features, r=oli-obk

rustc: Don't ICE on usage of two new target features

I seem to always forget to update this portion of the compiler...

5 years agoRollup merge of #56907 - rumajo:master, r=kennytm,Centril
Pietro Albini [Wed, 19 Dec 2018 10:47:12 +0000 (11:47 +0100)]
Rollup merge of #56907 - rumajo:master, r=kennytm,Centril

Fix grammar in compiler error for array iterators

This fixes a small grammatical mistake in the message the compiler gives when attempting to iterate directly over an array `arr` without calling `arr.iter()` or borrowing `&arr`.

5 years agoRollup merge of #56881 - Amanieu:ordering_eq, r=alexcrichton
Pietro Albini [Wed, 19 Dec 2018 10:47:11 +0000 (11:47 +0100)]
Rollup merge of #56881 - Amanieu:ordering_eq, r=alexcrichton

Implement Eq, PartialEq and Hash for atomic::Ordering

r? @alexcrichton

5 years agoRollup merge of #56820 - ljedrz:format_tweaks, r=alexcrichton
Pietro Albini [Wed, 19 Dec 2018 10:47:09 +0000 (11:47 +0100)]
Rollup merge of #56820 - ljedrz:format_tweaks, r=alexcrichton

format-related tweaks

- remove an unreachable condition
- inline one-liners related to `parse_expr` (called in succession)
- refactor `report_invalid_references`
- refactor `verify_arg_type`
- minor stylistic improvements

5 years agoRollup merge of #56772 - pnkfelix:issue-54153-linkage-sometimes-requires-optimization...
Pietro Albini [Wed, 19 Dec 2018 10:47:08 +0000 (11:47 +0100)]
Rollup merge of #56772 - pnkfelix:issue-54153-linkage-sometimes-requires-optimizations, r=nikic

fix issue 54153 by not testing issue-18804 on Windows nor OS X.

Fix #54153

5 years agoRollup merge of #56689 - QuietMisdreavus:rustdoc-lint-group, r=pnkfelix
Pietro Albini [Wed, 19 Dec 2018 10:47:07 +0000 (11:47 +0100)]
Rollup merge of #56689 - QuietMisdreavus:rustdoc-lint-group, r=pnkfelix

add a lint group for lints emitted by rustdoc

As rustdoc adds more lints that it specifically manages, it would be nice to be able to lump them all together. This gives us a new group just for that.

I deliberately didn't include `missing_docs` because this is kind of a stepping stone for moving our lints into tool lints (i.e. `#![warn(rustdoc::private_doc_tests)]`), since all of these are specifically emitted by rustdoc. If we want to move `missing_docs` out of the compiler, that's also an option, but it would create a surprising change of behavior.

I also took the chance to rewrite the lint descriptions of these lints to better match the style of the other lints. `>_>`

5 years agoRollup merge of #56663 - Zoxc:resolver-lifetime, r=pnkfelix
Pietro Albini [Wed, 19 Dec 2018 10:47:05 +0000 (11:47 +0100)]
Rollup merge of #56663 - Zoxc:resolver-lifetime, r=pnkfelix

Remove lifetime from Resolver

5 years agoRollup merge of #56363 - Lucretiel:patch-3, r=shepmaster
Pietro Albini [Wed, 19 Dec 2018 10:47:04 +0000 (11:47 +0100)]
Rollup merge of #56363 - Lucretiel:patch-3, r=shepmaster

Defactored Bytes::read

Removed unneeded refactoring of read_one_byte, which removed the unneeded dynamic dispatch (`dyn Read`) used by that function.

This function is only used in one place in the entire Rust codebase; there doesn't seem to be a reason for it to exist (and there especially doesn't seem to be a reason for it to use dynamic dispatch)

5 years agoAuto merge of #56550 - chpio:rc-eq, r=alexcrichton
bors [Wed, 19 Dec 2018 10:16:05 +0000 (10:16 +0000)]
Auto merge of #56550 - chpio:rc-eq, r=alexcrichton

Short-circuit Rc/Arc equality checking on equal pointers where T: Eq

based on #42965

Is the use of the private trait ok this way? Is there anything else needed for this to get pulled?

5 years agoSet constness correctly
Guillaume Gomez [Tue, 18 Dec 2018 21:24:20 +0000 (22:24 +0100)]
Set constness correctly

5 years agoAuto merge of #56397 - petrhosek:file-search, r=cramertj
bors [Wed, 19 Dec 2018 06:46:15 +0000 (06:46 +0000)]
Auto merge of #56397 - petrhosek:file-search, r=cramertj

Search other library paths when loking for link objects

Support the case when link objects are not located in Rust sysroot
but in other locations which could be specify through library paths.

5 years agoSearch other library paths when loking for link objects
Petr Hosek [Sat, 1 Dec 2018 03:19:47 +0000 (19:19 -0800)]
Search other library paths when loking for link objects

Support the case when link objects are not located in Rust sysroot
but in other locations which could be specify through library paths.

5 years agoadd comment about subtyping
Ariel Ben-Yehuda [Wed, 19 Dec 2018 00:05:34 +0000 (02:05 +0200)]
add comment about subtyping

5 years agoFix mobile menu rendering collision with tooltip.
John Heitmann [Tue, 18 Dec 2018 21:55:30 +0000 (13:55 -0800)]
Fix mobile menu rendering collision with tooltip.

Bring the mobile-mode menu in front of the â“˜ icon.

5 years agoAuto merge of #56863 - arielb1:supertrait-self-4, r=nikomatsakis
bors [Tue, 18 Dec 2018 19:58:14 +0000 (19:58 +0000)]
Auto merge of #56863 - arielb1:supertrait-self-4, r=nikomatsakis

fix trait objects with a Self-containing projection values

Fixes #56288.

This follows ALT2 in the issue.

beta-nominating since this is a regression.

r? @nikomatsakis

5 years agoDon't render const keyword on stable
Guillaume Gomez [Wed, 24 Oct 2018 21:34:54 +0000 (23:34 +0200)]
Don't render const keyword on stable

5 years agoAuto merge of #56160 - oli-obk:const_fn_let, r=nikomatsakis
bors [Tue, 18 Dec 2018 14:21:07 +0000 (14:21 +0000)]
Auto merge of #56160 - oli-obk:const_fn_let, r=nikomatsakis

Fix various aspects around `let` bindings inside const functions

* forbid `let` bindings in const contexts that use short circuiting operators
* harden analysis code against derefs of mutable references

Initially this PR was about stabilizing `let` bindings, but too many flaws were exposed that need some more testing on nightly

5 years agoUpdate LLVM submodule
Jethro Beekman [Tue, 18 Dec 2018 09:56:10 +0000 (15:26 +0530)]
Update LLVM submodule

5 years agotreat ref-to-raw cast like a reborrow: do a special kind of retag
Ralf Jung [Tue, 11 Dec 2018 18:54:38 +0000 (19:54 +0100)]
treat ref-to-raw cast like a reborrow: do a special kind of retag

5 years agoExplain that lack of short circuiting support in constants is temporary
Oliver Scherer [Tue, 18 Dec 2018 08:42:46 +0000 (09:42 +0100)]
Explain that lack of short circuiting support in constants is temporary

5 years agoProperly worded diagnostic message
Oliver Scherer [Tue, 18 Dec 2018 08:16:56 +0000 (09:16 +0100)]
Properly worded diagnostic message

5 years agoAuto merge of #56481 - arielb1:dynamic-order, r=nikomatsakis
bors [Tue, 18 Dec 2018 06:50:11 +0000 (06:50 +0000)]
Auto merge of #56481 - arielb1:dynamic-order, r=nikomatsakis

add coherence future-compat warnings for marker-only trait objects

The future-compat warnings break code that assumes that `dyn Send + Sync !=
dyn Sync + Send`, and are the first step in making them equal. cc #33140.

Note: this lint should be made to default-warn before we merge. It is deny only for the crater run.

r? @nikomatsakis / @scalexm . cc @Centril & @alexreg.

5 years agoReordered match arms
Nathan West [Tue, 18 Dec 2018 01:43:52 +0000 (17:43 -0800)]
Reordered match arms

5 years agoFix DOM errors
Guillaume Gomez [Sun, 16 Dec 2018 20:48:02 +0000 (21:48 +0100)]
Fix DOM errors

5 years agoimprove tests as suggested by review comments
Ariel Ben-Yehuda [Mon, 17 Dec 2018 22:33:21 +0000 (00:33 +0200)]
improve tests as suggested by review comments

5 years agoAuto merge of #56303 - petrochenkov:stabuseas, r=cramertj
bors [Mon, 17 Dec 2018 22:18:26 +0000 (22:18 +0000)]
Auto merge of #56303 - petrochenkov:stabuseas, r=cramertj

Stabilize `underscore_imports`

Closes https://github.com/rust-lang/rust/issues/48216

5 years agoupdate release notes for rust 1.31.1
Pietro Albini [Mon, 17 Dec 2018 11:15:12 +0000 (12:15 +0100)]
update release notes for rust 1.31.1

5 years agoStabilize `underscore_imports`
Vadim Petrochenkov [Tue, 27 Nov 2018 23:58:18 +0000 (02:58 +0300)]
Stabilize `underscore_imports`

5 years agoDo not point at delim spans for complete correct blocks
Esteban Küber [Mon, 17 Dec 2018 04:00:17 +0000 (20:00 -0800)]
Do not point at delim spans for complete correct blocks

5 years agorustc: Don't ICE on usage of two new target features
Alex Crichton [Mon, 17 Dec 2018 03:01:43 +0000 (19:01 -0800)]
rustc: Don't ICE on usage of two new target features

I seem to always forget to update this portion of the compiler...

5 years agoAdd required lifetime parameter to BitDenotation.
David Wood [Mon, 17 Dec 2018 16:26:24 +0000 (17:26 +0100)]
Add required lifetime parameter to BitDenotation.

This avoids all sorts of confusing issues with using both `dest_place`
and `self` in the `propagate_call_return` function in the
`BitDenotation` implementation for `Borrows`.

5 years agoAuto merge of #56904 - sinkuu:cycle_fold, r=bluss
bors [Mon, 17 Dec 2018 16:01:46 +0000 (16:01 +0000)]
Auto merge of #56904 - sinkuu:cycle_fold, r=bluss

Remove Cycle::try_fold override

Fixes #56883

5 years agoprofiler: improve readability
ljedrz [Mon, 17 Dec 2018 15:31:11 +0000 (16:31 +0100)]
profiler: improve readability

5 years agoprofiler: simplify total_duration
ljedrz [Mon, 17 Dec 2018 15:30:14 +0000 (16:30 +0100)]
profiler: simplify total_duration

5 years agoKill borrows from a projection after assignment.
David Wood [Mon, 17 Dec 2018 12:11:33 +0000 (13:11 +0100)]
Kill borrows from a projection after assignment.

This commit extends previous work to kill borrows from a local after
assignment into that local to kill borrows from a projection after
assignment into a prefix of that place.

5 years agoAuto merge of #56810 - sinkuu:build_match, r=oli-obk
bors [Mon, 17 Dec 2018 13:26:40 +0000 (13:26 +0000)]
Auto merge of #56810 - sinkuu:build_match, r=oli-obk

Improve MIR match generation for ranges

Improves MIR match generation to rule out ranges/values distinct from the range that has been tested. e.g., for this code:

```rust
match x {
    0..=5 if b => 0,
    6..=10 => 1,
    _ => 2,
}
```

MIR (before):

```rust
bb0: { ...; _4 = Le(const 0i32, _1); switchInt(move _4) -> [false: bb6, otherwise: bb5]; }
bb1: { _3 = const 0i32; goto -> bb8; }
bb2: { _6 = _2; switchInt(move _6) -> [false: bb6, otherwise: bb1]; } // If `!b`, jumps to test if `6 <= x <= 10`.
bb3: { _3 = const 1i32; goto -> bb8; }
bb4: { _3 = const 2i32; goto -> bb8; }
bb5: { _5 = Le(_1, const 5i32); switchInt(move _5) -> [false: bb6, otherwise: bb2]; }
bb6: { _7 = Le(const 6i32, _1); switchInt(move _7) -> [false: bb4, otherwise: bb7]; }
bb7: { _8 = Le(_1, const 10i32); switchInt(move _8) -> [false: bb4, otherwise: bb3]; }
```

MIR (after):
```rust
bb0: { ...; _4 = Le(const 0i32, _1); switchInt(move _4) -> [false: bb5, otherwise: bb6]; }
bb1: { _3 = const 0i32; goto -> bb8; }
bb2: { _6 = _2; switchInt(move _6) -> [false: bb4, otherwise: bb1]; } // If `!b`, jumps to `_ =>` arm.
bb3: { _3 = const 1i32; goto -> bb8; }
bb4: { _3 = const 2i32; goto -> bb8; }
bb5: { _7 = Le(const 6i32, _1); switchInt(move _7) -> [false: bb4, otherwise: bb7]; }
bb6: { _5 = Le(_1, const 5i32); switchInt(move _5) -> [false: bb5, otherwise: bb2]; }
bb7: { _8 = Le(_1, const 10i32); switchInt(move _8) -> [false: bb4, otherwise: bb3]; }
```

cc #29623

5 years agoEnable stack probes for UEFI images
Wonwoo Choi [Mon, 17 Dec 2018 12:42:10 +0000 (21:42 +0900)]
Enable stack probes for UEFI images

5 years agoAddress LLVM assertion failure by prepopulating with *just* name-anon-globals.
Felix S. Klock II [Mon, 17 Dec 2018 12:45:27 +0000 (13:45 +0100)]
Address LLVM assertion failure by prepopulating with *just* name-anon-globals.

5 years agoAuto merge of #56853 - matthiaskrgr:clippy, r=oli-obk
bors [Mon, 17 Dec 2018 11:11:55 +0000 (11:11 +0000)]
Auto merge of #56853 - matthiaskrgr:clippy, r=oli-obk

submodules: update clippy from b7a431ea to a416c5e0

Changes:

````
rustup rust-lang/rust#52994
Fix test
Line length fix
Remove references to sized for end users
Remove DUMMY_SP
Add suggestion for replacement
Update lint definitions
Lint for Vec<Box<T: Sized>> - Closes #3530
Fix doc_markdown mixed case false positive
question_mark: Suggest Some(opt?) for if-else
redundant_field_names: Do not trigger on path with type params
question_mark: Lint only early returns
question_mark: Fix applicability
Remove obsolete comment
new_without_default, partialeq_ne_impl: Use span_lint_node
Update .stderr after rebase
cargo fmt and remove stabilized feature
Make suggestion Applicability::MachineApplicable
Address review feedback
Extract method
Check array lengths to prevent OOB access
Add suggestion for explicit_write lint
Fix write_with_newline escaping false positive
````

make toolstate green again

5 years agoAuto merge of #56833 - nagisa:ios-fix, r=alexcrichton
bors [Mon, 17 Dec 2018 08:54:15 +0000 (08:54 +0000)]
Auto merge of #56833 - nagisa:ios-fix, r=alexcrichton

Provide -isysroot with sdkroot for ios builds

Necessary for the new XCode?

Absolutely positively definitely untested… although I did

```
cargo rustc -- -Clink-arg=-isysroot -Clink-arg=$sdk_root
```

and stuff did compile for once.

5 years agotidy
Shotaro Yamada [Mon, 17 Dec 2018 08:10:49 +0000 (17:10 +0900)]
tidy

5 years agoAdd MIR test
Shotaro Yamada [Mon, 17 Dec 2018 07:53:22 +0000 (16:53 +0900)]
Add MIR test

5 years agoRevert thread-local changes
John KÃ¥re Alsaker [Mon, 17 Dec 2018 07:52:33 +0000 (08:52 +0100)]
Revert thread-local changes

5 years agoRemove *_inlined variants
John KÃ¥re Alsaker [Wed, 12 Dec 2018 17:43:13 +0000 (18:43 +0100)]
Remove *_inlined variants

5 years agoAdd a comment
John KÃ¥re Alsaker [Tue, 11 Dec 2018 17:44:57 +0000 (18:44 +0100)]
Add a comment

5 years agoRename await into cycle_error for the single threaded case and add some comments
John KÃ¥re Alsaker [Tue, 11 Dec 2018 16:17:32 +0000 (17:17 +0100)]
Rename await into cycle_error for the single threaded case and add some comments

5 years agoTurn some asserts into debug_asserts
John KÃ¥re Alsaker [Tue, 11 Dec 2018 16:17:09 +0000 (17:17 +0100)]
Turn some asserts into debug_asserts

5 years agoTweak query code for performance
John KÃ¥re Alsaker [Tue, 4 Dec 2018 15:26:34 +0000 (16:26 +0100)]
Tweak query code for performance

5 years agoAuto merge of #56764 - sinkuu:simpcfg_bb0, r=matthewjasper
bors [Mon, 17 Dec 2018 06:34:04 +0000 (06:34 +0000)]
Auto merge of #56764 - sinkuu:simpcfg_bb0, r=matthewjasper

mir-opt: Make SimplifyCfg collapse goto chains starting from bb0

`SimplifyCfg` pass was not able to collapse goto chains starting from bb0, leaving MIR like this:

```
bb0: {
    goto -> bb1;
}
```

5 years agoRemove `<Cycle as Iterator>::try_fold` override
Shotaro Yamada [Mon, 17 Dec 2018 00:35:28 +0000 (09:35 +0900)]
Remove `<Cycle as Iterator>::try_fold` override

It was a incorrect optimization.

5 years agoAuto merge of #56642 - nikic:llvm-6, r=alexcrichton
bors [Mon, 17 Dec 2018 04:18:14 +0000 (04:18 +0000)]
Auto merge of #56642 - nikic:llvm-6, r=alexcrichton

Bump minimum required LLVM version to 6.0

Based on the discussion in #55842, while the overall position of Rust wrt LLVM continues to be contentious, there does seem to be a consensus that there is no need for continued support of LLVM 5. This PR bumps our version requirement to LLVM 6.0 and makes Travis run against that.

I hope that this is going to unblock #52694. If I understand correctly, while this issue still exists in LLVM 6, Ubuntu has backported the relevant patch.

r? @alexcrichton

5 years agoFix grammar in compiler error for array iterators
Matthew Russell [Mon, 17 Dec 2018 02:27:41 +0000 (02:27 +0000)]
Fix grammar in compiler error for array iterators

5 years agoAuto merge of #56737 - nnethercote:TokenStream-improvements, r=petrochenkov
bors [Mon, 17 Dec 2018 01:48:23 +0000 (01:48 +0000)]
Auto merge of #56737 - nnethercote:TokenStream-improvements, r=petrochenkov

`TokenStream` improvements

Some `TokenStream` improvements: shrinking `TokenStream` and some other types, and some other code clean-ups.

5 years agocleanup `deduce_expectations_from_obligations`
Ariel Ben-Yehuda [Sat, 1 Dec 2018 12:27:45 +0000 (14:27 +0200)]
cleanup `deduce_expectations_from_obligations`

5 years agofix review comments, round 2
Ariel Ben-Yehuda [Mon, 26 Nov 2018 08:23:42 +0000 (10:23 +0200)]
fix review comments, round 2

5 years agoaddress review comments
Ariel Ben-Yehuda [Sun, 25 Nov 2018 21:51:23 +0000 (23:51 +0200)]
address review comments

5 years agotrigger unsized coercions keyed on Sized bounds
Ariel Ben-Yehuda [Sun, 25 Nov 2018 14:14:54 +0000 (16:14 +0200)]
trigger unsized coercions keyed on Sized bounds

This PR causes unsized coercions to not be disabled by `$0: Unsize<dyn
Object>` coercion obligations when we have an `$0: Sized` obligation
somewhere.

Note that `X: Unsize<dyn Object>` obligations can't fail *as
obligations* if `X: Sized` holds, so this still maintains some version
of monotonicity (I think that an unsized coercion can't be converted to
no coercion by unifying type variables).

Fixes #49593 (unblocking never_type).

5 years agoAuto merge of #56875 - Centril:rollup, r=Centril
bors [Sun, 16 Dec 2018 20:58:09 +0000 (20:58 +0000)]
Auto merge of #56875 - Centril:rollup, r=Centril

Rollup of 20 pull requests

Successful merges:

 - #53506 (Documentation for impl From for AtomicBool and other Atomic types)
 - #56343 (Remove not used mod)
 - #56439 (Clearer error message for dead assign)
 - #56640 (Add FreeBSD unsigned char platforms to std::os::raw)
 - #56648 (Fix BTreeMap UB)
 - #56672 (Document time of back operations of a Linked List)
 - #56706 (Make `const unsafe fn` bodies `unsafe`)
 - #56742 (infer: remove Box from a returned Iterator)
 - #56761 (Suggest using `.display()` when trying to print a `Path`)
 - #56781 (Update LLVM submodule)
 - #56789 (rustc: Add an unstable `simd_select_bitmask` intrinsic)
 - #56790 (Make RValue::Discriminant a normal Shallow read)
 - #56793 (rustdoc: look for comments when scraping attributes/crates from doctests)
 - #56826 (rustc: Add the `cmpxchg16b` target feature on x86/x86_64)
 - #56832 (std: Use `rustc_demangle` from crates.io)
 - #56844 (Improve CSS rule)
 - #56850 (Fixed issue with using `Self` ctor in typedefs)
 - #56855 (Remove u8 cttz hack)
 - #56857 (Fix a small mistake regarding NaNs in a deprecation message)
 - #56858 (Fix doc of `std::fs::canonicalize`)

Failed merges:

 - #56741 (treat ref-to-raw cast like a reborrow: do a special kind of retag)

r? @ghost

5 years agoAuto merge of #56876 - GuillaumeGomez:fix-JS-errors, r=QuietMisdreavus
bors [Sun, 16 Dec 2018 18:40:10 +0000 (18:40 +0000)]
Auto merge of #56876 - GuillaumeGomez:fix-JS-errors, r=QuietMisdreavus

Fix js errors

Fix JS error (you can see it on the iterator doc page) and the invalid theme switch.

r? @QuietMisdreavus

5 years agoAdd version display for associated consts
Guillaume Gomez [Thu, 8 Nov 2018 22:59:13 +0000 (23:59 +0100)]
Add version display for associated consts