]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoUpdated my mailmap entry
Erin [Fri, 24 May 2019 16:32:22 +0000 (18:32 +0200)]
Updated my mailmap entry

5 years agoAuto merge of #60568 - petrochenkov:debi, r=Mark-Simulacrum
bors [Fri, 24 May 2019 12:51:50 +0000 (12:51 +0000)]
Auto merge of #60568 - petrochenkov:debi, r=Mark-Simulacrum

rustbuild: Simplify debuginfo configuration

This is supposed to fix https://github.com/rust-lang/rust/issues/52179

This PR introduces one option `debuginfo-level` replacing `debuginfo` and `debuginfo-lines` and corresponding to the `rustc` flag `-C debuginfo=N`.

`debuginfo-level` serves as a default for all Rust code built during bootstrap, but it can be overridden for specific subsets of code using finer-grained options `debuginfo-level-{rustc,std,tools,tests}` replacing `debuginfo-only-std`, `debuginfo-tools` and `debuginfo-tests`.

5 years agoAddress review comments
Vadim Petrochenkov [Fri, 24 May 2019 10:01:23 +0000 (13:01 +0300)]
Address review comments

5 years agorustbuild: Untie `debuginfo-level-tests` from `debuginfo-level`
Vadim Petrochenkov [Thu, 23 May 2019 23:11:33 +0000 (02:11 +0300)]
rustbuild: Untie `debuginfo-level-tests` from `debuginfo-level`

5 years agoAuto merge of #60803 - varkor:remove-in-place-syntax, r=petrochenkov
bors [Fri, 24 May 2019 09:54:17 +0000 (09:54 +0000)]
Auto merge of #60803 - varkor:remove-in-place-syntax, r=petrochenkov

Remove `ObsoleteInPlace`

The in place syntax has been deprecated for over a year. As it is, this is accumulated cruft: the error messages are unlikely to be helpful any more and it conflicts with some useful syntax (e.g. const generics in some instances).

It may be that removing `Token::LArrow` is backwards-incompatible. We should do a crater run to check.

cc @eddyb

5 years agoci: Enable debuginfo for std only if release channel is set
Vadim Petrochenkov [Thu, 23 May 2019 22:04:50 +0000 (01:04 +0300)]
ci: Enable debuginfo for std only if release channel is set

5 years agorustbuild: Simplify debuginfo configuration
Vadim Petrochenkov [Sun, 5 May 2019 19:15:42 +0000 (22:15 +0300)]
rustbuild: Simplify debuginfo configuration

5 years agoAuto merge of #60984 - matthewjasper:borrowck-error-reporting-cleanup, r=pnkfelix
bors [Fri, 24 May 2019 03:07:07 +0000 (03:07 +0000)]
Auto merge of #60984 - matthewjasper:borrowck-error-reporting-cleanup, r=pnkfelix

Borrowck error reporting cleanup

* Don't show variables created by desugarings in borrowck errors
* Move "conflict error" reporting to it's own module, so that `error_reporting` contains only common error reporting methods.
* Remove unused `ScopeTree` parameter.

r? @pnkfelix

5 years agoUpdate tests
varkor [Mon, 13 May 2019 21:19:19 +0000 (22:19 +0100)]
Update tests

5 years agoRemove `ObsoleteInPlace`
varkor [Mon, 6 May 2019 13:53:22 +0000 (14:53 +0100)]
Remove `ObsoleteInPlace`

5 years agoAuto merge of #61105 - Centril:rollup-t9lemjf, r=Centril
bors [Fri, 24 May 2019 00:21:00 +0000 (00:21 +0000)]
Auto merge of #61105 - Centril:rollup-t9lemjf, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #59545 (Use arenas to avoid Lrc in queries #2)
 - #61054 (Suggest dereferencing on assignment to mutable borrow)
 - #61056 (tweak discriminant on non-nullary enum diagnostic)
 - #61082 (fix dangling reference in Vec::append)
 - #61086 (Box::into_unique: do the reborrow-to-raw *after* destroying the Box)
 - #61098 (Fix overflowing literal lint in loops)

Failed merges:

r? @ghost

5 years agoRollup merge of #61098 - varkor:fix-overflowing-literal-in-loop, r=estebank
Mazdak Farrokhzad [Thu, 23 May 2019 23:30:25 +0000 (01:30 +0200)]
Rollup merge of #61098 - varkor:fix-overflowing-literal-in-loop, r=estebank

Fix overflowing literal lint in loops

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

r? @estebank

5 years agoRollup merge of #61086 - RalfJung:box, r=alexcrichton
Mazdak Farrokhzad [Thu, 23 May 2019 23:30:24 +0000 (01:30 +0200)]
Rollup merge of #61086 - RalfJung:box, r=alexcrichton

Box::into_unique: do the reborrow-to-raw *after* destroying the Box

Currently we first "reborrow" the box to a raw pointer, and then `forget` it. When tracking raw pointers more strictly (something I am experimenting with locally in Miri), the "use" induced by passing the box to `forget` invalidates the previously created raw pointer.

So adjust my hack from https://github.com/rust-lang/rust/pull/58429 to reorder the two operations.

