]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoSGX target: improve panic & exit handling
Jethro Beekman [Tue, 29 Jan 2019 11:40:22 +0000 (17:10 +0530)]
SGX target: improve panic & exit handling

5 years agoAuto merge of #57957 - Centril:rollup, r=Centril
bors [Tue, 29 Jan 2019 05:22:51 +0000 (05:22 +0000)]
Auto merge of #57957 - Centril:rollup, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #57045 (Kill remaining uses of mem::uninitialized in libcore, liballoc)
 - #57674 (Avoid erase_regions_ty queries if there are no regions to erase)
 - #57833 (Print a slightly clearer message when failing to launch a thread)
 - #57859 (Fix invalid background color)
 - #57904 (add typo suggestion to unknown attribute error)
 - #57915 (Pretty print `$crate` as `crate` or `crate_name` in more cases)
 - #57950 (Extend E0106, E0261)

Failed merges:

r? @ghost

5 years agoRollup merge of #57950 - QuietMisdreavus:lifetime-err-desc, r=estebank
Mazdak Farrokhzad [Mon, 28 Jan 2019 21:25:49 +0000 (22:25 +0100)]
Rollup merge of #57950 - QuietMisdreavus:lifetime-err-desc, r=estebank

Extend E0106, E0261

This is a reopening of https://github.com/rust-lang/rust/pull/57310 with review comments addressed because the original author has since deleted their fork.

From the author (@purple-ice):

> Added an example that points out hardly obvious mistake one could make when writing impl for a new type.

r? @rust-lang/docs

5 years agoRollup merge of #57915 - petrochenkov:notto-disu, r=zackmdavis
Mazdak Farrokhzad [Mon, 28 Jan 2019 21:25:48 +0000 (22:25 +0100)]
Rollup merge of #57915 - petrochenkov:notto-disu, r=zackmdavis

Pretty print `$crate` as `crate` or `crate_name` in more cases

