]> git.lizzy.rs Git - rust.git/log
rust.git
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 agoFix stray typo
Rémy Rakic [Sat, 26 Jan 2019 20:39:47 +0000 (21:39 +0100)]
Fix stray typo

5 years agoExtract the notes explaining the placeholder region errors to a helper fn
Rémy Rakic [Sat, 26 Jan 2019 20:32:09 +0000 (21:32 +0100)]
Extract the notes explaining the placeholder region errors to a helper fn

5 years agoWhen mentioning lifetimes, put either the trait ref or the self type closer to the...
Rémy Rakic [Sat, 26 Jan 2019 19:25:36 +0000 (20:25 +0100)]
When mentioning lifetimes, put either the trait ref or the self type closer to the lifetimes

When mentioning lifetimes, only invert wording between the expected trait and the self type when the self type has the vid.
This way, the lifetimes always stay close to the self type or trait ref that actually contains them.

5 years agoFix issue-57362-1.rs attributes
Rémy Rakic [Fri, 25 Jan 2019 22:37:56 +0000 (23:37 +0100)]
Fix issue-57362-1.rs attributes

5 years agocomment the pattern
Niko Matsakis [Fri, 25 Jan 2019 20:43:36 +0000 (15:43 -0500)]
comment the pattern

5 years agoidentify when implemented for "some specific lifetime"
Niko Matsakis [Fri, 25 Jan 2019 20:23:13 +0000 (15:23 -0500)]
identify when implemented for "some specific lifetime"

5 years agoadd a lot more `debug!` to `try_report_placeholders_trait`
Niko Matsakis [Fri, 25 Jan 2019 19:54:42 +0000 (14:54 -0500)]
add a lot more `debug!` to `try_report_placeholders_trait`

5 years agobreak apart tests
Niko Matsakis [Fri, 25 Jan 2019 19:53:59 +0000 (14:53 -0500)]
break apart tests

5 years agoTest new placeholder error messages in previously untested combinations
Remy Rakic [Fri, 25 Jan 2019 18:35:35 +0000 (19:35 +0100)]
Test new placeholder error messages in previously untested combinations

5 years agoUpdate test expectations for new placeholder error messages
Remy Rakic [Fri, 25 Jan 2019 18:17:38 +0000 (19:17 +0100)]
Update test expectations for new placeholder error messages

5 years agoUpdate two E308 tests to the new placeholder error
lqd [Fri, 25 Jan 2019 18:04:26 +0000 (19:04 +0100)]
Update two E308 tests to the new placeholder error

5 years agoTry to reword placeholder error messages to make them clearer
lqd [Fri, 25 Jan 2019 18:02:38 +0000 (19:02 +0100)]
Try to reword placeholder error messages to make them clearer

5 years agoTry to resolve type vars in the placeholder errors trait refs
lqd [Fri, 25 Jan 2019 17:39:51 +0000 (18:39 +0100)]
Try to resolve type vars in the placeholder errors trait refs

These can sometimes be unresolved: some of the rustc UI tests show this.

5 years agoHandle higher-ranked lifetime conflict errors where the subtype is the `sup` region
lqd [Fri, 25 Jan 2019 17:35:47 +0000 (18:35 +0100)]
Handle higher-ranked lifetime conflict errors where the subtype is the `sup` region

These are happening since the switch to universes, and will now go through the "placeholder error" path, instead of the current fallback of E308 "mismatched types" errors.

5 years agoMake NiceRegionError use the `InferCtxt` instead of its `TyCtxt`
lqd [Fri, 25 Jan 2019 17:22:44 +0000 (18:22 +0100)]
Make NiceRegionError use the `InferCtxt` instead of its `TyCtxt`

Some errors (e.g placeholder errors) have unresolved type vars so this will allow to use `resolve_type_vars_if_possible` when needed.

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 agouse `SOURCE_DATE_EPOCH` for man page time if set
Andy Russell [Sat, 26 Jan 2019 17:54:09 +0000 (12:54 -0500)]
use `SOURCE_DATE_EPOCH` for man page time if set

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