5 years agoRollup merge of #61082 - RalfJung:vec, r=alexcrichton
Mazdak Farrokhzad [Thu, 23 May 2019 23:30:23 +0000 (01:30 +0200)]
Rollup merge of #61082 - RalfJung:vec, r=alexcrichton

fix dangling reference in Vec::append

Turns out I forgot to enable Miri again for the Vec tests. And there was a dangling reference hiding in there!  `get_unchecked_mut` is UB to call on an empty vector (there is no memory to get a reference to), and yet this code did it.

5 years agoRollup merge of #61056 - euclio:custom-discriminant-error, r=estebank
Mazdak Farrokhzad [Thu, 23 May 2019 23:30:21 +0000 (01:30 +0200)]
Rollup merge of #61056 - euclio:custom-discriminant-error, r=estebank

tweak discriminant on non-nullary enum diagnostic

Adds notes pointing at the non-nullary variants, and uses "custom
discriminant" language to be consistent with the Reference.

Fixes #61039.

r? @estebank

5 years agoRollup merge of #61054 - estebank:mut-ref-reassign, r=zackmdavis
Mazdak Farrokhzad [Thu, 23 May 2019 23:30:20 +0000 (01:30 +0200)]
Rollup merge of #61054 - estebank:mut-ref-reassign, r=zackmdavis

Suggest dereferencing on assignment to mutable borrow

Fix #33570

5 years agoRollup merge of #59545 - Zoxc:the-arena-3, r=eddyb,michaelwoerister
Mazdak Farrokhzad [Thu, 23 May 2019 23:30:18 +0000 (01:30 +0200)]
Rollup merge of #59545 - Zoxc:the-arena-3, r=eddyb,michaelwoerister

Use arenas to avoid Lrc in queries #2

The `Remove subtle Default impl for Value` makes the compilation stop due earlier due to cycle errors, since there's no longer a default value to continue the compilation with.

Based on https://github.com/rust-lang/rust/pull/59540.

5 years agoAuto merge of #60970 - MaulingMonkey:pr-compiletest-cdb-support, r=alexcrichton
bors [Thu, 23 May 2019 20:58:21 +0000 (20:58 +0000)]
Auto merge of #60970 - MaulingMonkey:pr-compiletest-cdb-support, r=alexcrichton

Add basic CDB support to debuginfo compiletest s, to help catch `*.natvis` regressions, like those fixed in #60687.

First draft, feedback welcome.

Several Microsoft debuggers (VS, VS Code, WinDbg, CDB, ...) consume the `*.natvis` files we embed into rust `*.pdb` files.  While this only tests CDB, that test coverage should help for all of them.

# Changes

## src\bootstrap
  - test.rs:  Run CDB debuginfo tests on MSVC targets

## src\test\debuginfo
  - issue-13213.rs:  CDB has trouble with this, skip for now (newly discovered regression?)
  - pretty-std.rs:  Was ignored, re-enable for CDB only to start with, add CDB tests.
  - should-fail.rs:  Add CDB tests.

## src\tools\compiletest:
  - Added "-cdb" option
  - Added Mode::DebugInfoCdb ("debuginfo-cdb")
  - Added run_debuginfo_cdb_test[_no_opt]
  - Renamed Mode::DebugInfoBoth -> DebugInfoGdbLldb ("debuginfo-gdb+lldb") since it's no longer clear what "Both" means.
  - Find CDB at the default Win10 SDK install path "C:\Program Files (x86)\Windows Kits\10\Debugger\\*\cdb.exe"
  - Ignore CDB tests if CDB not found.

# Issues

  - `compute_stamp_hash`: not sure if there's any point in hashing `%ProgramFiles(x86)%`
  - `OsString` lacks any `*.natvis` entries (would be nice to add in a followup changelist)
  - DSTs (array/string slices) which work in VS & VS Code fail in CDB.
  - I've avoided `Mode::DebugInfoAll` as 3 debuggers leads to pow(2,3)=8 possible combinations.

# Reference

CDB is not part of the base Visual Studio install, but can be added via the Windows 10 SDK:
  https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
Installing just "Debugging Tools for Windows" is sufficient.

CDB appears to already be installed on appveyor CI, where this changelist can find it, based on it's use here:
  https://github.com/rust-lang/rust/blob/0ffc57311030a1930edfa721fe57d0000a063af4/appveyor.yml#L227

CDB commands and command line reference:
  https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-reference

5 years agoAdd test for denying overflowing literal in loop
varkor [Thu, 23 May 2019 20:48:26 +0000 (21:48 +0100)]
Add test for denying overflowing literal in loop

5 years agoUpdate unreachable loop patterns test
varkor [Thu, 23 May 2019 20:39:36 +0000 (21:39 +0100)]
Update unreachable loop patterns test

5 years agoFix missing overflowing literal lint in for loop
varkor [Thu, 23 May 2019 20:39:27 +0000 (21:39 +0100)]
Fix missing overflowing literal lint in for loop

5 years agoAdd regression test for negative case
Esteban Küber [Thu, 23 May 2019 17:32:01 +0000 (10:32 -0700)]
Add regression test for negative case

