]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoTake Const into account in HIR
varkor [Fri, 15 Feb 2019 22:25:42 +0000 (22:25 +0000)]
Take Const into account in HIR

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd E0111
varkor [Fri, 15 Feb 2019 22:24:22 +0000 (22:24 +0000)]
Add E0111

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd Const kind to rustdoc
varkor [Fri, 15 Feb 2019 22:24:00 +0000 (22:24 +0000)]
Add Const kind to rustdoc

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoMove const generic error from lowering to collect
varkor [Fri, 15 Feb 2019 22:22:54 +0000 (22:22 +0000)]
Move const generic error from lowering to collect

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd pretty-printing for const generics
varkor [Fri, 15 Feb 2019 22:21:57 +0000 (22:21 +0000)]
Add pretty-printing for const generics

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd Const kind to HIR
varkor [Fri, 15 Feb 2019 22:20:46 +0000 (22:20 +0000)]
Add Const kind to HIR

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAuto merge of #58406 - Disasm:rv64-support, r=nagisa
bors [Fri, 15 Feb 2019 16:20:12 +0000 (16:20 +0000)]
Auto merge of #58406 - Disasm:rv64-support, r=nagisa

Add riscv64{imac,gc}-unknown-none-elf targets

Previous attempt by @fintelia: https://github.com/rust-lang/rust/pull/58012

Related: https://github.com/rust-embedded/wg/issues/218

5 years agoAuto merge of #58403 - eddyb:requalify, r=oli-obk
bors [Fri, 15 Feb 2019 12:15:17 +0000 (12:15 +0000)]
Auto merge of #58403 - eddyb:requalify, r=oli-obk

rustc_mir: split qualify_consts' "value qualification" bitflags into separate computations.

Prerequisite for computing those bits through a dataflow algorithm ~~(which I might do in this PR later)~~.

This PR should not change behavior overall, other than treating `simd_shuffle*` identically to `#[rustc_args_required_const]` (maybe we should just have `#[rustc_args_required_const]` on the intrinsic imports of `simd_shuffle*`? cc @gnzlbg)

cc @oli-obk @alexreg

5 years agorustc_mir: compute all the qualification bits separately in qualify_consts.
Eduard-Mihai Burtescu [Wed, 6 Feb 2019 15:18:42 +0000 (17:18 +0200)]
rustc_mir: compute all the qualification bits separately in qualify_consts.

5 years agorustc_mir: rename qualify_consts::Qualifier to ConstCx and keep in Checker as a field.
Eduard-Mihai Burtescu [Thu, 7 Feb 2019 01:45:37 +0000 (03:45 +0200)]
rustc_mir: rename qualify_consts::Qualifier to ConstCx and keep in Checker as a field.

5 years agorustc_mir: do not treat NEEDS_DROP as unexpected in qualify_consts.
Eduard-Mihai Burtescu [Wed, 6 Feb 2019 16:11:48 +0000 (18:11 +0200)]
rustc_mir: do not treat NEEDS_DROP as unexpected in qualify_consts.

5 years agorustc_mir: avoid having an Option around each local qualification in qualify_consts.
Eduard-Mihai Burtescu [Wed, 6 Feb 2019 01:08:43 +0000 (03:08 +0200)]
rustc_mir: avoid having an Option around each local qualification in qualify_consts.

5 years agorustc_mir: rename `Qualif::for_ty to `Qualif::any_value_of_ty`.
Eduard-Mihai Burtescu [Tue, 5 Feb 2019 17:46:43 +0000 (19:46 +0200)]
rustc_mir: rename `Qualif::for_ty to `Qualif::any_value_of_ty`.

5 years agorustc_mir: remove qualify_consts::Qualif::FN_ARGUMENT.
Eduard-Mihai Burtescu [Tue, 5 Feb 2019 11:24:49 +0000 (13:24 +0200)]
rustc_mir: remove qualify_consts::Qualif::FN_ARGUMENT.

5 years agorustc_mir: remove outdated `const fn` stability diagnostic.
Eduard-Mihai Burtescu [Tue, 5 Feb 2019 10:45:15 +0000 (12:45 +0200)]
rustc_mir: remove outdated `const fn` stability diagnostic.

5 years agorustc_mir: split qualify_consts' checking and value qualification.
Eduard-Mihai Burtescu [Tue, 5 Feb 2019 08:37:28 +0000 (10:37 +0200)]
rustc_mir: split qualify_consts' checking and value qualification.

5 years agorustc_mir: split off some qualify_consts::Checker fields into a State struct.
Eduard-Mihai Burtescu [Mon, 4 Feb 2019 21:24:20 +0000 (23:24 +0200)]
rustc_mir: split off some qualify_consts::Checker fields into a State struct.