So, people do parse output of `--pretty=expanded` (sigh), so covering only the legacy proc-macro case (like it was done in https://github.com/rust-lang/rust/pull/57155) is not enough.

This PRs resolves all `$crate`s produced by macros, so they are all printed in the parseable form `$crate::foo` -> `crate::foo` or `crate_name::foo`.

Fixes https://github.com/rust-lang/rust/issues/38016#issuecomment-455851334
Fixes https://github.com/rust-lang/rust/pull/57155#issuecomment-455807195

5 years agoRollup merge of #57904 - euclio:attribute-typos, r=davidtwco
Mazdak Farrokhzad [Mon, 28 Jan 2019 21:25:47 +0000 (22:25 +0100)]
Rollup merge of #57904 - euclio:attribute-typos, r=davidtwco

add typo suggestion to unknown attribute error

Provides a suggestion using Levenshtein distance to suggest built-in attributes and attribute macros.

Fixes #49270.

5 years agoRollup merge of #57859 - GuillaumeGomez:fix-background, r=QuietMisdreavus
Mazdak Farrokhzad [Mon, 28 Jan 2019 21:25:45 +0000 (22:25 +0100)]
Rollup merge of #57859 - GuillaumeGomez:fix-background, r=QuietMisdreavus

Fix invalid background color

As discussed in #57814.

r? @QuietMisdreavus

5 years agoRollup merge of #57833 - jethrogb:jb/thread-spawn-unwrap, r=alexcrichton
Mazdak Farrokhzad [Mon, 28 Jan 2019 21:25:44 +0000 (22:25 +0100)]
Rollup merge of #57833 - jethrogb:jb/thread-spawn-unwrap, r=alexcrichton

Print a slightly clearer message when failing to launch a thread

As discussed in #46345, the `io::Error` you get when a thread fails to launch is of type `io::ErrorKind::WouldBlock`. This is super uninformative when an arbitrary `thread::spawn` fails somewhere in your code:

```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 11,
kind: WouldBlock, message: "operation would block" }', src/libcore/result.rs:997:5
```

This PR improves the situation a little bit by using `expect` instead of `unwrap`. I don't consider this a complete fix for #46345 though.

5 years agoRollup merge of #57674 - dotdash:erase_reg, r=varkor
Mazdak Farrokhzad [Mon, 28 Jan 2019 21:25:42 +0000 (22:25 +0100)]
Rollup merge of #57674 - dotdash:erase_reg, r=varkor

Avoid erase_regions_ty queries if there are no regions to erase

It's overall faster to perform this extra check than to perform the
query, even if the result is already in the query cache.

5 years agoRollup merge of #57045 - RalfJung:kill-more-uninit, r=SimonSapin
Mazdak Farrokhzad [Mon, 28 Jan 2019 21:25:41 +0000 (22:25 +0100)]
Rollup merge of #57045 - RalfJung:kill-more-uninit, r=SimonSapin

Kill remaining uses of mem::uninitialized in libcore, liballoc

Kill remaining uses of mem::uninitialized in libcore and liballoc, and enable a lint that will warn when uses are added again in the future.

To avoid casting raw pointers around (which is always very dangerous because it is not typechecked at all -- it doesn't even get the "same size" sanity check that `transmute` gets), I also added two new functions to `MaybeUninit`:

```rust
    /// Get a pointer to the first contained values.
    pub fn first_ptr(this: &[MaybeUninit<T>]) -> *const T {
        this as *const [MaybeUninit<T>] as *const T
    }

    /// Get a mutable pointer to the first contained values.
    pub fn first_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T {
        this as *mut [MaybeUninit<T>] as *mut T
    }
```

I changed some of the existing code to use array-of-`MaybeUninit` instead of `MaybeUninit`-of-array, successfully removing raw pointer casts there as well.

5 years agofix gdb debug printing
Ralf Jung [Mon, 28 Jan 2019 16:33:29 +0000 (17:33 +0100)]
fix gdb debug printing

5 years agoreview comments
QuietMisdreavus [Mon, 28 Jan 2019 15:30:43 +0000 (09:30 -0600)]
review comments

5 years agoAuto merge of #55704 - Nemo157:pinned-generators, r=Zoxc
bors [Mon, 28 Jan 2019 14:12:15 +0000 (14:12 +0000)]
Auto merge of #55704 - Nemo157:pinned-generators, r=Zoxc

Use pinning for generators to make trait safe

I'm unsure whether there needs to be any changes to the actual generator transform. Tests are passing so the fact that `Pin<&mut T>` is fundamentally the same as `&mut T` seems to allow it to still work, but maybe there's something subtle here that could go wrong.

This is specified in [RFC 2349 § Immovable generators](https://github.com/rust-lang/rfcs/blob/master/text/2349-pin.md#immovable-generators) (although, since that RFC it has become safe to create an immovable generator, and instead it's unsafe to resume any generator; with these changes both are now safe and instead the unsafety is moved to creating a `Pin<&mut [static generator]>` which there are safe APIs for).

CC #43122

5 years agorename first_mut_ptr -> first_ptr_mut
Ralf Jung [Mon, 28 Jan 2019 11:37:29 +0000 (12:37 +0100)]
rename first_mut_ptr -> first_ptr_mut

5 years agofix typos, improve docs
Ralf Jung [Mon, 28 Jan 2019 10:04:30 +0000 (11:04 +0100)]
fix typos, improve docs

5 years agoAuto merge of #57899 - davidtwco:issue-56685, r=estebank
bors [Mon, 28 Jan 2019 09:52:31 +0000 (09:52 +0000)]
Auto merge of #57899 - davidtwco:issue-56685, r=estebank

Unused variable suggestions apply on all patterns.

Fixes #56685.

This PR extends existing suggestions to prefix unused variable bindings in match arms with an underscore so that it applies to all patterns in a match arm.

r? @estebank
cc @alexcrichton (since you filed the issue)

5 years agoUse warn() for extra diagnostics; with -D warnings this leads to errors
Ralf Jung [Mon, 28 Jan 2019 09:49:11 +0000 (10:49 +0100)]
Use warn() for extra diagnostics; with -D warnings this leads to errors

This is needed to properly respect "deny_warnings = false" in config.toml

5 years agoadd macro for creating uninitialized array
Ralf Jung [Sat, 22 Dec 2018 10:02:06 +0000 (11:02 +0100)]
add macro for creating uninitialized array

5 years agoavoid some raw ptr casts in BTreeMap
Ralf Jung [Fri, 21 Dec 2018 14:10:19 +0000 (15:10 +0100)]
avoid some raw ptr casts in BTreeMap

5 years agoavoid mem::uninitialized in BTreeMap
Ralf Jung [Fri, 21 Dec 2018 10:22:18 +0000 (11:22 +0100)]
avoid mem::uninitialized in BTreeMap

5 years agoUnused variable suggestions on all patterns.
David Wood [Fri, 25 Jan 2019 15:56:27 +0000 (16:56 +0100)]
Unused variable suggestions on all patterns.

This commit extends existing suggestions to prefix unused variable
bindings in match arms with an underscore so that it applies to all
patterns in a match arm.

5 years agolibcore: avoid mem::uninitialized and raw ptr casts
Ralf Jung [Fri, 21 Dec 2018 10:08:26 +0000 (11:08 +0100)]
libcore: avoid mem::uninitialized and raw ptr casts

5 years agoliballoc: remove unneeded allow(deprecated)
Ralf Jung [Thu, 20 Dec 2018 21:51:08 +0000 (22:51 +0100)]
liballoc: remove unneeded allow(deprecated)

5 years agolibcore: remove unneeded allow(deprecated)
Ralf Jung [Thu, 20 Dec 2018 21:49:32 +0000 (22:49 +0100)]
libcore: remove unneeded allow(deprecated)

5 years agoAuto merge of #57691 - Zoxc:pass-skip, r=petrochenkov
bors [Mon, 28 Jan 2019 06:32:39 +0000 (06:32 +0000)]
Auto merge of #57691 - Zoxc:pass-skip, r=petrochenkov

Conditionally skip two passes if their related attributes were not found

5 years agoConditionally skip two passes if their related attributes were not found
John Kåre Alsaker [Thu, 17 Jan 2019 06:28:39 +0000 (07:28 +0100)]
Conditionally skip two passes if their related attributes were not found

5 years agoAuto merge of #57910 - Mark-Simulacrum:delete-test, r=petrochenkov
bors [Mon, 28 Jan 2019 03:46:25 +0000 (03:46 +0000)]
Auto merge of #57910 - Mark-Simulacrum:delete-test, r=petrochenkov

Delete long-ignored and useless test

cc @pnkfelix (https://github.com/rust-lang/rust/issues/13745#issuecomment-457599109)

r? @petrochenkov as you re-enabled this test in 21d67c45a3d032b3f0d421e6f882f11ea43d1f9c, https://github.com/rust-lang/rust/pull/55236

5 years agoadd typo suggestion to unknown attribute error
Andy Russell [Fri, 25 Jan 2019 19:29:47 +0000 (14:29 -0500)]
add typo suggestion to unknown attribute error

5 years agoAuto merge of #57442 - oli-obk:lazy_const, r=RalfJung
bors [Mon, 28 Jan 2019 00:46:07 +0000 (00:46 +0000)]
Auto merge of #57442 - oli-obk:lazy_const, r=RalfJung

Simplify `ConstValue::ScalarPair`

While looking at #57432 I realized that some of our types for representing constants are very big. This reduces `LazyConst` to 3/4th of its original size and simplifies some code around slices at the same time.

r? @RalfJung

5 years agoMark non-static generators as always Unpin
Wim Looman [Wed, 21 Nov 2018 14:32:51 +0000 (15:32 +0100)]
Mark non-static generators as always Unpin

5 years agoTemporary workaround for travis diagnostic difference
Wim Looman [Wed, 7 Nov 2018 18:01:35 +0000 (19:01 +0100)]
Temporary workaround for travis diagnostic difference

5 years agoUpdate generator upvar debug info
Wim Looman [Wed, 7 Nov 2018 09:33:35 +0000 (10:33 +0100)]
Update generator upvar debug info

5 years agoUpdate generator transform and generated function signature
Wim Looman [Tue, 6 Nov 2018 23:11:58 +0000 (00:11 +0100)]
Update generator transform and generated function signature

5 years agoimpl Generator for Pin<Box<Generator>>
Wim Looman [Tue, 6 Nov 2018 18:47:18 +0000 (19:47 +0100)]
impl Generator for Pin<Box<Generator>>

5 years agoMark static generators as !Unpin
Wim Looman [Sun, 4 Nov 2018 21:07:55 +0000 (22:07 +0100)]
Mark static generators as !Unpin

5 years agoChange generator trait to use pinning
Wim Looman [Thu, 4 Oct 2018 18:49:38 +0000 (20:49 +0200)]
Change generator trait to use pinning

5 years agoAuto merge of #56932 - clarcharr:iter_refactor, r=Centril
bors [Sun, 27 Jan 2019 20:50:17 +0000 (20:50 +0000)]
Auto merge of #56932 - clarcharr:iter_refactor, r=Centril

Refactor core::iter module

A while back, I refactored `core::ops` in #42523 because the module had become a giant mess and was difficult to modify. Now, I'm doing the same with the `core::iter` module.

Like the `core::ops` refactor, things have been split up into multiple commits to make rebasing easier, and so that you can follow changes. Although the diffs are hard to decipher, the only actual code changes I've made in the first few commits are to modify exports and imports. I save all of the actual code refactoring, e.g. modifying what methods are called, for the end.

5 years ago`ConstValue::ScalarPair` only needs to represent slices
Oliver Scherer [Tue, 8 Jan 2019 12:49:37 +0000 (13:49 +0100)]
`ConstValue::ScalarPair` only needs to represent slices

5 years agoAdd some size assertions for const eval types
Oliver Scherer [Tue, 8 Jan 2019 11:40:25 +0000 (12:40 +0100)]
Add some size assertions for const eval types

5 years agoFix indentation
Oliver Scherer [Tue, 8 Jan 2019 08:25:06 +0000 (09:25 +0100)]
Fix indentation

5 years agoAuto merge of #57765 - Mark-Simulacrum:bootstrap-bump, r=alexcrichton
bors [Sun, 27 Jan 2019 18:18:17 +0000 (18:18 +0000)]
Auto merge of #57765 - Mark-Simulacrum:bootstrap-bump, r=alexcrichton

Bump bootstrap compiler to 1.33 beta

r? @alexcrichton or @pietroalbini

cc @rust-lang/release

5 years agoUpdate comment in test which has changed its purpose
Mark Rousskov [Sat, 26 Jan 2019 01:44:50 +0000 (18:44 -0700)]
Update comment in test which has changed its purpose

5 years agoUpdate cargo to fix deprecation warnings
Mark Rousskov [Sun, 27 Jan 2019 15:43:30 +0000 (08:43 -0700)]
Update cargo to fix deprecation warnings

Implemented in rust-lang/cargo#6600

5 years agoAuto merge of #57826 - danielhenrymantilla:master, r=Centril
bors [Sun, 27 Jan 2019 15:33:45 +0000 (15:33 +0000)]
Auto merge of #57826 - danielhenrymantilla:master, r=Centril

Fixed Deref coercion explanation for DerefMut using shared references

5 years agoAuto merge of #57927 - Alexendoo:mem-drop-nll-docs, r=Centril
bors [Sun, 27 Jan 2019 09:19:00 +0000 (09:19 +0000)]
Auto merge of #57927 - Alexendoo:mem-drop-nll-docs, r=Centril

Remove lexical scope examples from std::mem::drop

The example no longer produces an error in the 2018 edition

5 years agoAuto merge of #57907 - euclio:applicability-rename, r=estebank
bors [Sun, 27 Jan 2019 06:35:51 +0000 (06:35 +0000)]
Auto merge of #57907 - euclio:applicability-rename, r=estebank

remove deprecated suggestion functions

This PR removes the (now unused) deprecated suggestion functions and removes `_with_applicability` from their replacements' names.

This PR will break clippy, but I'll open a clippy PR once this is merged.

5 years agoremove `_with_applicability` from suggestion fns
Andy Russell [Fri, 25 Jan 2019 21:03:27 +0000 (16:03 -0500)]
remove `_with_applicability` from suggestion fns

5 years agodocument `Applicability`
Andy Russell [Fri, 25 Jan 2019 19:56:27 +0000 (14:56 -0500)]
document `Applicability`

5 years agoAuto merge of #57925 - fintelia:riscv-cas, r=nagisa
bors [Sun, 27 Jan 2019 03:57:54 +0000 (03:57 +0000)]
Auto merge of #57925 - fintelia:riscv-cas, r=nagisa

Enable RISC-V atomic compare and swap

Fixes #56564

5 years agoAuto merge of #57871 - Mark-Simulacrum:fix-compiletest-stamp, r=oli-obk
bors [Sun, 27 Jan 2019 00:07:53 +0000 (00:07 +0000)]
Auto merge of #57871 - Mark-Simulacrum:fix-compiletest-stamp, r=oli-obk

Correctly set filetime for copied LLVM

This also makes compiletest no longer always retest everything.

Fixes #57864

5 years agoReplace deprecated ATOMIC_INIT consts
Mark Rousskov [Sat, 26 Jan 2019 16:14:49 +0000 (09:14 -0700)]
Replace deprecated ATOMIC_INIT consts

5 years agoRemove lexical scope examples from std::mem::drop
Alex Macleod [Sat, 26 Jan 2019 21:52:20 +0000 (21:52 +0000)]
Remove lexical scope examples from std::mem::drop

The example no longer produces an error in the 2018 edition

5 years agoEnable RISC-V atomic compare and swap
Jonathan Behrens [Sat, 26 Jan 2019 21:42:42 +0000 (16:42 -0500)]
Enable RISC-V atomic compare and swap

5 years agoAuto merge of #57918 - Centril:rollup, r=Centril
bors [Sat, 26 Jan 2019 18:14:46 +0000 (18:14 +0000)]
Auto merge of #57918 - Centril:rollup, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #57407 (Stabilize extern_crate_self)
 - #57703 (Make MutexGuard's Debug implementation more useful.)
 - #57764 (Fix some minor warnings)
 - #57825 (un-deprecate mem::zeroed)
 - #57827 (Ignore aarch64 in simd-intrinsic-generic-reduction)
 - #57908 (resolve: Fix span arithmetics in the import conflict error)
 - #57913 (Change crate-visibility-modifier issue number in The Unstable Book)

Failed merges:

r? @ghost

5 years agoRollup merge of #57913 - h-michael:fix-crate-visibility-modifier-issue-number, r...
Mazdak Farrokhzad [Sat, 26 Jan 2019 17:21:49 +0000 (18:21 +0100)]
Rollup merge of #57913 - h-michael:fix-crate-visibility-modifier-issue-number, r=Centril

Change crate-visibility-modifier issue number in The Unstable Book

#45388 is closed.
Because, it's duplicate issue of #53120.

5 years agoRollup merge of #57908 - petrochenkov:errepice, r=estebank
Mazdak Farrokhzad [Sat, 26 Jan 2019 17:21:47 +0000 (18:21 +0100)]
Rollup merge of #57908 - petrochenkov:errepice, r=estebank

resolve: Fix span arithmetics in the import conflict error

https://github.com/rust-lang/rust/pull/56937 rebased and fixed

Fixes https://github.com/rust-lang/rust/issues/56411
Fixes https://github.com/rust-lang/rust/issues/57071
Fixes https://github.com/rust-lang/rust/issues/57787

r? @estebank

5 years agoRollup merge of #57827 - parched:ignore, r=nikomatsakis
Mazdak Farrokhzad [Sat, 26 Jan 2019 17:21:46 +0000 (18:21 +0100)]
Rollup merge of #57827 - parched:ignore, r=nikomatsakis

Ignore aarch64 in simd-intrinsic-generic-reduction

This fails on AArch64 see https://github.com/rust-lang/rust/issues/54510

Disabling it for now until it's fixed/implemented in LLVM

cc @gnzlbg

5 years agoRollup merge of #57825 - RalfJung:zeroed, r=nikomatsakis
Mazdak Farrokhzad [Sat, 26 Jan 2019 17:21:45 +0000 (18:21 +0100)]
Rollup merge of #57825 - RalfJung:zeroed, r=nikomatsakis

un-deprecate mem::zeroed

as per the discussion around <https://github.com/rust-lang/rust/issues/53491#issuecomment-451454793>

5 years agoRollup merge of #57764 - Xanewok:tiny-tweaks, r=nikomatsakis
Mazdak Farrokhzad [Sat, 26 Jan 2019 17:21:44 +0000 (18:21 +0100)]
Rollup merge of #57764 - Xanewok:tiny-tweaks, r=nikomatsakis

Fix some minor warnings

Since apparently RLS works when initialized in the root repository (:tada:) I decided to fix some of the issues it caught.

There are a lot of unused attribute warnings left on `rustc_on_unimplemented` and `rustc_layout_scalar_valid_range_start` but I imagine we can't do much about it due to 2-stage compilation?

5 years agoRollup merge of #57703 - m-ou-se:mutexguard-debug, r=cramertj
Mazdak Farrokhzad [Sat, 26 Jan 2019 17:21:42 +0000 (18:21 +0100)]
Rollup merge of #57703 - m-ou-se:mutexguard-debug, r=cramertj

Make MutexGuard's Debug implementation more useful.

Fixes #57702.

5 years agoRollup merge of #57407 - mehcode:stabilize-extern-crate-self, r=Centril
Mazdak Farrokhzad [Sat, 26 Jan 2019 17:21:41 +0000 (18:21 +0100)]
Rollup merge of #57407 - mehcode:stabilize-extern-crate-self, r=Centril

Stabilize extern_crate_self

Fixes #56409

5 years agoAuto merge of #57852 - davidtwco:issue-57819, r=estebank
bors [Sat, 26 Jan 2019 15:33:43 +0000 (15:33 +0000)]
Auto merge of #57852 - davidtwco:issue-57819, r=estebank

Suggest removing leading left angle brackets.

Fixes #57819.

This PR adds errors and accompanying suggestions as below:

```
bar::<<<<<T as Foo>::Output>();
     ^^^ help: remove extra angle brackets
```

r? @estebank

5 years agoIgnore LLVM-dependent run-make tests on Windows
Mark Rousskov [Thu, 24 Jan 2019 19:17:02 +0000 (12:17 -0700)]
Ignore LLVM-dependent run-make tests on Windows

This should solve the PATH issue, and we don't need to test cross-lang
LTO working on all OS-es.

5 years agoWorkaround presence of LLVM library in stage0/lib
Mark Rousskov [Tue, 22 Jan 2019 00:47:57 +0000 (17:47 -0700)]
Workaround presence of LLVM library in stage0/lib

This commit works around the newly-introduced LLVM shared library.

This is needed such that llvm-config run from
librustc_llvm's build script can correctly locate it's own LLVM, not the
one in stage0/lib. The LLVM build system uses the DT_RUNPATH/RUNPATH
header within the llvm-config binary, which we want to use, but because
Cargo always adds the host compiler's "libdir" (stage0/lib in our
case) to the dynamic linker's search path, we weren't properly finding
the freshly-built LLVM in llvm/lib. By restoring the environment
variable setting the search path to what bootstrap sees, the problem is
resolved and librustc_llvm correctly links and finds the appropriate
LLVM.

Several run-make-fulldeps tests are also updated with similar handling.

5 years agoBump bootstrap compiler to 1.33 beta
Mark Rousskov [Sat, 19 Jan 2019 23:25:06 +0000 (16:25 -0700)]
Bump bootstrap compiler to 1.33 beta

5 years agoPretty print `$crate` as `crate` or `crate_name` in more cases
Vadim Petrochenkov [Sat, 26 Jan 2019 13:29:34 +0000 (16:29 +0300)]
Pretty print `$crate` as `crate` or `crate_name` in more cases

5 years agoAuto merge of #57726 - Zoxc:combine-early-lints, r=estebank
bors [Sat, 26 Jan 2019 12:21:03 +0000 (12:21 +0000)]
Auto merge of #57726 - Zoxc:combine-early-lints, r=estebank

Combine all builtin early lints

This also adds a -Z no-interleave-lints option to allow benchmarking lints.

r? @estebank

5 years agoAuto merge of #57425 - alexcrichton:stabilize-atomics, r=sfackler
bors [Sat, 26 Jan 2019 09:46:10 +0000 (09:46 +0000)]
Auto merge of #57425 - alexcrichton:stabilize-atomics, r=sfackler

std: Stabilize fixed-width integer atomics

This commit stabilizes the `Atomic{I,U}{8,16,32,64}` APIs in the
`std::sync::atomic` and `core::sync::atomic` modules. Proposed in #56753
and tracked in #32976 this feature has been unstable for quite some time
and is hopefully ready to go over the finish line now!

The API is being stabilized as-is. The API of `AtomicU8` and friends
mirrors that of `AtomicUsize`. A list of changes made here are:

* A portability documentation section has been added to describe the
  current state of affairs.
* Emulation of smaller-size atomics with larger-size atomics has been
  documented.
* As an added bonus, `ATOMIC_*_INIT` is now scheduled for deprecation
  across the board in 1.34.0 now that `const` functions can be invoked
  in statics.

Note that the 128-bit atomic types are omitted from this stabilization
explicitly. They have far less platform support than the other atomic
types, and will likely require further discussion about their best
location.

Closes #32976
Closes #56753

5 years agoAuto merge of #55641 - nagisa:optimize-attr, r=pnkfelix
bors [Sat, 26 Jan 2019 07:08:18 +0000 (07:08 +0000)]
Auto merge of #55641 - nagisa:optimize-attr, r=pnkfelix

Implement optimize(size) and optimize(speed) attributes

This PR implements both `optimize(size)` and `optimize(speed)` attributes.

While the functionality itself works fine now, this PR is not yet complete: the code might be messy in places and, most importantly, the compiletest must be improved with functionality to run tests with custom optimization levels. Otherwise the new attribute cannot be tested properly. Oh, and not all of the RFC is implemented – attribute propagation is not implemented for example.

# TODO

* [x] Improve compiletest so that tests can be written;
* [x] Assign a proper error number (E9999 currently, no idea how to allocate a number properly);
* [ ] Perhaps reduce the duplication in LLVM attribute assignment code…

5 years agoChange crate-visibility-modifier issue number in The Unstable Book
Hirokazu Hata [Sat, 26 Jan 2019 06:50:05 +0000 (15:50 +0900)]
Change crate-visibility-modifier issue number in The Unstable Book

5 years agoAuto merge of #57675 - cuviper:llvm-monorepo, r=alexcrichton
bors [Sat, 26 Jan 2019 02:10:15 +0000 (02:10 +0000)]
Auto merge of #57675 - cuviper:llvm-monorepo, r=alexcrichton

Rebase to the llvm-project monorepo

The new git submodule src/llvm-project is a monorepo replacing src/llvm
and src/tools/{clang,lld,lldb}.  This also serves as a rebase for these
projects to the new 8.x branch from trunk.

The src/llvm-emscripten fork is unchanged for now.

r? @alexcrichton

5 years agoUpdate `dlmalloc` to 0.1.2
Alex Crichton [Fri, 25 Jan 2019 15:23:18 +0000 (07:23 -0800)]
Update `dlmalloc` to 0.1.2

Remove usage of an old and removed wasm intrinsic

5 years agoSet LLDB_NO_DEBUGSERVER=ON
Josh Stone [Fri, 25 Jan 2019 02:02:54 +0000 (18:02 -0800)]
Set LLDB_NO_DEBUGSERVER=ON

5 years ago[rust-lldb] Adapt to changes in LLDB APIs
Josh Stone [Thu, 24 Jan 2019 18:42:52 +0000 (10:42 -0800)]
[rust-lldb] Adapt to changes in LLDB APIs

5 years agolibrustc_llvm: default to libc++ for darwin
Josh Stone [Thu, 24 Jan 2019 00:17:24 +0000 (16:17 -0800)]
librustc_llvm: default to libc++ for darwin

5 years agoUpdate LLVM for a CodeView fix
Josh Stone [Wed, 23 Jan 2019 03:50:45 +0000 (19:50 -0800)]
Update LLVM for a CodeView fix

5 years agoSet the DICompileUnit emissionKind
Josh Stone [Tue, 22 Jan 2019 21:01:14 +0000 (13:01 -0800)]
Set the DICompileUnit emissionKind

5 years agoAdd two more wasm-related LLVM commits
Alex Crichton [Thu, 17 Jan 2019 20:56:50 +0000 (12:56 -0800)]
Add two more wasm-related LLVM commits

5 years agoRebase to the llvm-project monorepo
Josh Stone [Wed, 16 Jan 2019 17:59:03 +0000 (09:59 -0800)]
Rebase to the llvm-project monorepo

The new git submodule src/llvm-project is a monorepo replacing src/llvm
and src/tools/{clang,lld,lldb}.  This also serves as a rebase for these
projects to the new 8.x branch from trunk.

The src/llvm-emscripten fork is unchanged for now.

5 years agoAuto merge of #57898 - Centril:rollup, r=Centril
bors [Fri, 25 Jan 2019 23:27:20 +0000 (23:27 +0000)]
Auto merge of #57898 - Centril:rollup, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #56233 (Miri and miri-related code contains repetitions of `(n << amt) >> amt`)
 - #57645 (distinguish "no data" from "heterogeneous" in ABI)
 - #57734 (Fix evaluating trivial drop glue in constants)
 - #57886 (Add suggestion for moving type declaration before associated type bindings in generic arguments.)
 - #57890 (Fix wording in diagnostics page)

Failed merges:

r? @ghost

5 years agoAddress review comments and cleanup code
Vadim Petrochenkov [Fri, 25 Jan 2019 21:36:50 +0000 (00:36 +0300)]
Address review comments and cleanup code

5 years agoCorrectly set filetime for copied LLVM
Mark Rousskov [Thu, 24 Jan 2019 00:34:43 +0000 (17:34 -0700)]
Correctly set filetime for copied LLVM

This also makes compiletest no longer always retest everything.

5 years agoAuto merge of #57435 - Dylan-DPC:fi/compiler-builtins-lock, r=alexcrichton
bors [Fri, 25 Jan 2019 20:30:43 +0000 (20:30 +0000)]
Auto merge of #57435 - Dylan-DPC:fi/compiler-builtins-lock, r=alexcrichton

Update Cargo.lock to use the latest `compiler_builtins`

A very tiny PR per the request of @alexcrichton : rust-lang-nursery/compiler-builtins#267 (comment)

Rewrite of #57414

cc @Lokathor

r? @alexcrichton

5 years agostd: Stabilize fixed-width integer atomics
Alex Crichton [Mon, 7 Jan 2019 20:41:55 +0000 (12:41 -0800)]
std: Stabilize fixed-width integer atomics

This commit stabilizes the `Atomic{I,U}{8,16,32,64}` APIs in the
`std::sync::atomic` and `core::sync::atomic` modules. Proposed in #56753
and tracked in #32976 this feature has been unstable for quite some time
and is hopefully ready to go over the finish line now!

The API is being stabilized as-is. The API of `AtomicU8` and friends
mirrors that of `AtomicUsize`. A list of changes made here are:

* A portability documentation section has been added to describe the
  current state of affairs.
* Emulation of smaller-size atomics with larger-size atomics has been
  documented.
* As an added bonus, `ATOMIC_*_INIT` is now scheduled for deprecation
  across the board in 1.34.0 now that `const` functions can be invoked
  in statics.

Note that the 128-bit atomic types are omitted from this stabilization
explicitly. They have far less platform support than the other atomic
types, and will likely require further discussion about their best
location.

Closes #32976
Closes #56753

5 years ago#56411 do not suggest a fix for a import conflict in a macro
François Mockers [Tue, 18 Dec 2018 01:22:08 +0000 (02:22 +0100)]
#56411 do not suggest a fix for a import conflict in a macro

5 years agoResolve breakage
Simonas Kazlauskas [Fri, 18 Jan 2019 22:37:52 +0000 (00:37 +0200)]
Resolve breakage

5 years agoRollup merge of #57890 - feinorgh:fix-diagnostics-typo, r=zackmdavis
Mazdak Farrokhzad [Fri, 25 Jan 2019 15:59:31 +0000 (16:59 +0100)]
Rollup merge of #57890 - feinorgh:fix-diagnostics-typo, r=zackmdavis

Fix wording in diagnostics page

Fix a tiny wording error in the diagnostics text for E0070.

5 years agoRollup merge of #57886 - davidtwco:issue-57385, r=estebank
Mazdak Farrokhzad [Fri, 25 Jan 2019 15:59:29 +0000 (16:59 +0100)]
Rollup merge of #57886 - davidtwco:issue-57385, r=estebank

Add suggestion for moving type declaration before associated type bindings in generic arguments.

Fixes #57385.

r? @estebank

5 years agoRollup merge of #57734 - oli-obk:fixes_and_cleanups, r=pnkfelix
Mazdak Farrokhzad [Fri, 25 Jan 2019 15:59:27 +0000 (16:59 +0100)]
Rollup merge of #57734 - oli-obk:fixes_and_cleanups, r=pnkfelix

Fix evaluating trivial drop glue in constants

```rust
struct A;
impl Drop for A {
    fn drop(&mut self) {}
}

const FOO: Option<A> = None;

const BAR: () = (FOO, ()).1;
```

was erroring with

```
error: any use of this value will cause an error
 --> src/lib.rs:9:1
  |
9 | const BAR: () = (FOO, ()).1;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^-^
  |                           |
  |                           calling non-const function `std::ptr::real_drop_in_place::<(std::option::Option<A>, ())> - shim(Some((std::option::Option<A>, ())))`
  |
  = note: #[deny(const_err)] on by default

error: aborting due to previous error
```

before this PR. According to godbolt this last compiled successfully in 1.27

5 years agoRollup merge of #57645 - nikomatsakis:issue-56877-abi-aggregates, r=eddyb
Mazdak Farrokhzad [Fri, 25 Jan 2019 15:59:26 +0000 (16:59 +0100)]
Rollup merge of #57645 - nikomatsakis:issue-56877-abi-aggregates, r=eddyb

distinguish "no data" from "heterogeneous" in ABI

Ignore zero-sized types when computing whether something is a homogeneous aggregate, except be careful of VLA.

cc #56877

r? @arielb1
cc @eddyb

5 years agoRollup merge of #56233 - kenta7777:kenta7777#49937, r=oli-obk
Mazdak Farrokhzad [Fri, 25 Jan 2019 15:59:25 +0000 (16:59 +0100)]
Rollup merge of #56233 - kenta7777:kenta7777#49937, r=oli-obk

Miri and miri-related code contains repetitions of `(n << amt) >> amt`

I reduced some code repetitions contains `(n << amt) >> amt`.
This pull request is related to #49937.

5 years agodistinguish "no data" from "heterogeneous" for ABI purposes
Niko Matsakis [Wed, 9 Jan 2019 20:16:32 +0000 (15:16 -0500)]
distinguish "no data" from "heterogeneous" for ABI purposes

Also, add a testing infrastructure and tests that lets us dump layout.

5 years agoAuto merge of #57714 - matthewjasper:wellformed-unreachable, r=pnkfelix
bors [Fri, 25 Jan 2019 14:25:37 +0000 (14:25 +0000)]
Auto merge of #57714 - matthewjasper:wellformed-unreachable, r=pnkfelix

[NLL] Clean up handling of type annotations

* Renames (Canonical)?UserTypeAnnotation -> (Canonical)?UserType so that the name CanonicalUserTypeAnnotation is free.
* Keep the inferred type associated to user type annotations in the MIR, so that it can be compared against the annotated type, even when the annotated expression gets removed from the MIR. (#54943)
* Use the inferred type to allow infallible handling of user type projections (#57531)
* Uses revisions for the tests in #56993
* Check the types of `Unevaluated` constants with no annotations (#46702)
* Some drive-by cleanup

Closes #46702
Closes #54943
Closes #57531
Closes #57731
cc #56993 leaving this open to track the underlying issue: we are not running tests with full NLL enabled on CI at the moment

r? @nikomatsakis

5 years agoUnit test from #57866.
Felix S. Klock II [Fri, 25 Jan 2019 14:19:37 +0000 (15:19 +0100)]
Unit test from #57866.

5 years agoAuto merge of #57891 - michaelwoerister:no-default-incr-bootstrap, r=pietroalbini
bors [Fri, 25 Jan 2019 11:25:14 +0000 (11:25 +0000)]
Auto merge of #57891 - michaelwoerister:no-default-incr-bootstrap, r=pietroalbini

bootstrap: Don't rely on any default settings regarding incr. comp. in Cargo

https://github.com/rust-lang/cargo/pull/6564 (temporarily) makes incremental compilation the default for release builds. We don't want this default to apply to building the compiler itself, that is, `bootstrap`'s `incremental` flag should always be respected. Otherwise we'll get incrementally build releases, which we really don't want `:)`.

r? @Mark-Simulacrum

Anybody else from @rust-lang/release should feel free to r+ this too if they get around to it earlier.

5 years agoCombining move lifetime and type suggestions.
David Wood [Thu, 24 Jan 2019 23:36:28 +0000 (00:36 +0100)]
Combining move lifetime and type suggestions.

This commit combines the move lifetime and move type suggestions so that
when rustfix applies them they don't conflict with each other.

5 years agobootstrap: Don't rely on any default settings regarding incr. comp. in Cargo.
Michael Woerister [Fri, 25 Jan 2019 10:23:08 +0000 (11:23 +0100)]
bootstrap: Don't rely on any default settings regarding incr. comp. in Cargo.

5 years agoSuggestion moving types before associated types.
David Wood [Thu, 24 Jan 2019 22:24:58 +0000 (23:24 +0100)]
Suggestion moving types before associated types.

This commit extends existing suggestions to move lifetimes before types
in generic arguments to also suggest moving types behind associated type
bindings.

5 years agoAdd a compile-fail test for `Drop` in constants in the presence of `Option`s
Oliver Scherer [Wed, 23 Jan 2019 15:21:33 +0000 (16:21 +0100)]
Add a compile-fail test for `Drop` in constants in the presence of `Option`s

5 years agoAuto merge of #57881 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
bors [Fri, 25 Jan 2019 08:34:53 +0000 (08:34 +0000)]
Auto merge of #57881 - matthiaskrgr:clippy_submodule_upd, r=oli-obk

submodules: update clippy from 280069dd to f1753522

Changes:
````
Rustup
allow assertions_on_constants for collapsible_if and missing_test_files
Improving comments.
Added rustfix to the test.
Improve span shortening.
Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".
Fixed potential mistakes with nesting. Added tests.
Fix automatic suggestion on `use_self`.
run ./util/dev update_lints
add assert(true/false, some message) tests
change assert_checks to assertions_on_constants
run ./util/dev update_lints
Add unreachable!() as option
Add assert(true) and assert(false) lints
````

Fixes clippy toolstate

r? @oli-obk

5 years agoFix wording in diagnostics page
Pär Karlsson [Fri, 25 Jan 2019 07:43:56 +0000 (08:43 +0100)]
Fix wording in diagnostics page