5 years agoUpdate crate_variances and inferred_outlives_crate
John Kåre Alsaker [Mon, 20 May 2019 22:40:32 +0000 (00:40 +0200)]
Update crate_variances and inferred_outlives_crate

5 years agoUpdate dylib_dependency_formats, extern_crate and reachable_non_generics
John Kåre Alsaker [Sat, 1 Dec 2018 16:27:12 +0000 (17:27 +0100)]
Update dylib_dependency_formats, extern_crate and reachable_non_generics

5 years agoUpdate foreign_modules and dllimport_foreign_items
John Kåre Alsaker [Sat, 1 Dec 2018 16:14:40 +0000 (17:14 +0100)]
Update foreign_modules and dllimport_foreign_items

5 years agoUpdate visible_parent_map
John Kåre Alsaker [Sat, 1 Dec 2018 16:02:51 +0000 (17:02 +0100)]
Update visible_parent_map

5 years agoUpdate get_lib_features, defined_lib_features, get_lang_items, defined_lang_items...
John Kåre Alsaker [Sat, 1 Dec 2018 15:57:29 +0000 (16:57 +0100)]
Update get_lib_features, defined_lib_features, get_lang_items, defined_lang_items, missing_lang_items, postorder_cnums and maybe_unused_extern_crates

5 years agoUpdate wasm_import_module_map and target_features_whitelist
John Kåre Alsaker [Sat, 1 Dec 2018 15:30:42 +0000 (16:30 +0100)]
Update wasm_import_module_map and target_features_whitelist

5 years agoUpdate upvars and module_exports
John Kåre Alsaker [Sat, 1 Dec 2018 15:23:32 +0000 (16:23 +0100)]
Update upvars and module_exports

5 years agoUpdate in_scope_traits_map
John Kåre Alsaker [Sat, 1 Dec 2018 15:17:59 +0000 (16:17 +0100)]
Update in_scope_traits_map

5 years agoUpdate privacy_access_levels
John Kåre Alsaker [Sat, 1 Dec 2018 14:34:04 +0000 (15:34 +0100)]
Update privacy_access_levels

5 years agoUpdate all_traits
John Kåre Alsaker [Fri, 30 Nov 2018 21:58:06 +0000 (22:58 +0100)]
Update all_traits

5 years agoUpdate stability_index, all_crate_nums and features_query
John Kåre Alsaker [Fri, 30 Nov 2018 21:45:46 +0000 (22:45 +0100)]
Update stability_index, all_crate_nums and features_query

5 years agoUpdate lint_levels
John Kåre Alsaker [Fri, 30 Nov 2018 20:01:50 +0000 (21:01 +0100)]
Update lint_levels

5 years agoUpdate Cargo.lock
John Kåre Alsaker [Sun, 19 May 2019 16:02:55 +0000 (18:02 +0200)]
Update Cargo.lock

5 years agoMake ArenaField private
John Kåre Alsaker [Sun, 19 May 2019 16:02:08 +0000 (18:02 +0200)]
Make ArenaField private

5 years agoAdd a comment for arena_types!
John Kåre Alsaker [Sun, 19 May 2019 15:27:28 +0000 (17:27 +0200)]
Add a comment for arena_types!

5 years agoRemove subtle Default impl for Value
John Kåre Alsaker [Fri, 5 Apr 2019 11:22:13 +0000 (13:22 +0200)]
Remove subtle Default impl for Value

5 years agoUpdate GenericPredicates queries
John Kåre Alsaker [Sat, 1 Dec 2018 17:13:27 +0000 (18:13 +0100)]
Update GenericPredicates queries

5 years agoOptimize alloc_from_iter
John Kåre Alsaker [Tue, 23 Apr 2019 23:45:50 +0000 (01:45 +0200)]
Optimize alloc_from_iter

5 years agoUpdate used_trait_imports
John Kåre Alsaker [Fri, 30 Nov 2018 19:02:56 +0000 (20:02 +0100)]
Update used_trait_imports

5 years agoUpdate item_children
John Kåre Alsaker [Fri, 30 Nov 2018 21:32:16 +0000 (22:32 +0100)]
Update item_children

5 years agoUpdate resolve_lifetimes, named_region_map, is_late_bound_map and object_lifetime_def...
John Kåre Alsaker [Fri, 30 Nov 2018 21:26:57 +0000 (22:26 +0100)]
Update resolve_lifetimes, named_region_map, is_late_bound_map and object_lifetime_defaults_map

5 years agoUpdate implementations_of_trait and all_trait_implementations
John Kåre Alsaker [Fri, 30 Nov 2018 20:23:01 +0000 (21:23 +0100)]
Update implementations_of_trait and all_trait_implementations

5 years agoUpdate upstream_monomorphizations and upstream_monomorphizations_for
John Kåre Alsaker [Fri, 30 Nov 2018 20:05:48 +0000 (21:05 +0100)]
Update upstream_monomorphizations and upstream_monomorphizations_for

5 years agoUpdate borrowck
John Kåre Alsaker [Fri, 30 Nov 2018 19:15:09 +0000 (20:15 +0100)]
Update borrowck