5 years agorustc_mir: rename qualify_consts::Qualifier to Checker.
Eduard-Mihai Burtescu [Sat, 29 Sep 2018 08:56:26 +0000 (11:56 +0300)]
rustc_mir: rename qualify_consts::Qualifier to Checker.

5 years agoAuto merge of #58455 - Centril:rollup, r=Centril
bors [Thu, 14 Feb 2019 10:32:25 +0000 (10:32 +0000)]
Auto merge of #58455 - Centril:rollup, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #58309 (Add more profiler events)
 - #58347 (Closure bounds fixes)
 - #58365 (Add an option to print the status of incremental tasks / dep nodes after running them)
 - #58371 (Check user type annotations for range patterns.)
 - #58378 (rustc: Implement incremental "fat" LTO)
 - #58407 (specify "upper camel case" in style lint)
 - #58449 (Notify @topecongiro when the state of rustfmt has changed)

Failed merges:

r? @ghost

5 years agoRollup merge of #58449 - topecongiro:rustfmt-toolstate, r=Centril
Mazdak Farrokhzad [Thu, 14 Feb 2019 07:24:18 +0000 (08:24 +0100)]
Rollup merge of #58449 - topecongiro:rustfmt-toolstate, r=Centril

Notify @topecongiro when the state of rustfmt has changed

I would like to get notified when the state of rustfmt has changed.
Context: I am currently a leader of the rustfmt working group.

cc @nrc do you still want to get notified?

5 years agoRollup merge of #58407 - euclio:upper-camel-case, r=estebank
Mazdak Farrokhzad [Thu, 14 Feb 2019 07:24:17 +0000 (08:24 +0100)]
Rollup merge of #58407 - euclio:upper-camel-case, r=estebank

specify "upper camel case" in style lint

Also, fix an issue where internal upper case letters were converted to
lower case.

Fixes #57319.

5 years agoRollup merge of #58378 - alexcrichton:incremental-lto, r=michaelwoerister
Mazdak Farrokhzad [Thu, 14 Feb 2019 07:24:15 +0000 (08:24 +0100)]
Rollup merge of #58378 - alexcrichton:incremental-lto, r=michaelwoerister

rustc: Implement incremental "fat" LTO

Currently the compiler will produce an error if both incremental
compilation and full fat LTO is requested. With recent changes and the
advent of incremental ThinLTO, however, all the hard work is already
done for us and it's actually not too bad to remove this error!

This commit updates the codegen backend to allow incremental full fat
LTO. The semantics are that the input modules to LTO are all produce
incrementally, but the final LTO step is always done unconditionally
regardless of whether the inputs changed or not. The only real
incremental win we could have here is if zero of the input modules
changed, but that's so rare it's unlikely to be worthwhile to implement
such a code path.

cc #57968
cc rust-lang/cargo#6643

5 years agoRollup merge of #58371 - davidtwco:issue-58299, r=arielb1
Mazdak Farrokhzad [Thu, 14 Feb 2019 07:24:14 +0000 (08:24 +0100)]
Rollup merge of #58371 - davidtwco:issue-58299, r=arielb1

Check user type annotations for range patterns.

Fixes #58299.

This PR builds on the fix from #58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).

r? @arielb1

5 years agoRollup merge of #58365 - Zoxc:task-status, r=michaelwoerister
Mazdak Farrokhzad [Thu, 14 Feb 2019 07:24:13 +0000 (08:24 +0100)]
Rollup merge of #58365 - Zoxc:task-status, r=michaelwoerister

Add an option to print the status of incremental tasks / dep nodes after running them

r? @michaelwoerister

5 years agoRollup merge of #58347 - matthewjasper:closure-bounds-fixes, r=pnkfelix
Mazdak Farrokhzad [Thu, 14 Feb 2019 07:24:12 +0000 (08:24 +0100)]
Rollup merge of #58347 - matthewjasper:closure-bounds-fixes, r=pnkfelix

Closure bounds fixes