5 years agolock after rebase
dylan_DPC [Thu, 17 Jan 2019 10:22:48 +0000 (15:52 +0530)]
lock after rebase

5 years agofix lock after running build
dylan_DPC [Tue, 8 Jan 2019 07:01:50 +0000 (12:31 +0530)]
fix lock after running build

5 years agoThe file should be fully consistent now.
Lokathor [Mon, 7 Jan 2019 19:14:59 +0000 (12:14 -0700)]
The file should be fully consistent now.

5 years agoUpdate Cargo.lock to use the latest `compiler_builtins`
Lokathor [Mon, 7 Jan 2019 19:52:05 +0000 (14:52 -0500)]
Update Cargo.lock to use the latest `compiler_builtins`

5 years agoAuto merge of #57888 - Centril:rollup, r=Centril
bors [Fri, 25 Jan 2019 01:18:13 +0000 (01:18 +0000)]
Auto merge of #57888 - Centril:rollup, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #56217 (Add grammar in docs for {f32,f64}::from_str, mention known bug.)
 - #57294 (When using value after move, point at span of local)
 - #57652 (Update/remove some old readmes)
 - #57802 (Print visible name for types as well as modules.)
 - #57865 (Don't ICE when logging unusual types)

Failed merges:

r? @ghost

5 years agoRollup merge of #57865 - Aaron1011:fix/debug-ice, r=estebank
Mazdak Farrokhzad [Fri, 25 Jan 2019 00:37:03 +0000 (01:37 +0100)]
Rollup merge of #57865 - Aaron1011:fix/debug-ice, r=estebank

Don't ICE when logging unusual types

MonoItemExt#to_string is used for both debug logging and LLVM symbol
name generation. When debugging, we want to print out any type we
encounter, even if it's something weird like GeneratorWitness. However,
during codegen, we still want to error if we encounter an unexpected
type when generating a name.

To resolve this issue, this commit introduces a new 'debug' parameter to
the relevant methods. When set to 'true', it allows any type to be
printed - when set to 'false', it 'bug!'s when encountering an
unexpected type.

This prevents an ICE when enabling debug logging (via RUST_LOG) while
running rustc on generator-related code.

5 years agoRollup merge of #57802 - davidtwco:issue-56943, r=estebank
Mazdak Farrokhzad [Fri, 25 Jan 2019 00:37:02 +0000 (01:37 +0100)]
Rollup merge of #57802 - davidtwco:issue-56943, r=estebank

Print visible name for types as well as modules.

Fixes #56943 and fixes #57713.

This commit extends previous work in #55007 where the name from the
visible parent was used for modules. Now, we also print the name from
the visible parent for types.

r? @estebank

5 years agoRollup merge of #57652 - mark-i-m:remove-old, r=nikomatsakis
Mazdak Farrokhzad [Fri, 25 Jan 2019 00:37:00 +0000 (01:37 +0100)]
Rollup merge of #57652 - mark-i-m:remove-old, r=nikomatsakis

Update/remove some old readmes

r? @nikomatsakis

cc #48478

There are a bunch of READMEs with content that I would like to see a final decision made on:
- https://github.com/rust-lang/rust/tree/master/src/librustc/ty/query
- https://github.com/rust-lang/rust/tree/master/src/librustc/dep_graph
- https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/lexical_region_resolve
- https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/borrowck

It's not clear how useful or obsolete any of these are. I would really appreciate if the appropriate domain experts for each of these could respond with one of (a) delete it, (b) wait for system to be remove, or (c) move it to rustc-guide. @nikomatsakis do you know who to ping for any of these (sorry, I suspect many of them are you)?