5 years agoUpdate inherent_impls
John Kåre Alsaker [Fri, 30 Nov 2018 14:19:12 +0000 (15:19 +0100)]
Update inherent_impls

5 years agoUpdate associated_item_def_ids
John Kåre Alsaker [Fri, 30 Nov 2018 14:06:42 +0000 (15:06 +0100)]
Update associated_item_def_ids

5 years agoadjust comment
Ralf Jung [Thu, 23 May 2019 16:13:02 +0000 (18:13 +0200)]
adjust comment

5 years agoBox::into_unique: do the reborrow-to-raw *after* destroying the Box
Ralf Jung [Thu, 23 May 2019 15:58:25 +0000 (17:58 +0200)]
Box::into_unique: do the reborrow-to-raw *after* destroying the Box

5 years agotweak discriminant on non-nullary enum diagnostic
Andy Russell [Wed, 22 May 2019 20:56:51 +0000 (16:56 -0400)]
tweak discriminant on non-nullary enum diagnostic

Adds notes pointing at the non-nullary variants, and uses "custom
discriminant" language to be consistent with the Reference.

5 years agofix dangling reference in Vec::append
Ralf Jung [Thu, 23 May 2019 14:30:16 +0000 (16:30 +0200)]
fix dangling reference in Vec::append

5 years agoAuto merge of #60965 - petrochenkov:lit3, r=matklad
bors [Thu, 23 May 2019 13:28:27 +0000 (13:28 +0000)]
Auto merge of #60965 - petrochenkov:lit3, r=matklad

syntax: Continue refactoring literals

A follow up to https://github.com/rust-lang/rust/pull/60679.

https://github.com/rust-lang/rust/commit/a2fd002bd5a91ba7997057724b72b9dac8fae550: Similarly to `EscapeError`, literal parsing now produces a `LitError`.
This way we can get rid of `diag: Option<(Span, &Handler)>` in interfaces while leaving attr/mod alone.

https://github.com/rust-lang/rust/commit/d9516d11208456d4a17fe68a34c1d0a00334e62c: Gathers all components of a literal token in a single struct.

5 years agosyntax: Some code cleanup
Vadim Petrochenkov [Sun, 19 May 2019 16:56:45 +0000 (19:56 +0300)]
syntax: Some code cleanup

5 years agosyntax: Turn `token::Lit` into a struct
Vadim Petrochenkov [Sat, 18 May 2019 22:04:26 +0000 (01:04 +0300)]
syntax: Turn `token::Lit` into a struct

5 years agosyntax: Remove an obsolete hack from literal comparisons
Vadim Petrochenkov [Sat, 18 May 2019 19:46:27 +0000 (22:46 +0300)]
syntax: Remove an obsolete hack from literal comparisons

5 years agosyntax: Fix spans for boolean literals passed to proc macros
Vadim Petrochenkov [Sat, 18 May 2019 19:45:24 +0000 (22:45 +0300)]
syntax: Fix spans for boolean literals passed to proc macros

5 years agosyntax: More consistent wording for some literal parsing errors
Vadim Petrochenkov [Sat, 18 May 2019 19:44:09 +0000 (22:44 +0300)]
syntax: More consistent wording for some literal parsing errors

5 years agosyntax: Return named errors from literal parsing functions
Vadim Petrochenkov [Sat, 18 May 2019 14:36:30 +0000 (17:36 +0300)]
syntax: Return named errors from literal parsing functions

5 years agoAuto merge of #61075 - Centril:rollup-1ugmcqu, r=Centril
bors [Thu, 23 May 2019 07:31:24 +0000 (07:31 +0000)]
Auto merge of #61075 - Centril:rollup-1ugmcqu, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #60981 (Bump compiler-builtins to 0.1.15)
 - #61014 (Make -Zemit-artifact-notifications also emit the artifact type)
 - #61043 (Disable LLVM/debug assertions in gnu-full-bootstrap)
 - #61046 (Fix ICE with inconsistent macro matchers)
 - #61055 (Solaris CI: Build with dilos2 stable)
 - #61057 (Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators.")
 - #61073 (librustc_errors: Remove unused annotation style `OldSchoolNoteText`)

Failed merges:

r? @ghost

5 years agoRollup merge of #61073 - phansch:remove_unused_annotation_style, r=matthewjasper
Mazdak Farrokhzad [Thu, 23 May 2019 06:37:19 +0000 (08:37 +0200)]
Rollup merge of #61073 - phansch:remove_unused_annotation_style, r=matthewjasper

librustc_errors: Remove unused annotation style `OldSchoolNoteText`

I could not find any references to it and the `snippet` module does not
seem to be exported publicly, so I think it can be safely removed.

This was originally removed in 17bd76a51 and I'm not sure why it is still there.

5 years agoRollup merge of #61057 - sfackler:revert-next-back, r=alexcrichton
Mazdak Farrokhzad [Thu, 23 May 2019 06:37:18 +0000 (08:37 +0200)]
Rollup merge of #61057 - sfackler:revert-next-back, r=alexcrichton

Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators."