* Ensures that "nice region errors" are buffered so that they are sorted and migrated correctly.
* Propagates fewer constraints for closures (cc #58178)
* Propagate constraints from closures more precisely (#58127)

Closes #58127

r? @nikomatsakis

5 years agoRollup merge of #58309 - wesleywiser:add_more_profiler_events, r=michaelwoerister
Mazdak Farrokhzad [Thu, 14 Feb 2019 07:24:10 +0000 (08:24 +0100)]
Rollup merge of #58309 - wesleywiser:add_more_profiler_events, r=michaelwoerister

Add more profiler events

- Adds Start\Stop events for time spent loading incremental query results from disk.

- Adds Start\Stop events for time spent blocked waiting for queries to complete (when parallel queries are enabled).

r? @michaelwoerister

5 years agoAuto merge of #58446 - Centril:rollup, r=Centril
bors [Thu, 14 Feb 2019 04:22:35 +0000 (04:22 +0000)]
Auto merge of #58446 - Centril:rollup, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #57451 (suggestion-diagnostics: as_ref improve snippet)
 - #57856 (Convert old first edition links to current edition one)
 - #57992 (Update the future/task API)
 - #58258 (Reduce the size of `hir::Expr`.)
 - #58267 (Tweak "incompatible match arms" error)
 - #58296 (Hidden suggestion support)
 - #58301 (Enable comparing fat pointers)
 - #58308 (Extract block to insert an intrinsic into its own function)

Failed merges:

r? @ghost

5 years agoNotify @topecongiro when the state of rustfmt has changed
topecongiro [Thu, 14 Feb 2019 02:11:05 +0000 (11:11 +0900)]
Notify @topecongiro when the state of rustfmt has changed

5 years agoRollup merge of #58308 - gnzlbg:context_insert_intr, r=eddyb
Mazdak Farrokhzad [Thu, 14 Feb 2019 01:41:24 +0000 (02:41 +0100)]
Rollup merge of #58308 - gnzlbg:context_insert_intr, r=eddyb

Extract block to insert an intrinsic into its own function

r? @eddyb

5 years agoRollup merge of #58301 - RalfJung:fat-ptr-eq, r=oli-obk
Mazdak Farrokhzad [Thu, 14 Feb 2019 01:41:23 +0000 (02:41 +0100)]
Rollup merge of #58301 - RalfJung:fat-ptr-eq, r=oli-obk

Enable comparing fat pointers

Also refactor our binops a bit to make that happen more easily.

r? @oli-obk

5 years agoRollup merge of #58296 - estebank:hidden-suggestion, r=oli-obk
Mazdak Farrokhzad [Thu, 14 Feb 2019 01:41:21 +0000 (02:41 +0100)]
Rollup merge of #58296 - estebank:hidden-suggestion, r=oli-obk

Hidden suggestion support

Add way to hide suggestion snippet window from cli output to avoid cluttered spans that don't enhance understanding.

r? @pietroalbini CC @zackmdavis

5 years agoRollup merge of #58267 - estebank:match-arms, r=matthewjasper
Mazdak Farrokhzad [Thu, 14 Feb 2019 01:41:20 +0000 (02:41 +0100)]
Rollup merge of #58267 - estebank:match-arms, r=matthewjasper

Tweak "incompatible match arms" error

- Point at the body expression of the match arm with the type error.
- Point at the prior match arms explicitly stating the evaluated type.
- Point at the entire match expr in a secondary span, instead of primary.
- For type errors in the first match arm, the cause is outside of the
  match, treat as implicit block error to give a more appropriate error.

Fix #46776, fix #57206.
CC #24157, #38234.

5 years agoRollup merge of #58258 - nnethercote:shrink-hir-Expr, r=michaelwoerister
Mazdak Farrokhzad [Thu, 14 Feb 2019 01:41:19 +0000 (02:41 +0100)]
Rollup merge of #58258 - nnethercote:shrink-hir-Expr, r=michaelwoerister

Reduce the size of `hir::Expr`.

From 104 bytes to 72 bytes on x86-64. This slightly reduces instruction
counts.

Also add an assertion about the size.

5 years agoRollup merge of #57992 - Matthias247:waker4, r=cramertj
Mazdak Farrokhzad [Thu, 14 Feb 2019 01:41:17 +0000 (02:41 +0100)]
Rollup merge of #57992 - Matthias247:waker4, r=cramertj

Update the future/task API

This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592.

Changes:
- Replacing UnsafeWake with RawWaker and RawWakerVtable
- Removal of LocalWaker
- Removal of Arc-based Wake trait

5 years agoRollup merge of #57856 - lzutao:fix-old-first-edition, r=steveklabnik
Mazdak Farrokhzad [Thu, 14 Feb 2019 01:41:16 +0000 (02:41 +0100)]
Rollup merge of #57856 - lzutao:fix-old-first-edition, r=steveklabnik

Convert old first edition links to current edition one

r? @steveklabnik

5 years agoRollup merge of #57451 - dlrobertson:can_use_as_ref_nit, r=estebank
Mazdak Farrokhzad [Thu, 14 Feb 2019 01:41:15 +0000 (02:41 +0100)]
Rollup merge of #57451 - dlrobertson:can_use_as_ref_nit, r=estebank

suggestion-diagnostics: as_ref improve snippet

Improve the code snippet suggested in suggestion-diagnostics when
suggesting the use of as_ref.

Given:

```rust
fn test(x: &usize) {}
fn main() {
    Some(42).map(|x| test(x));
}
```

Suggest

```
  help: consider using `as_ref` instead: `as_ref().map`
```

Instead of

```
  help: consider using `as_ref` instead: `as_ref().`
```

5 years agoReduce the size of `hir::Expr`.
Nicholas Nethercote [Thu, 7 Feb 2019 05:03:57 +0000 (16:03 +1100)]
Reduce the size of `hir::Expr`.

From 104 bytes to 72 bytes on x86-64. This slightly reduces instruction
counts.

Also add an assertion about the size.

5 years agoAuto merge of #58432 - Centril:rollup, r=Centril
bors [Wed, 13 Feb 2019 22:23:09 +0000 (22:23 +0000)]
Auto merge of #58432 - Centril:rollup, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #58110 (libpanic_unwind => 2018)
 - #58167 (HirId-ify hir::BodyId)
 - #58202 (Ignore future deprecations in #[deprecated])
 - #58272 (Cut down on number formating code size)
 - #58276 (Improve the error messages for missing stability attributes)
 - #58354 (Fix ICE and invalid filenames in MIR printing code)
 - #58381 (Only suggest imports if not imported.)
 - #58386 (Fix #54242)
 - #58400 (Fix rustc_driver swallowing errors when compilation is stopped)
 - #58420 (target/uefi: clarify documentation)

Failed merges:

r? @ghost

5 years agoPropagate region constraints more precisely from closures
Matthew Jasper [Wed, 6 Feb 2019 13:13:01 +0000 (14:13 +0100)]
Propagate region constraints more precisely from closures

5 years agoBuffer and migrate nice region errors
Matthew Jasper [Wed, 6 Feb 2019 13:11:09 +0000 (14:11 +0100)]
Buffer and migrate nice region errors

5 years agoAvoid propagating redundant outlives constraints from closures
Matthew Jasper [Sun, 10 Feb 2019 09:53:52 +0000 (09:53 +0000)]
Avoid propagating redundant outlives constraints from closures

5 years agospecify "upper camel case" in style lint
Andy Russell [Tue, 12 Feb 2019 17:35:38 +0000 (12:35 -0500)]
specify "upper camel case" in style lint

Also, fix an issue where internal upper case letters were converted to
lower case.

5 years agosuggestion-diagnostics: as_ref improve snippet
Dan Robertson [Wed, 13 Feb 2019 17:52:22 +0000 (17:52 +0000)]
suggestion-diagnostics: as_ref improve snippet

Improve the code snippet suggested in suggestion-diagnostics when
suggesting the use of as_ref.

5 years agoRollup merge of #58420 - dvdhrm:target-uefi-comments, r=nagisa
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:39 +0000 (18:12 +0100)]
Rollup merge of #58420 - dvdhrm:target-uefi-comments, r=nagisa

target/uefi: clarify documentation

This clarifies why FP-units are disabled on UEFI targets, as well as
why we must opt into the NXCOMPAT feature.

I did find some time to investigate why GRUB and friends disable FP on
UEFI. The specification explicitly allows using MMX/SSE/AVX, but as it
turns out it does not mandate enabling the instruction sets explicitly.
Hence, any use of these instructions will trigger CPU exceptions,
unless an application explicitly enables them (which is not an option,
as these are global flags that better be controlled by the
kernel/firmware).

Furthermore, UEFI systems are allowed to mark any non-code page as
non-executable. Hence, we must make sure to never place code on the
stack or heap. So we better pass /NXCOMPAT to the linker for it to
complain if it ever places code in non-code pages.

Lastly, this fixes some typos in related comments.

r? @alexcrichton

5 years agoRollup merge of #58400 - gnzlbg:fix_driver, r=oli-obk
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:37 +0000 (18:12 +0100)]
Rollup merge of #58400 - gnzlbg:fix_driver, r=oli-obk

