]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #58438 - cuviper:posix_spawn_file_actions_addchdir_np, r=alexcrichton
kennytm [Fri, 15 Feb 2019 16:55:56 +0000 (00:55 +0800)]
Rollup merge of #58438 - cuviper:posix_spawn_file_actions_addchdir_np, r=alexcrichton

Use posix_spawn_file_actions_addchdir_np when possible

This is a non-POSIX extension implemented in Solaris and in glibc 2.29.
With this we can still use `posix_spawn()` when `Command::current_dir()`
has been set, otherwise we fallback to `fork(); chdir(); exec()`.

5 years agoRollup merge of #58433 - RalfJung:miri-mark-tests, r=TimNN
kennytm [Fri, 15 Feb 2019 16:55:55 +0000 (00:55 +0800)]
Rollup merge of #58433 - RalfJung:miri-mark-tests, r=TimNN

Update which libcore/liballoc tests Miri ignores, and document why

5 years agoRollup merge of #58429 - RalfJung:box, r=TimNN
kennytm [Fri, 15 Feb 2019 16:55:54 +0000 (00:55 +0800)]
Rollup merge of #58429 - RalfJung:box, r=TimNN

fix Box::into_unique effecitvely transmuting to a raw ptr

Miri/Stacked Borrows treat `Box` specially: they assert that it is unique, and tag it appropriately. However, currently, `Box::into_inner` is not aware of that and returns a raw pointer (wrapped in a `Unique`) that carries the same tag as the box, meaning it carries a `Uniq` tag. This leads to all sorts of problems when people use the raw pointer they get out of the `Unique` type.

In the future, it'd be interesting to make `Unique` also carry some kind of uniqueness. In that case, something like this would instead be needed whenever a raw pointer is extracted from a `Unique`. However, that is out-of-scope for the current version of Stacked Borrows. So until then, this changes `into_unique` to perform a proper reference-to-raw-ptr-cast, which clears the tag.

5 years agoRollup merge of #58359 - taiki-e:impl_snapshot_for, r=oli-obk
kennytm [Fri, 15 Feb 2019 16:55:53 +0000 (00:55 +0800)]
Rollup merge of #58359 - taiki-e:impl_snapshot_for, r=oli-obk

librustc_mir: use ? in impl_snapshot_for! macro

5 years agoRollup merge of #58306 - GuillaumeGomez:crate-browser-history, r=QuietMisdreavus
kennytm [Fri, 15 Feb 2019 16:55:51 +0000 (00:55 +0800)]
Rollup merge of #58306 - GuillaumeGomez:crate-browser-history, r=QuietMisdreavus

Don't default on std crate when manipulating browser history

Fixes #58263.

r? @QuietMisdreavus

5 years agoRollup merge of #58293 - xfix:patch-16, r=Mark-Simulacrum
kennytm [Fri, 15 Feb 2019 16:55:50 +0000 (00:55 +0800)]
Rollup merge of #58293 - xfix:patch-16, r=Mark-Simulacrum

Remove code for updating copyright years in generate-deriving-span-tests

It's no longer necessary, as there is no license header anymore.

5 years agoRollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obk
kennytm [Fri, 15 Feb 2019 16:55:49 +0000 (00:55 +0800)]
Rollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obk

Add specific feature gate error for const-unstable features

Before:
```
error: `impl Trait` in const fn is unstable
 --> src/lib.rs:7:19
  |
7 | const fn foo() -> impl T {
  |                   ^^^^^^

error: aborting due to previous error
```

After:
```
error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
 --> src/lib.rs:7:19
  |
7 | const fn foo() -> impl T {
  |                   ^^^^^^
  = help: add #![feature(const_fn)] to the crate attributes to enable

error: aborting due to previous error
```

This improves the situation with https://github.com/rust-lang/rust/issues/57563. Fixes https://github.com/rust-lang/rust/issues/57544. Fixes https://github.com/rust-lang/rust/issues/54469.

r? @oli-obk

5 years agoRollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapin
kennytm [Fri, 15 Feb 2019 16:55:47 +0000 (00:55 +0800)]
Rollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapin

Stabilize slice_sort_by_cached_key