This changed observable behavior for several iterator types.

r? @alexcrichton

5 years agoRollup merge of #61055 - bgermann:master, r=sanxiyn
Mazdak Farrokhzad [Thu, 23 May 2019 06:37:17 +0000 (08:37 +0200)]
Rollup merge of #61055 - bgermann:master, r=sanxiyn

Solaris CI: Build with dilos2 stable

dilos2-testing has problems since the last repository update, so get the packages from dilos2 stable.

Fixes #61022.

5 years agoRollup merge of #61046 - mark-i-m:transcribe-fix, r=petrochenkov
Mazdak Farrokhzad [Thu, 23 May 2019 06:37:15 +0000 (08:37 +0200)]
Rollup merge of #61046 - mark-i-m:transcribe-fix, r=petrochenkov

Fix ICE with inconsistent macro matchers

Fixes #61033

r? @petrochenkov

5 years agoRollup merge of #61043 - alexcrichton:less-full-bootstrap, r=sanxiyn
Mazdak Farrokhzad [Thu, 23 May 2019 06:37:14 +0000 (08:37 +0200)]
Rollup merge of #61043 - alexcrichton:less-full-bootstrap, r=sanxiyn

Disable LLVM/debug assertions in gnu-full-bootstrap

This builder already is very close to the 2 hour mark and the debug
assertions aren't really buying us anything over what all the other
containers are enabling, so let's disable them for this slow builder.

5 years agoRollup merge of #61014 - jsgf:emit-artifact-type, r=alexcrichton
Mazdak Farrokhzad [Thu, 23 May 2019 06:37:12 +0000 (08:37 +0200)]
Rollup merge of #61014 - jsgf:emit-artifact-type, r=alexcrichton

Make -Zemit-artifact-notifications also emit the artifact type

This is easier for tooling to handle than trying to reverse-engineer the type from the filename extension. The field name and value is intended to reflect the `--emit` command-line option.

Related issues https://github.com/rust-lang/rust/issues/60988 https://github.com/rust-lang/rust/issues/58465
cc @alexcrichton

5 years agoRollup merge of #60981 - alexcrichton:update-compiler-builtins, r=cuviper
Mazdak Farrokhzad [Thu, 23 May 2019 06:37:11 +0000 (08:37 +0200)]
Rollup merge of #60981 - alexcrichton:update-compiler-builtins, r=cuviper

Bump compiler-builtins to 0.1.15

This commit bumps the `compiler-builtins` dependency to 0.1.15 which
expects to have the source for `compiler-rt` provided externally if the
`c` feature is enabled. This then plumbs through the necessary support
in the build system to ensure that if the `llvm-project` directory is
checked out and present that we enable the `c` feature of
`compiler-builtins` and compile in all the C intrinsics.

5 years agolibrustc_errors: Remove unused annotation style `OldSchoolNoteText`
Philipp Hansch [Thu, 23 May 2019 06:01:38 +0000 (08:01 +0200)]
librustc_errors: Remove unused annotation style `OldSchoolNoteText`

I could not find any references to it and the `snippet` module does not
seem to be exported publicly, so I think it can be safely removed.

5 years agoAuto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelix
bors [Thu, 23 May 2019 04:48:21 +0000 (04:48 +0000)]
Auto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelix

Add match arm scopes and other scope fixes

* Add drop and lint scopes for match arms.
* Lint attributes are now respected on match arms.
* Make sure we emit a StorageDead if we diverge when initializing a temporary.
* Adjust MIR pretty printing of scopes for locals.
* Don't generate duplicate lint scopes for `let statements`.
* Add some previously missing fake borrows for matches.

closes #46525

cc @rust-lang/compiler

5 years agoAuto merge of #60740 - petrochenkov:kw, r=nnethercote
bors [Thu, 23 May 2019 01:50:55 +0000 (01:50 +0000)]
Auto merge of #60740 - petrochenkov:kw, r=nnethercote

Simplify use of keyword symbols