Fix rustc_driver swallowing errors when compilation is stopped

r? @oli-obk

5 years agoRollup merge of #58386 - Zoxc:fix-54242, r=michaelwoerister
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:36 +0000 (18:12 +0100)]
Rollup merge of #58386 - Zoxc:fix-54242, r=michaelwoerister

Fix #54242

r? @michaelwoerister

5 years agoRollup merge of #58381 - davidtwco:issue-42944, r=estebank
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:35 +0000 (18:12 +0100)]
Rollup merge of #58381 - davidtwco:issue-42944, r=estebank

Only suggest imports if not imported.

Fixes #42944 and fixes #53430.

This commit modifies name resolution error reporting so that if a name
is in scope and has been imported then we do not suggest importing it.

This can occur when we add a label about constructors not being visible
due to private fields. In these cases, we know that the struct/variant
has been imported and we should silence any suggestions to import the
struct/variant.

r? @estebank

5 years agoRollup merge of #58354 - matthewjasper:mir-dump-fixes, r=wesleywiser
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:34 +0000 (18:12 +0100)]
Rollup merge of #58354 - matthewjasper:mir-dump-fixes, r=wesleywiser

Fix ICE and invalid filenames in MIR printing code

* Don't panic when printing MIR for associated constants
* Don't use `<` and `>` in filenames, since they aren't allowed on Windows.

r? @eddyb

cc @RalfJung