I was going to ask on the tracking issue (https://github.com/rust-lang/rust/issues/34447), but decided to just send this and hope for an FCP here.  The method was added last March by https://github.com/rust-lang/rust/pull/48639.

Signature: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key
```rust
impl [T] {
    pub fn sort_by_cached_key<K, F>(&mut self, f: F)
        where F: FnMut(&T) -> K, K: Ord;
}
```

That's an identical signature to the existing `sort_by_key`, so I think the questions are just naming, implementation, and the usual "do we want this?".

The implementation seems to have proven its use in rustc at least, which many uses: https://github.com/rust-lang/rust/search?l=Rust&q=sort_by_cached_key

(I'm asking because it's exactly what I just needed the other day:
```rust
    all_positions.sort_by_cached_key(|&n|
        data::CITIES.iter()
            .map(|x| *metric_closure.get_edge(n, x.pos).unwrap())
            .sum::<usize>()
    );
```
since caching that key is a pretty obviously good idea.)

Closes #34447

5 years agoRollup merge of #57981 - Zoxc:fix-57979, r=nikomatsakis
kennytm [Fri, 15 Feb 2019 16:55:46 +0000 (00:55 +0800)]
Rollup merge of #57981 - Zoxc:fix-57979, r=nikomatsakis

Fix #57730

cc https://github.com/rust-lang/rust/pull/57730

r? @cramertj

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 agoAdd updated NLL tests
varkor [Thu, 14 Feb 2019 15:47:37 +0000 (15:47 +0000)]
Add updated NLL tests

5 years agoadd .stderr file
Niko Matsakis [Thu, 14 Feb 2019 15:26:02 +0000 (10:26 -0500)]
add .stderr file

5 years agoFix documentation typo
varkor [Tue, 5 Feb 2019 21:03:01 +0000 (22:03 +0100)]
Fix documentation typo

5 years agoUpdate const fn tests
varkor [Tue, 5 Feb 2019 20:27:44 +0000 (21:27 +0100)]
Update const fn tests

5 years agoAdd specific error for unstable const fn features
varkor [Tue, 5 Feb 2019 20:27:26 +0000 (21:27 +0100)]
Add specific error for unstable const fn features

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 agoUse posix_spawn_file_actions_addchdir_np when possible
Josh Stone [Wed, 13 Feb 2019 20:20:23 +0000 (12:20 -0800)]
Use posix_spawn_file_actions_addchdir_np when possible

This is a non-POSIX extension implemented in Solaris and in glibc 2.29.
With this we can still use `posix_spawn()` when `Command::current_dir()`
has been set, otherwise we fallback to `fork(); chdir(); exec()`.

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 agomiri: test with slightly larger BTrees
Ralf Jung [Wed, 13 Feb 2019 17:11:57 +0000 (18:11 +0100)]
miri: test with slightly larger BTrees

5 years agoreview failures in heap, slice, vec
Ralf Jung [Wed, 13 Feb 2019 16:49:11 +0000 (17:49 +0100)]
review failures in heap, slice, vec

5 years agoreview failures in btree, string
Ralf Jung [Wed, 13 Feb 2019 16:18:47 +0000 (17:18 +0100)]
review failures in btree, string

5 years agoreview failures in binary_heap, str, vec_deque
Ralf Jung [Wed, 13 Feb 2019 12:59:51 +0000 (13:59 +0100)]
review failures in binary_heap, str, vec_deque

5 years agothe formatting issue got fixed
Ralf Jung [Wed, 13 Feb 2019 12:25:46 +0000 (13:25 +0100)]
the formatting issue got fixed

5 years agoreview or fix remaining miri failures in libcore
Ralf Jung [Sat, 9 Feb 2019 15:19:21 +0000 (16:19 +0100)]
review or fix remaining miri failures in libcore

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 agoreview or fix miri failures in iter, slice, cell, time
Ralf Jung [Sat, 9 Feb 2019 12:16:23 +0000 (13:16 +0100)]
review or fix miri failures in iter, slice, cell, time

5 years agomark failures expected due to panics
Ralf Jung [Sat, 9 Feb 2019 10:32:09 +0000 (11:32 +0100)]
mark failures expected due to panics

5 years agofix Box::into_unique effecitvely transmuting to a raw ptr
Ralf Jung [Wed, 13 Feb 2019 15:26:13 +0000 (16:26 +0100)]
fix Box::into_unique effecitvely transmuting to a raw ptr

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 agoRevert "Remove mentions of unstable sort_by_cached key from stable documentation"
Scott McMurray [Sat, 2 Feb 2019 09:32:56 +0000 (01:32 -0800)]
Revert "Remove mentions of unstable sort_by_cached key from stable documentation"

This reverts commit 9c7b69e17909ceb090a1c4b8882a4e0924a2a755.

5 years agoStabilize slice_sort_by_cached_key
Scott McMurray [Thu, 31 Jan 2019 20:47:31 +0000 (12:47 -0800)]
Stabilize slice_sort_by_cached_key

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