5 years agoRollup merge of #57294 - estebank:point-copy-less, r=nikomatsakis
Mazdak Farrokhzad [Fri, 25 Jan 2019 00:36:59 +0000 (01:36 +0100)]
Rollup merge of #57294 - estebank:point-copy-less, r=nikomatsakis

When using value after move, point at span of local

When trying to use a value after move, instead of using a note, point
at the local declaration that has a type that doesn't implement `Copy`
trait.

```
error[E0382]: use of moved value: `x`
  --> $DIR/issue-34721.rs:27:9
   |
LL |     pub fn baz<T: Foo>(x: T) -> T {
   |                -       - move occurs because `x` has type `T`, which does not implement the `Copy` trait
   |                |
   |                consider adding a `Copy` constraint to this type argument
LL |         if 0 == 1 {
LL |             bar::bar(x.zero())
   |                      - value moved here
LL |         } else {
LL |             x.zero()
   |             - value moved here
LL |         };
LL |         x.zero()
   |         ^ value used here after move
```

Fix #34721.

5 years agoRollup merge of #56217 - frewsxcv:frewsxcv-float-parse, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 25 Jan 2019 00:36:57 +0000 (01:36 +0100)]
Rollup merge of #56217 - frewsxcv:frewsxcv-float-parse, r=QuietMisdreavus

Add grammar in docs for {f32,f64}::from_str, mention known bug.

- Original bug about documenting grammar
  - https://github.com/rust-lang/rust/issues/32243
- Known bug with parsing
  - https://github.com/rust-lang/rust/issues/31407

5 years agosubmodules: update clippy from 280069dd to f1753522
Matthias Krüger [Thu, 24 Jan 2019 21:25:13 +0000 (22:25 +0100)]
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
````

5 years agoAuto merge of #57879 - Centril:rollup, r=Centril
bors [Thu, 24 Jan 2019 21:23:11 +0000 (21:23 +0000)]
Auto merge of #57879 - Centril:rollup, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #57380 (Fix Instant/Duration math precision & associativity on Windows)
 - #57606 (Get rid of the fake stack frame for reading from constants)
 - #57803 (Several changes to libunwind for SGX target)
 - #57846 (rustdoc: fix ICE from loading proc-macro stubs)
 - #57860 (Add os::fortanix_sgx::ffi module)
 - #57861 (Don't export table by default in wasm)
 - #57863 (Add suggestion for incorrect field syntax.)
 - #57867 (Fix std::future::from_generator documentation)
 - #57873 (Stabilize no_panic_pow)

Failed merges:

r? @ghost

5 years agoFix --compare-mode=nll tests
Esteban Küber [Thu, 24 Jan 2019 18:53:43 +0000 (10:53 -0800)]
Fix --compare-mode=nll tests

5 years agoreview comments
Esteban Küber [Fri, 18 Jan 2019 23:47:25 +0000 (15:47 -0800)]
review comments

5 years agoPoint at type argument suggesting adding `Copy` constraint
Esteban Küber [Sun, 6 Jan 2019 23:23:30 +0000 (15:23 -0800)]
Point at type argument suggesting adding `Copy` constraint

5 years agobreak eagerly from loop
Esteban Küber [Fri, 4 Jan 2019 21:47:35 +0000 (13:47 -0800)]
break eagerly from loop

5 years agoAdd test for #34721
Esteban Küber [Thu, 3 Jan 2019 00:56:45 +0000 (16:56 -0800)]
Add test for #34721

5 years agoWhen using value after move, point at span of local
Esteban Küber [Thu, 3 Jan 2019 00:43:08 +0000 (16:43 -0800)]
When using value after move, point at span of local

When trying to use a value after move, instead of using a note, point
at the local declaration that has a type that doesn't implement `Copy`
trait.

5 years agoAdd a feature gate test for #[optimize]
Simonas Kazlauskas [Sun, 25 Nov 2018 17:56:10 +0000 (19:56 +0200)]
Add a feature gate test for #[optimize]