5 years agoRollup merge of #58276 - varkor:missing-stability-attr-top-level, r=davidtwco
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:32 +0000 (18:12 +0100)]
Rollup merge of #58276 - varkor:missing-stability-attr-top-level, r=davidtwco

Improve the error messages for missing stability attributes

This makes the capitalisation consistent and provides more context (especially for missing top-level attributes).

5 years agoRollup merge of #58272 - fitzgen:num-format-code-size, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:31 +0000 (18:12 +0100)]
Rollup merge of #58272 - fitzgen:num-format-code-size, r=Mark-Simulacrum

Cut down on number formating code size

r? @alexcrichton

5 years agoRollup merge of #58202 - varkor:deprecated-future-external, r=GuillaumeGomez
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:30 +0000 (18:12 +0100)]
Rollup merge of #58202 - varkor:deprecated-future-external, r=GuillaumeGomez

Ignore future deprecations in #[deprecated]

The future deprecation warnings should only apply to `#[rustc_deprecated]` as they take into account rustc's version. Fixes #57952.

I've also slightly modified rustdoc's display of future deprecation notices to make it more consistent, so I'm assigning a rustdoc team member for review to make sure this is okay.

r? @GuillaumeGomez

5 years agoRollup merge of #58167 - ljedrz:HirIdify_body_id, r=Zoxc
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:28 +0000 (18:12 +0100)]
Rollup merge of #58167 - ljedrz:HirIdify_body_id, r=Zoxc

HirId-ify hir::BodyId

Another step towards https://github.com/rust-lang/rust/pull/57578.

5 years agoRollup merge of #58110 - Centril:libpanic_unwind-2018, r=oli-obk
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:12:27 +0000 (18:12 +0100)]
Rollup merge of #58110 - Centril:libpanic_unwind-2018, r=oli-obk

libpanic_unwind => 2018

Transitions `libpanic_unwind` to Rust 2018; cc #58099

r? @oli-obk

5 years agolibpanic_unwind => 2018: remove unused extern crate.
Mazdak Farrokhzad [Wed, 13 Feb 2019 17:08:53 +0000 (18:08 +0100)]
libpanic_unwind => 2018: remove unused extern crate.

5 years agolibpanic_unwind => 2018: fix ICEs.
Mazdak Farrokhzad [Tue, 12 Feb 2019 23:07:22 +0000 (00:07 +0100)]
libpanic_unwind => 2018: fix ICEs.

5 years agolibpanic_unwind => 2018
Mazdak Farrokhzad [Sat, 2 Feb 2019 18:00:02 +0000 (19:00 +0100)]
libpanic_unwind => 2018

5 years agoConvert old doc links to current edition
Lzu Tao [Wed, 23 Jan 2019 03:55:37 +0000 (03:55 +0000)]
Convert old doc links to current edition

Use footnote style to bypass the tidy check

5 years agoAuto merge of #56951 - oli-obk:auto_toolstate_issue, r=kennytm
bors [Wed, 13 Feb 2019 13:08:30 +0000 (13:08 +0000)]
Auto merge of #56951 - oli-obk:auto_toolstate_issue, r=kennytm

Automatically open an issue when a tool breaks

cc @nikomatsakis

fixes https://github.com/rust-lang-nursery/rust-toolstate/issues/6

documentation about issue opening via the github api: https://developer.github.com/v3/issues/#create-an-issue

5 years agotarget/uefi: clarify documentation
David Rheinsberg [Wed, 13 Feb 2019 10:50:09 +0000 (11:50 +0100)]
target/uefi: clarify documentation

This clarifies why FP-units are disabled on UEFI targets, as well as
why we must opt into the NXCOMPAT feature.

I did find some time to investigate why GRUB and friends disable FP on
UEFI. The specification explicitly allows using MMX/SSE/AVX, but as it
turns out it does not mandate enabling the instruction sets explicitly.
Hence, any use of these instructions will trigger CPU exceptions,
unless an application explicitly enables them (which is not an option,
as these are global flags that better be controlled by the
kernel/firmware).

Furthermore, UEFI systems are allowed to mark any non-code page as
non-executable. Hence, we must make sure to never place code on the
stack or heap. So we better pass /NXCOMPAT to the linker for it to
complain if it ever places code in non-code pages.

Lastly, this fixes some typos in related comments.

5 years agoAuto merge of #58238 - Mark-Simulacrum:doctest-fix, r=alexcrichton
bors [Wed, 13 Feb 2019 10:27:50 +0000 (10:27 +0000)]
Auto merge of #58238 - Mark-Simulacrum:doctest-fix, r=alexcrichton

Fixes rustdoc in stage 0, stage 1

When a request for rustdoc is passed for stage 0, x.py build --stage 0
src/tools/rustdoc or ensure(tool::Rustdoc { .. }) with top_stage = 0, we
return the rustdoc for that compiler (i.e., the beta rustdoc).

