bors [Fri, 24 May 2019 19:22:13 +0000 (19:22 +0000)]
Auto merge of #60777 - pietroalbini:azure-pipelines, r=alexcrichton
Add Azure Pipelines configuration
Huge thanks to @johnterickson and @willsmythe for writing the initial config! :heart:
I applied some changes to the initial config and disabled most of the builders since we're not going to run all of them during the initial step for the evaluation.
[More details about our plans for the Azure Pipelines evaluation.](https://internals.rust-lang.org/t/update-on-the-ci-investigation/10056)
r? @alexcrichton @kennytm
cc @rust-lang/infra @ethomson @rylev
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`.
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.
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.
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.
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.
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.
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
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.
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`)
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.
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
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.
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.
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)
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.
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.
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.
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).
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.
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.
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).