They mirror non-keyword symbols now (see https://github.com/rust-lang/rust/pull/60630).

`keywords::MyKeyword.name()` -> `kw::MyKeyword`
`keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common)
`keywords::Invalid.ident()` -> `Ident::invalid()` (more common)

Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated.
This means `kw::MyKeyword` can now be used in `match` in particular.

5 years agoAuto merge of #61044 - Centril:rollup-ztsgb9p, r=Centril
bors [Wed, 22 May 2019 22:57:48 +0000 (22:57 +0000)]
Auto merge of #61044 - Centril:rollup-ztsgb9p, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #60300 (Allow null-pointer-optimized enums in FFI if their underlying representation is FFI safe)
 - #60773 (Always try to project predicates when finding auto traits in rustdoc)
 - #60809 (Add FAQ for NLL migration)
 - #61023 (Migrate from recursion to iterate on qualify consts visitor impl)
 - #61029 (Simplify RefCell minimum_spanning_tree example)
 - #61030 (Make maybe_codegen_consume_direct iterate instead of doing recursion)
 - #61034 (rustc_metadata: parametrize schema::CrateRoot by 'tcx and rip out old unused incremental infra.)
 - #61037 (Update clippy submodule)

Failed merges:

r? @ghost

5 years agoRevert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIt...
Steven Fackler [Wed, 22 May 2019 21:09:34 +0000 (14:09 -0700)]
Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators."

This reverts commit 3e86cf36b5114f201868bf459934fe346a76a2d4.

5 years agoSolaris CI: Build with dilos2 stable
bgermann [Wed, 22 May 2019 20:43:24 +0000 (22:43 +0200)]
Solaris CI: Build with dilos2 stable

dilos2-testing has problems since the last repository update, so get the packages from dilos2 stable.

Fixes #61022.

5 years agoSuggest dereferencing on assignment to mutable borrow
Esteban Küber [Wed, 22 May 2019 20:10:38 +0000 (13:10 -0700)]
Suggest dereferencing on assignment to mutable borrow

5 years agoadd ui tests
Mark Mansi [Wed, 22 May 2019 17:20:43 +0000 (12:20 -0500)]
add ui tests

5 years agoRestore the old behavior of the rustdoc keyword check + Fix rebase
Vadim Petrochenkov [Mon, 13 May 2019 19:46:20 +0000 (22:46 +0300)]
Restore the old behavior of the rustdoc keyword check + Fix rebase

5 years agoEliminate unnecessary `Ident::with_empty_ctxt`s
Vadim Petrochenkov [Sat, 11 May 2019 16:08:09 +0000 (19:08 +0300)]
Eliminate unnecessary `Ident::with_empty_ctxt`s

5 years agoSimplify use of keyword symbols
Vadim Petrochenkov [Sat, 11 May 2019 14:41:37 +0000 (17:41 +0300)]
Simplify use of keyword symbols

5 years agoRollup merge of #61037 - oli-obk:clippy, r=Manishearth
Mazdak Farrokhzad [Wed, 22 May 2019 16:08:26 +0000 (18:08 +0200)]
Rollup merge of #61037 - oli-obk:clippy, r=Manishearth

Update clippy submodule

r? @Manishearth

If anyone is wondering where the odd old commits are coming from, we merged all beta backport commits and so into master in order to make sure we don't need to keep those branches around.

5 years agoRollup merge of #61034 - eddyb:soa-metadata-prereq, r=michaelwoerister
Mazdak Farrokhzad [Wed, 22 May 2019 16:08:24 +0000 (18:08 +0200)]
Rollup merge of #61034 - eddyb:soa-metadata-prereq, r=michaelwoerister

rustc_metadata: parametrize schema::CrateRoot by 'tcx and rip out old unused incremental infra.

These are the first two commits of #59953, already reviewed and approved by @michaelwoerister.

r? @michaelwoerister

5 years agoRollup merge of #61030 - spastorino:make-operand-iterate, r=oli-obk
Mazdak Farrokhzad [Wed, 22 May 2019 16:08:22 +0000 (18:08 +0200)]
Rollup merge of #61030 - spastorino:make-operand-iterate, r=oli-obk

Make maybe_codegen_consume_direct iterate instead of doing recursion

r? @oli-obk

5 years agoRollup merge of #61029 - blkerby:minimum_spanning_tree, r=alexcrichton
Mazdak Farrokhzad [Wed, 22 May 2019 16:08:21 +0000 (18:08 +0200)]
Rollup merge of #61029 - blkerby:minimum_spanning_tree, r=alexcrichton

Simplify RefCell minimum_spanning_tree example

This simplifies the implementation of the `minimum_spanning_tree` example of `RefCell` in the `cell` module-level docs, avoiding an unnecessary recursive call. This also eliminates the need for a block to contain the scope of the borrow in this example. But since that use of a block served an important didactic purpose, we make up for this by instead introducing a block in the initial, simpler example of `RefCell`, where the point will hopefully be conveyed to the reader more easily.

5 years agoRollup merge of #61023 - spastorino:use-iterate-qualify-consts, r=oli-obk
Mazdak Farrokhzad [Wed, 22 May 2019 16:08:19 +0000 (18:08 +0200)]
Rollup merge of #61023 - spastorino:use-iterate-qualify-consts, r=oli-obk

Migrate from recursion to iterate on qualify consts visitor impl

r? @oli-obk

5 years agoRollup merge of #60809 - jethrogb:jb/nll-faq, r=pnkfelix
Mazdak Farrokhzad [Wed, 22 May 2019 16:08:17 +0000 (18:08 +0200)]
Rollup merge of #60809 - jethrogb:jb/nll-faq, r=pnkfelix

Add FAQ for NLL migration

r? @pnkfelix

cc @oli-obk @davidtwco @Centril Since you've provided feedback on the warning wording before.

5 years agoRollup merge of #60773 - Aaron1011:fix/rustdoc-project-all, r=eddyb
Mazdak Farrokhzad [Wed, 22 May 2019 16:08:14 +0000 (18:08 +0200)]
Rollup merge of #60773 - Aaron1011:fix/rustdoc-project-all, r=eddyb

Always try to project predicates when finding auto traits in rustdoc

Fixes #60726

Previous, AutoTraitFinder would only try to project predicates when the
predicate type contained an inference variable. When finding auto
traits, we only project to try to unify inference variables - we don't
otherwise learn any new information about the required bounds.

However, this lead to failing to properly generate a negative auto trait
impl (indicating that a type never implements a certain auto trait) in
the following unusual scenario:

In almost all cases, a type has an (implicit) negative impl of an auto
trait due some other type having an explicit *negative* impl of that
auto trait. For example:

struct MyType<T> {
    field: *const T
}

has an implicit 'impl<T> !Send for MyType<T>', due to the explicit
negative impl (in libcore) 'impl<T: ?Sized> !Send for *const T'.

However, as exposed by the 'abi_stable' crate, this isn't always the
case. This minimzed example shows how a type can never implement
'Send', due to a projection error:

```
pub struct True;
pub struct False;

pub trait MyTrait {
    type Project;
}

pub struct MyStruct<T> {
    field: T
}

impl MyTrait for u8 {
    type Project = False;
}

unsafe impl<T> Send for MyStruct<T>
    where T: MyTrait<Project=True> {}

pub struct Wrapper {
    inner: MyStruct<u8>
}
```

In this example, `<u8 as MyTrait>::Project == True'
must hold for 'MyStruct<u8>: Send' to hold.
However, '<u8 as MyTrait>::Project == False' holds instead

To properly account for this unusual case, we need to call
'poly_project_and_unify' on *all* predicates, not just those with
inference variables. This ensures that we catch the projection error
that occurs above, and don't incorrectly determine that 'Wrapper: Send'
holds.

5 years agoRollup merge of #60300 - mjbshaw:ffi_types, r=rkruppe
Mazdak Farrokhzad [Wed, 22 May 2019 16:08:13 +0000 (18:08 +0200)]
Rollup merge of #60300 - mjbshaw:ffi_types, r=rkruppe

Allow null-pointer-optimized enums in FFI if their underlying representation is FFI safe

I'm not sure if this requires an RFC. I attempted to start [a discussion on internals.rust-lang.org](https://internals.rust-lang.org/t/options-ffi-safety-and-guarantees-for-abi-compatibility-with-nonnull-optimizations/9784) and when no one really objected I figured I'd go ahead and try implementing this.

This allows types like `Option<NonZeroU8>` to be used in FFI without triggering the `improper_ctypes` lint. This works by changing the `is_repr_nullable_ptr` function to consider an enum `E` to be FFI-safe if:

- `E` has no explicit `#[repr(...)]`.
- It only has two variants.
- One of those variants is empty (meaning it has no fields).
- The other variant has only one field.
- That field is one of the following:
  - `&T`
  - `&mut T`
  - `extern "C" fn`
  - `core::num::NonZero*`
  - `core::ptr::NonNull<T>`
  - `#[repr(transparent)] struct` wrapper around one of the types in this list.
- The size of `E` and its field are both known and are both the same size (implying `E` is participating in the nonnull optimization).

This logic seems consistent with [the Rust nomicon](https://doc.rust-lang.org/nomicon/repr-rust.html).

5 years agothese errors can happen after all
Mark Mansi [Wed, 22 May 2019 15:29:36 +0000 (10:29 -0500)]
these errors can happen after all

5 years agoDisable LLVM/debug assertions in gnu-full-bootstrap
Alex Crichton [Wed, 22 May 2019 15:02:19 +0000 (08:02 -0700)]
Disable LLVM/debug assertions in gnu-full-bootstrap

This builder already is very close to the 2 hour mark and the debug
assertions aren't really buying us anything over what all the other
containers are enabling, so let's disable them for this slow builder.

5 years agoBump compiler-builtins to 0.1.15
Alex Crichton [Mon, 20 May 2019 18:00:34 +0000 (11:00 -0700)]
Bump compiler-builtins to 0.1.15

This commit bumps the `compiler-builtins` dependency to 0.1.15 which
expects to have the source for `compiler-rt` provided externally if the
`c` feature is enabled. This then plumbs through the necessary support
in the build system to ensure that if the `llvm-project` directory is
checked out and present that we enable the `c` feature of
`compiler-builtins` and compile in all the C intrinsics.

5 years agoAllow null-pointer-optimized enums in FFI if their underlying representation is FFI...
Michael Bradshaw [Wed, 22 May 2019 13:49:43 +0000 (06:49 -0700)]
Allow null-pointer-optimized enums in FFI if their underlying representation is FFI safe

This allows types like Option<NonZeroU8> to be used in FFI without triggering the improper_ctypes lint. This works by changing the is_repr_nullable_ptr function to consider an enum E to be FFI-safe if:

- E has no explicit #[repr(...)].
- It only has two variants.
- One of those variants is empty (meaning it has no fields).
- The other variant has only one field.
- That field is one of the following:
  - &T
  - &mut T
  - extern "C" fn
  - core::num::NonZero*
  - core::ptr::NonNull<T>
  - #[repr(transparent)] struct wrapper around one of the types in this list.
- The size of E and its field are both known and are both the same size (implying E is participating in the nonnull optimization).

5 years agoMake maybe_codegen_consume_direct iterate instead of doing recursion
Santiago Pastorino [Wed, 22 May 2019 03:51:50 +0000 (05:51 +0200)]
Make maybe_codegen_consume_direct iterate instead of doing recursion

5 years agoUpdate clippy submodule
Oliver Scherer [Wed, 22 May 2019 11:12:37 +0000 (13:12 +0200)]
Update clippy submodule

5 years agorustc_metadata: rip out unused incremental infrastructure.
Eduard-Mihai Burtescu [Wed, 22 May 2019 09:16:48 +0000 (12:16 +0300)]
rustc_metadata: rip out unused incremental infrastructure.

5 years agorustc_metadata: parametrize schema::CrateRoot by 'tcx.
Eduard-Mihai Burtescu [Thu, 11 Apr 2019 07:22:02 +0000 (10:22 +0300)]
rustc_metadata: parametrize schema::CrateRoot by 'tcx.

5 years agoAuto merge of #59445 - alexreg:ban-multi-trait-objects-via-aliases, r=oli-obk
bors [Wed, 22 May 2019 08:22:17 +0000 (08:22 +0000)]
Auto merge of #59445 - alexreg:ban-multi-trait-objects-via-aliases, r=oli-obk

Ban multi-trait objects via trait aliases

Obviously, multi-trait objects are not normally supported, so they should not be supported via trait aliases.

This has been factored out from the previous PR https://github.com/rust-lang/rust/pull/55994 (see point 1).

r? @Centril

CC @nikomatsakis

------------------

### RELNOTES:

We now allow `dyn Send + fmt::Debug` with equivalent semantics to `dyn fmt::Debug + Send`.
That is, the order of the mentioned traits does not matter wrt. principal/not-principal traits.
This is a small change that might deserve a mention in the blog post because it is a language change but most likely not.

See https://github.com/rust-lang/rust/blob/ce2ee305f9165c037ecddddb5792588a15ff6c37/src/test/ui/traits/wf-trait-object-reverse-order.rs.

// @Centril

5 years agoAuto merge of #60840 - tmandry:preserve-scope-in-generator-mir, r=cramertj
bors [Wed, 22 May 2019 04:42:20 +0000 (04:42 +0000)]
Auto merge of #60840 - tmandry:preserve-scope-in-generator-mir, r=cramertj

Preserve local scopes in generator MIR

Part of #52924, depended upon by the generator layout optimization #60187.

This PR adds `StorageDead` statements in more places in generators, so we can see when non-`Drop` locals have gone out of scope and recover their storage.

The reason this is only done for generators is compiler performance. See https://github.com/rust-lang/rust/pull/60187#issuecomment-485637811 for what happens when we do this for all functions.

For `Drop` locals, we modify the `MaybeStorageLive` analysis to use `drop` to indicate that storage is no longer live for the local. Once `drop` returns or unwinds to our function, we implicitly assume that the local is `StorageDead`.

Instead of using `drop`, it is possible to emit more `StorageDead` statements in the MIR for `Drop` locals so we can handle all locals the same. I am fine with doing it that way, but this was the simplest approach for my purposes. It is also likely to be more performant.

r? @Zoxc (feel free to reassign)
cc @cramertj @eddyb @RalfJung @rust-lang/wg-async-await

5 years agoMigrate from recursion to iterate on qualify consts visitor impl
Santiago Pastorino [Tue, 21 May 2019 23:17:16 +0000 (01:17 +0200)]
Migrate from recursion to iterate on qualify consts visitor impl

5 years agoSimplify RefCell minimum_spanning_tree example
Brent Kerby [Wed, 22 May 2019 03:52:21 +0000 (21:52 -0600)]
Simplify RefCell minimum_spanning_tree example

5 years agoAuto merge of #61027 - Centril:rollup-oewauf1, r=Centril
bors [Wed, 22 May 2019 01:51:31 +0000 (01:51 +0000)]
Auto merge of #61027 - Centril:rollup-oewauf1, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #59742 (Move `edition` outside the hygiene lock and avoid accessing it)
 - #60581 (convert custom try macro to `?`)
 - #60963 (Update boxed::Box docs on memory layout)
 - #60973 (Avoid symbol interning in `file_metadata`.)
 - #60982 (Do not fail on child without DefId)
 - #60991 (LocalDecl push returns Local len)
 - #60995 (Add stream_to_parser_with_base_dir)
 - #60998 (static_assert: make use of anonymous constants)
 - #61003 (Remove impls for `InternedString`/string equality.)
 - #61006 (adjust deprecation date of mem::uninitialized)

Failed merges:

r? @ghost

5 years agoRollup merge of #61006 - RalfJung:maybe-uninit, r=Centril
Mazdak Farrokhzad [Wed, 22 May 2019 01:47:43 +0000 (03:47 +0200)]
Rollup merge of #61006 - RalfJung:maybe-uninit, r=Centril

adjust deprecation date of mem::uninitialized

In https://github.com/rust-lang/rust/pull/60445 we [decided](https://github.com/rust-lang/rust/pull/60445#issuecomment-488626308) that we'd deprecate for 1.38 instead of 1.40, but I forgot to adjust for that.