This fixes stage 0 of https://github.com/rust-lang/rust/issues/52186 as well as being part of general workflow improvements (making stage 0 testing for std work) for rustbuild.

The stage 1 fix (second commit) completely resolves the problem, so this fixes https://github.com/rust-lang/rust/issues/52186.

5 years agofix rebase fallout
Ralf Jung [Wed, 13 Feb 2019 10:14:40 +0000 (11:14 +0100)]
fix rebase fallout

5 years agofix whitespace
Ralf Jung [Fri, 8 Feb 2019 14:26:45 +0000 (15:26 +0100)]
fix whitespace

5 years agomake bin_op and unary_op APIs consistently work on ImmTy
Ralf Jung [Fri, 8 Feb 2019 13:00:52 +0000 (14:00 +0100)]
make bin_op and unary_op APIs consistently work on ImmTy

5 years agomake OpTy.op private, and ImmTy.imm public instead
Ralf Jung [Fri, 8 Feb 2019 11:20:55 +0000 (12:20 +0100)]
make OpTy.op private, and ImmTy.imm public instead

5 years agoHirId-ify hir::BodyId
ljedrz [Mon, 4 Feb 2019 19:01:14 +0000 (20:01 +0100)]
HirId-ify hir::BodyId

5 years agoAuto merge of #58235 - jethrogb:jb/sgx-usercall-internals, r=alexcrichton
bors [Wed, 13 Feb 2019 07:46:21 +0000 (07:46 +0000)]
Auto merge of #58235 - jethrogb:jb/sgx-usercall-internals, r=alexcrichton

SGX target: simplify usercall internals

This moves logic from assembly to Rust and removes the special case for exit/panic handling, merging it with regular usercall handling.

Also, this fixes a bug in the exit usercall introduced in a75ae00. The bug would make regular exits look like panics with high probability. It would also with some probability leak information through uncleared registers.

cc @VardhanThigle

r? @alexcrichton

5 years agoMerging master
Matthias Einwag [Wed, 13 Feb 2019 06:46:14 +0000 (22:46 -0800)]
Merging master

5 years agoAuto merge of #58415 - Centril:rollup, r=Centril
bors [Wed, 13 Feb 2019 05:14:12 +0000 (05:14 +0000)]
Auto merge of #58415 - Centril:rollup, r=Centril

Rollup of 12 pull requests

Successful merges:

 - #57693 (Doc rewording)
 - #57815 (Speed up the fast path for assert_eq! and assert_ne!)
 - #58034 (Stabilize the time_checked_add feature)
 - #58057 (Stabilize linker-plugin based LTO (aka cross-language LTO))
 - #58137 (Cleanup: rename node_id_to_type(_opt))
 - #58166 (allow shorthand syntax for deprecation reason)
 - #58200 (fix str mutating through a ptr derived from &self)
 - #58273 (Rename rustc_errors dependency in rust 2018 crates)
 - #58289 (impl iter() for dyn Error)
 - #58387 (Disallow `auto` trait alias syntax)
 - #58404 (use Ubuntu keyserver for CloudABI ports)
 - #58405 (Remove some dead code from libcore)

Failed merges:

r? @ghost

5 years agoRollup merge of #58405 - gnzlbg:remove_unused_macros, r=alexcrichton
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:37:09 +0000 (04:37 +0100)]
Rollup merge of #58405 - gnzlbg:remove_unused_macros, r=alexcrichton

Remove some dead code from libcore

These macros are not required to glue the `core_arch` crate anymore.

5 years agoRollup merge of #58404 - euclio:cloudabi-keyserver, r=alexcrichton
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:37:08 +0000 (04:37 +0100)]
Rollup merge of #58404 - euclio:cloudabi-keyserver, r=alexcrichton

use Ubuntu keyserver for CloudABI ports

The Ubuntu keyserver is more reliable than the MIT PGP server, which is
prone to going down. This commit also explicitly uses port 80 on the
keyserver for reasons outlined in #57844.

5 years agoRollup merge of #58387 - alexreg:fix-trait-alias-2, r=centril
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:37:07 +0000 (04:37 +0100)]
Rollup merge of #58387 - alexreg:fix-trait-alias-2, r=centril

Disallow `auto` trait alias syntax

See https://github.com/rust-lang/rust/issues/41517#issuecomment-462567679.

r? @Centril

CC @topecongiro @nikomatsakis

5 years agoRollup merge of #58289 - haraldh:master, r=sfackler
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:37:05 +0000 (04:37 +0100)]
Rollup merge of #58289 - haraldh:master, r=sfackler

impl iter() for dyn Error

Examples:

```rust
let next_error_type_a = err
    .iter()
    .filter_map(Error::downcast_ref::<ErrorTypeA>)
    .next();
```

```rust
let source_root_error = err.iter().last();
```

Credit for the ErrorIter goes to reddit user /u/tdiekmann (Tim Diekmann)
https://www.reddit.com/r/rust/comments/aj3lpg/is_an_iterator_impl_over_errorsource_possible/

5 years agoRollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasper
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:37:04 +0000 (04:37 +0100)]
Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasper

Rename rustc_errors dependency in rust 2018 crates

I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.

Related: rust-lang/cargo#5653

cc #58099

r? @Centril

5 years agoRollup merge of #58200 - RalfJung:str-as-mut-ptr, r=SimonSapin
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:37:03 +0000 (04:37 +0100)]
Rollup merge of #58200 - RalfJung:str-as-mut-ptr, r=SimonSapin

fix str mutating through a ptr derived from &self

Found by Miri: In `get_unchecked_mut` (also used by the checked variants internally) uses `str::as_ptr` to create a mutable reference, but `as_ptr` takes `&self`.  This means the mutable references we return here got created from a shared reference, which violates the shared-references-are-read-only discipline!

For this by using a newly introduced `as_mut_ptr` instead.

5 years agoRollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkov
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:37:02 +0000 (04:37 +0100)]
Rollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkov

allow shorthand syntax for deprecation reason

Fixes #48271.

Created based on discussion in #56896.

5 years agoRollup merge of #58137 - ljedrz:cleanup_node_id_to_type, r=estebank
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:37:00 +0000 (04:37 +0100)]
Rollup merge of #58137 - ljedrz:cleanup_node_id_to_type, r=estebank

Cleanup: rename node_id_to_type(_opt)

Renames `node_id_to_type(_opt)` to `hir_id_to_type(_opt)`; this makes it clear we are dealing with HIR nodes and their IDs here.

In addition, a drive-by commit removing `ty::item_path::hir_path_str` (as requested by @eddyb).

5 years agoRollup merge of #58057 - michaelwoerister:stabilize-xlto, r=alexcrichton
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:36:59 +0000 (04:36 +0100)]
Rollup merge of #58057 - michaelwoerister:stabilize-xlto, r=alexcrichton

Stabilize linker-plugin based LTO (aka cross-language LTO)

This PR stabilizes [linker plugin based LTO](https://github.com/rust-lang/rust/issues/49879), also known as "cross-language LTO" because it allows for doing inlining and other optimizations across language boundaries in mixed Rust/C/C++ projects.

As described in the tracking issue, it works by making `rustc` emit LLVM bitcode instead of machine code, the same as `clang` does. A linker with the proper plugin (like LLD) can then run (Thin)LTO across all modules.

The feature has been implemented over a number of pull requests and there are various [codegen](https://github.com/rust-lang/rust/blob/master/src/test/codegen/no-dllimport-w-cross-lang-lto.rs) and [run](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-clang)-[make](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs) [tests](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto) that make sure that it keeps working.

It also works for building big projects like [Firefox](https://treeherder.mozilla.org/#/jobs?repo=try&revision=2ce2d5ddcea6fbff790503eac406954e469b2f5d).

The PR makes the feature available under the `-C linker-plugin-lto` flag. As discussed in the tracking issue it is not cross-language specific and also not LLD specific. `-C linker-plugin-lto` is descriptive of what it does. If someone has a better name, let me know `:)`

5 years agoRollup merge of #58034 - faern:stabilize-time-checked-add, r=alexcrichton
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:36:58 +0000 (04:36 +0100)]
Rollup merge of #58034 - faern:stabilize-time-checked-add, r=alexcrichton

Stabilize the time_checked_add feature

Closes #55940

Stabilizes `checked_add` and `checked_sub` on `Instant` and `SystemTime`.

5 years agoRollup merge of #57815 - dotdash:asserts, r=sfackler
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:36:56 +0000 (04:36 +0100)]
Rollup merge of #57815 - dotdash:asserts, r=sfackler

Speed up the fast path for assert_eq! and assert_ne!

Currently, the panic!() calls directly borrow the value bindings. This
causes those bindings to always be initialized, i.e. they're initialized
even before the values are even compared. This causes noticeable
overhead in what should be a really cheap operation.

By performing a reborrow of the value in the call to panic!(), we allow
LLVM to optimize that code, so that the extra borrow only happens in the
error case.

We could achieve the same result by dereferencing the values passed to
panic!(), as the format machinery borrows them anyway, but this causes
assertions to fail to compile if one of the values is unsized, i.e. it
would be a breaking change.

5 years agoRollup merge of #57693 - king6cong:word, r=Centril
Mazdak Farrokhzad [Wed, 13 Feb 2019 03:36:55 +0000 (04:36 +0100)]
Rollup merge of #57693 - king6cong:word, r=Centril

Doc rewording

None

5 years agoAuto merge of #58051 - SimonSapin:str_escape, r=alexcrichton
bors [Tue, 12 Feb 2019 23:30:16 +0000 (23:30 +0000)]
Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichton

Stabilize str::escape_* methods with new return types…

… that implement `Display` and `Iterator<Item=char>`, as proposed in FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727

5 years agoAuto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
bors [Tue, 12 Feb 2019 19:09:24 +0000 (19:09 +0000)]
Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik

Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!

5 years agoCheck user type annotations for range patterns.
David Wood [Mon, 11 Feb 2019 11:18:40 +0000 (12:18 +0100)]
Check user type annotations for range patterns.

This commit builds on the fix from #58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).

5 years agoFix some rebasing fallout regarding xLTO.
Michael Woerister [Tue, 12 Feb 2019 16:17:05 +0000 (17:17 +0100)]
Fix some rebasing fallout regarding xLTO.

5 years agoAdd riscv64gc-unknown-none-elf target
Vadim Kaushan [Tue, 12 Feb 2019 16:15:00 +0000 (19:15 +0300)]
Add riscv64gc-unknown-none-elf target

5 years agoAdd riscv64imac-unknown-none-elf target
Vadim Kaushan [Tue, 12 Feb 2019 16:05:41 +0000 (19:05 +0300)]
Add riscv64imac-unknown-none-elf target

5 years agoUpdate LLVM: apply patches for RISC-V 64-bit support
Vadim Kaushan [Tue, 12 Feb 2019 15:58:06 +0000 (18:58 +0300)]
Update LLVM: apply patches for RISC-V 64-bit support

5 years agoFix rebase fail
Taiki Endo [Sun, 10 Feb 2019 06:27:59 +0000 (15:27 +0900)]
Fix rebase fail

5 years agoCleanup imports
Taiki Endo [Sat, 9 Feb 2019 02:24:02 +0000 (11:24 +0900)]
Cleanup imports

5 years agoRename rustc_errors dependency in rust 2018 crates
Taiki Endo [Thu, 7 Feb 2019 15:56:05 +0000 (00:56 +0900)]
Rename rustc_errors dependency in rust 2018 crates

5 years agoFix rustc_driver swallowing errors when compilation is stopped
gnzlbg [Tue, 12 Feb 2019 10:40:36 +0000 (11:40 +0100)]
Fix rustc_driver swallowing errors when compilation is stopped

5 years agoRemove some dead code from libcore
gnzlbg [Tue, 12 Feb 2019 15:11:27 +0000 (16:11 +0100)]
Remove some dead code from libcore

These macros are not required to glue the `core_arch` crate anymore.

5 years agoAdd documentation about -Clinker-plugin-lto to rustc book.
Michael Woerister [Tue, 12 Feb 2019 14:07:04 +0000 (15:07 +0100)]
Add documentation about -Clinker-plugin-lto to rustc book.

5 years agouse Ubuntu keyserver for CloudABI ports
Andy Russell [Tue, 12 Feb 2019 04:50:31 +0000 (23:50 -0500)]
use Ubuntu keyserver for CloudABI ports

The Ubuntu keyserver is more reliable than the MIT PGP server, which is
prone to going down. This commit also explicitly uses port 80 on the
keyserver for reasons outlined in #57844.

5 years agoAdded tests.
Alexander Regueiro [Tue, 12 Feb 2019 01:50:45 +0000 (01:50 +0000)]
Added tests.

5 years agoStabilize linker-plugin based LTO.
Michael Woerister [Fri, 1 Feb 2019 14:15:43 +0000 (15:15 +0100)]
Stabilize linker-plugin based LTO.

5 years agoPermit issue posting to have network failures
Oliver Scherer [Tue, 12 Feb 2019 13:48:53 +0000 (14:48 +0100)]
Permit issue posting to have network failures

5 years agorustc: Implement incremental "fat" LTO
Alex Crichton [Mon, 11 Feb 2019 15:46:04 +0000 (07:46 -0800)]
rustc: Implement incremental "fat" LTO

Currently the compiler will produce an error if both incremental
compilation and full fat LTO is requested. With recent changes and the
advent of incremental ThinLTO, however, all the hard work is already
done for us and it's actually not too bad to remove this error!

This commit updates the codegen backend to allow incremental full fat
LTO. The semantics are that the input modules to LTO are all produce
incrementally, but the final LTO step is always done unconditionally
regardless of whether the inputs changed or not. The only real
incremental win we could have here is if zero of the input modules
changed, but that's so rare it's unlikely to be worthwhile to implement
such a code path.

cc #57968
cc rust-lang/cargo#6643

5 years agoAuto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkov
bors [Tue, 12 Feb 2019 12:10:10 +0000 (12:10 +0000)]
Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkov

Require a list of features in `#[allow_internal_unstable]`

The blanket-permission slip is not great and will likely give us trouble some point down the road.

5 years agoAdd doctests for str::escape_*
Simon Sapin [Sat, 2 Feb 2019 10:25:46 +0000 (11:25 +0100)]
Add doctests for str::escape_*