]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agobless you nll
Eduard-Mihai Burtescu [Fri, 16 Aug 2019 12:54:11 +0000 (15:54 +0300)]
bless you nll

4 years agorustc_mir: use the right type for associated const literals.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 15:26:02 +0000 (18:26 +0300)]
rustc_mir: use the right type for associated const literals.

4 years agorustc_mir: add sanity asserts for the types of `ty::Const`s.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 15:15:45 +0000 (18:15 +0300)]
rustc_mir: add sanity asserts for the types of `ty::Const`s.

4 years agoRemove redundant `ty` fields from `mir::Constant` and `hair::pattern::PatternRange`.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 15:15:13 +0000 (18:15 +0300)]
Remove redundant `ty` fields from `mir::Constant` and `hair::pattern::PatternRange`.

4 years agoBless tests with --compare-mode=nll
sd234678 [Fri, 16 Aug 2019 10:48:39 +0000 (11:48 +0100)]
Bless tests with --compare-mode=nll

4 years agoAuto merge of #63596 - lzutao:update-miri, r=RalfJung
bors [Fri, 16 Aug 2019 10:42:02 +0000 (10:42 +0000)]
Auto merge of #63596 - lzutao:update-miri, r=RalfJung

submodules: Update miri

Closes #63581
r? @RalfJung

4 years agoUpdate stderr files with --bless
sd234678 [Fri, 9 Aug 2019 17:43:30 +0000 (18:43 +0100)]
Update stderr files with --bless

4 years agoRemove meaningless comments in src/test
sd234678 [Fri, 9 Aug 2019 14:14:05 +0000 (15:14 +0100)]
Remove meaningless comments in src/test

4 years agoCrateStore comment fix.
Edd Barrett [Fri, 16 Aug 2019 09:16:40 +0000 (10:16 +0100)]
CrateStore comment fix.

with -> which , and re-wrap line.

4 years agoFix a comment for the def_path_table.
Edd Barrett [Fri, 16 Aug 2019 09:14:15 +0000 (10:14 +0100)]
Fix a comment for the def_path_table.

The definition path table contains *all* definitions, not just public
definitions.

4 years agoAuto merge of #63627 - Centril:rollup-v8i7x5i, r=Centril
bors [Fri, 16 Aug 2019 06:53:13 +0000 (06:53 +0000)]
Auto merge of #63627 - Centril:rollup-v8i7x5i, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #62593 (Group all ABI tests.)
 - #63173 (Use libunwind from llvm-project submodule for musl targets)
 - #63535 (Continue refactoring resolve and hygiene)
 - #63539 (Suggest Rust 2018 on `<expr>.await` with no such field)
 - #63584 (libcore: more cleanups using `#![feature(associated_type_bounds)]`)
 - #63612 (Do not suggest `try_into` for base types inside of macro expansions)
 - #63615 (Fix typo in DoubleEndedIterator::nth_back doc)

Failed merges:

r? @ghost

4 years agoRollup merge of #63615 - jens1o:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Fri, 16 Aug 2019 06:26:42 +0000 (08:26 +0200)]
Rollup merge of #63615 - jens1o:patch-1, r=jonas-schievink

Fix typo in DoubleEndedIterator::nth_back doc

4 years agoRollup merge of #63612 - estebank:macro-sugg-try-into, r=Centril
Mazdak Farrokhzad [Fri, 16 Aug 2019 06:26:40 +0000 (08:26 +0200)]
Rollup merge of #63612 - estebank:macro-sugg-try-into, r=Centril

Do not suggest `try_into` for base types inside of macro expansions

4 years agoRollup merge of #63584 - Centril:cleanup-core-with-more-atb, r=alexreg
Mazdak Farrokhzad [Fri, 16 Aug 2019 06:26:39 +0000 (08:26 +0200)]
Rollup merge of #63584 - Centril:cleanup-core-with-more-atb, r=alexreg

libcore: more cleanups using `#![feature(associated_type_bounds)]`

Turns out this was indeed a bootstrapping issue from a test with `./x.py check` locally after https://github.com/rust-lang/rust/pull/63534 merged.

Closes https://github.com/rust-lang/rust/issues/63393

r? @alexreg
cc @iluuu1994
cc https://github.com/rust-lang/rust/issues/52662

4 years agoRollup merge of #63539 - Centril:2015.await, r=oli-obk
Mazdak Farrokhzad [Fri, 16 Aug 2019 06:26:38 +0000 (08:26 +0200)]
Rollup merge of #63539 - Centril:2015.await, r=oli-obk

Suggest Rust 2018 on `<expr>.await` with no such field

When type checking a field projection (`fn check_field`) to `<expr>.await` where `<expr>: τ` and `τ` is not a primitive type, suggest switching to Rust 2018. E.g.

```
error[E0609]: no field `await` on type `std::pin::Pin<&mut dyn std::future::Future<Output = ()>>`
  --> $DIR/suggest-switching-edition-on-await.rs:31:7
   |
LL |     x.await;
   |       ^^^^^ unknown field
   |
   = note: to `.await` a `Future`, switch to Rust 2018
   = help: set `edition = "2018"` in `Cargo.toml`
   = note: for more on editions, read https://doc.rust-lang.org/edition-guide
```

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

This PR also performs some preparatory cleanups in `fn check_field`; the last 2 commits are where the suggestion is introduced and tested respectively.

r? @varkor

4 years agoRollup merge of #63535 - petrochenkov:expndata, r=matthewjasper
Mazdak Farrokhzad [Fri, 16 Aug 2019 06:26:36 +0000 (08:26 +0200)]
Rollup merge of #63535 - petrochenkov:expndata, r=matthewjasper

Continue refactoring resolve and hygiene

The general goal is addressing FIXMEs from the previous PRs.

Merging similar data structures (+ prerequisites for such merging), accounting for the fact that all `ExpnId`s have associated data in `HygieneData` now (less `Option`s).

Also, some renaming.
This should be the last renaming session in this area, I think.

r? @matthewjasper

4 years agoRollup merge of #63173 - malbarbo:musl-libunwind, r=alexcrichton
Mazdak Farrokhzad [Fri, 16 Aug 2019 06:26:34 +0000 (08:26 +0200)]
Rollup merge of #63173 - malbarbo:musl-libunwind, r=alexcrichton

Use libunwind from llvm-project submodule for musl targets

This avoid downloading libunwind by using the scheme introduced in https://github.com/rust-lang/rust/pull/61544

4 years agoRollup merge of #62593 - kper:cleanup_abi, r=Centril
Mazdak Farrokhzad [Fri, 16 Aug 2019 06:26:33 +0000 (08:26 +0200)]
Rollup merge of #62593 - kper:cleanup_abi, r=Centril

Group all ABI tests.

r? @eddyb

Closes #62401

4 years agoModify librustc_llvm to pass -DNDEBUG while compiling.
Joel Galenson [Thu, 15 Aug 2019 19:55:03 +0000 (12:55 -0700)]
Modify librustc_llvm to pass -DNDEBUG while compiling.

Currently, librustc_llvm builds are not reproducible because the LLVM
files it compiles use the debug version of llvm_unreachable, which
uses __FILE__.  To fix this, we propagate NDEBUG from bootstrap if
applicable and use it when compiling librustc_llvm.

4 years agoFix typo in DoubleEndedIterator::nth_back doc
Jens Hausdorf [Thu, 15 Aug 2019 20:16:59 +0000 (22:16 +0200)]
Fix typo in DoubleEndedIterator::nth_back doc

4 years agoRemove `__rust_unstable_column`
Vadim Petrochenkov [Thu, 15 Aug 2019 19:58:57 +0000 (22:58 +0300)]
Remove `__rust_unstable_column`

4 years agoHygienize use of built-in macros in the standard library
Vadim Petrochenkov [Thu, 15 Aug 2019 18:23:11 +0000 (21:23 +0300)]
Hygienize use of built-in macros in the standard library

4 years agoDo not suggest `try_into` for base types inside of macro expansions
Esteban Küber [Thu, 15 Aug 2019 18:46:52 +0000 (11:46 -0700)]
Do not suggest `try_into` for base types inside of macro expansions

4 years agoresolve: `ParentScope::default` -> `ParentScope::module`
Vadim Petrochenkov [Thu, 15 Aug 2019 17:47:15 +0000 (20:47 +0300)]
resolve: `ParentScope::default` -> `ParentScope::module`

4 years agohygiene: `ExpnInfo` -> `ExpnData`
Vadim Petrochenkov [Tue, 13 Aug 2019 20:56:42 +0000 (23:56 +0300)]
hygiene: `ExpnInfo` -> `ExpnData`

For naming consistency with everything else in this area

4 years agohygiene: Merge a tiny bit of the "share expansion definition data" PR
Vadim Petrochenkov [Tue, 13 Aug 2019 20:39:48 +0000 (23:39 +0300)]
hygiene: Merge a tiny bit of the "share expansion definition data" PR

4 years agosyntax_pos: Remove the duplicate global edition
Vadim Petrochenkov [Tue, 13 Aug 2019 19:48:27 +0000 (22:48 +0300)]
syntax_pos: Remove the duplicate global edition

It was introduced to avoid going through `hygiene_data`, but now it's read only once, when `ParseSess` is created, so going through a lock is ok.

4 years agohygiene: Merge `ExpnInfo` and `InternalExpnData`
Vadim Petrochenkov [Tue, 13 Aug 2019 00:34:46 +0000 (03:34 +0300)]
hygiene: Merge `ExpnInfo` and `InternalExpnData`

4 years agoresolve: Add some comments to the main modules
Vadim Petrochenkov [Mon, 12 Aug 2019 23:46:42 +0000 (02:46 +0300)]
resolve: Add some comments to the main modules

4 years agoresolve: Privatize `BuildReducedGraphVisitor`
Vadim Petrochenkov [Mon, 12 Aug 2019 23:13:36 +0000 (02:13 +0300)]
resolve: Privatize `BuildReducedGraphVisitor`

4 years agoresolve: Make `ParentScope` `Copy`
Vadim Petrochenkov [Mon, 12 Aug 2019 22:39:10 +0000 (01:39 +0300)]
resolve: Make `ParentScope` `Copy`

By allocating its derive paths on the resolver arena.

4 years agoresolve: Eliminate `InvocationData`
Vadim Petrochenkov [Mon, 12 Aug 2019 20:39:49 +0000 (23:39 +0300)]
resolve: Eliminate `InvocationData`

It was very similar to `ParentScope` and mostly could be replaced by it.

4 years agoresolve: Add `ParentScope::default`, eliminate `dummy_parent_scope`
Vadim Petrochenkov [Mon, 12 Aug 2019 20:19:36 +0000 (23:19 +0300)]
resolve: Add `ParentScope::default`, eliminate `dummy_parent_scope`

Remove some unnecessary parameters from functions

4 years agoresolve: Do not "normalize away" trait/enum modules prematurely
Vadim Petrochenkov [Mon, 12 Aug 2019 18:55:42 +0000 (21:55 +0300)]
resolve: Do not "normalize away" trait/enum modules prematurely

The previous approach was brittle - what would happen if `ParentScope` wasn't created by `invoc_parent_scope`?
That's exactly the case for various uses of `ParentScope` in diagnostics and in built-in attribute validation.

4 years agoresolve: Move macro resolution traces from `Module`s to `Resolver`
Vadim Petrochenkov [Mon, 12 Aug 2019 18:52:37 +0000 (21:52 +0300)]
resolve: Move macro resolution traces from `Module`s to `Resolver`

Traces already contain module info without that.
It's easy to forget to call `finalize_*` on a module.
In particular, macros enum and trait modules weren't finalized.
By happy accident macros weren't placed into those modules until now.

4 years agohygiene: Remove `Option`s from functions returning `ExpnInfo`
Vadim Petrochenkov [Sun, 11 Aug 2019 00:00:05 +0000 (03:00 +0300)]
hygiene: Remove `Option`s from functions returning `ExpnInfo`

The expansion info is not optional and should always exist

4 years ago`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`
Vadim Petrochenkov [Sat, 10 Aug 2019 23:20:18 +0000 (02:20 +0300)]
`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`

`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.

4 years agosyntax_pos: `NO_EXPANSION`/`SyntaxContext::empty()` -> `SyntaxContext::root()`
Vadim Petrochenkov [Sat, 10 Aug 2019 22:44:55 +0000 (01:44 +0300)]
syntax_pos: `NO_EXPANSION`/`SyntaxContext::empty()` -> `SyntaxContext::root()`

For consistency with `ExpnId::root`.

Also introduce a helper `Span::with_root_ctxt` for creating spans with `SyntaxContext::root()` context

4 years agosyntax_pos: Introduce a helper for checking whether a span comes from expansion
Vadim Petrochenkov [Sat, 10 Aug 2019 22:08:30 +0000 (01:08 +0300)]
syntax_pos: Introduce a helper for checking whether a span comes from expansion

4 years agoDuplicate `test-macros.rs` to fix test #62593
Kevin Per [Thu, 15 Aug 2019 17:26:51 +0000 (19:26 +0200)]
Duplicate `test-macros.rs` to fix test #62593

4 years agosubmodules: Update miri
Lzu Tao [Thu, 15 Aug 2019 13:44:02 +0000 (13:44 +0000)]
submodules: Update miri

4 years agoRemove `run-pass` directory #62593
Kevin Per [Thu, 15 Aug 2019 15:07:38 +0000 (17:07 +0200)]
Remove `run-pass` directory #62593

4 years agoMove `test-macros.rs` back to `ui` to fix tests #62593
Kevin Per [Thu, 15 Aug 2019 15:05:49 +0000 (17:05 +0200)]
Move `test-macros.rs` back to `ui` to fix tests #62593

4 years agoMerge pull request #1 from Wind-River/vxworks_bpang_static
Baoshan [Thu, 15 Aug 2019 15:01:54 +0000 (08:01 -0700)]
Merge pull request #1 from Wind-River/vxworks_bpang_static

update for vxWorks

4 years agoGroup all ui tests and move to abi #62593
Kevin Per [Thu, 15 Aug 2019 14:00:54 +0000 (16:00 +0200)]
Group all ui tests and move to abi #62593

4 years agoadd sparc64-unknown-openbsd target
Sébastien Marie [Thu, 15 Aug 2019 13:34:23 +0000 (15:34 +0200)]
add sparc64-unknown-openbsd target

on OpenBSD, some architectures relies on libc++ (from LLVM) and some
others on libestdc++ (particular version of libstdc++ from GCC).

sparc64-unknown-openbsd needs libestdc++ and libgcc (as x86_64 some
years ago). Reintroduce the support of them for openbsd, only for
sparc64 arch. Some others architectures on OpenBSD could use them too.

4 years agoAuto merge of #63592 - Centril:rollup-7c6dg3e, r=Centril
bors [Thu, 15 Aug 2019 12:35:03 +0000 (12:35 +0000)]
Auto merge of #63592 - Centril:rollup-7c6dg3e, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #63155 (Add UWP MSVC targets)
 - #63165 (Add builtin targets for mips64(el)-unknown-linux-muslabi64)
 - #63306 (Adapt AddRetag for shallow retagging)
 - #63467 (Add Catalyst (iOS apps running on macOS) target)
 - #63546 (Remove uses of `mem::uninitialized()` from cloudabi)
 - #63572 (remove unused Level::PhaseFatal)
 - #63577 (Test HRTB issue accepted by compiler)
 - #63582 (Fix ICE #63226)
 - #63586 (cleanup: Remove `Spanned` where possible)

Failed merges:

r? @ghost

4 years agoRollup merge of #63586 - petrochenkov:nospanned, r=eddyb
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:34:10 +0000 (14:34 +0200)]
Rollup merge of #63586 - petrochenkov:nospanned, r=eddyb

cleanup: Remove `Spanned` where possible

It generally only makes sense on enums, otherwise it's more convenient to "flatten" it by adding a span field to the struct it wraps.

4 years agoRollup merge of #63582 - JohnTitor:fix-ice-63226, r=oli-obk
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:34:08 +0000 (14:34 +0200)]
Rollup merge of #63582 - JohnTitor:fix-ice-63226, r=oli-obk

Fix ICE #63226

Fixes #63226

r? @oli-obk

4 years agoRollup merge of #63577 - meffij:test-hrtb, r=alexcrichton
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:34:07 +0000 (14:34 +0200)]
Rollup merge of #63577 - meffij:test-hrtb, r=alexcrichton

Test HRTB issue accepted by compiler

Hi! First Rust PR, so if anything needs changing just let me know and I'll take care of it right away.

Closes #50301 which was marked E-needstest

4 years agoRollup merge of #63572 - matklad:no-phase-fatal, r=estebank
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:34:05 +0000 (14:34 +0200)]
Rollup merge of #63572 - matklad:no-phase-fatal, r=estebank

remove unused Level::PhaseFatal

r? @estebank

4 years agoRollup merge of #63546 - lzutao:clouldabi-maybeuninit, r=RalfJung
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:34:04 +0000 (14:34 +0200)]
Rollup merge of #63546 - lzutao:clouldabi-maybeuninit, r=RalfJung

Remove uses of `mem::uninitialized()` from cloudabi

This PR removes uses of `mem::uninitialized` from `cloudabi` module,
excluding the layout test in `src/libstd/sys/cloudabi/abi/cloudabi.rs`.

r? @RalfJung
cc @EdSchouten
cc #62397

4 years agoRollup merge of #63467 - terhechte:support-ios-catalyst-macabi-target-triple, r=estebank
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:34:02 +0000 (14:34 +0200)]
Rollup merge of #63467 - terhechte:support-ios-catalyst-macabi-target-triple, r=estebank

Add Catalyst (iOS apps running on macOS) target

This is a first attempt of adding support for the new [Apple Catalyst](https://developer.apple.com/ipad-apps-for-mac/) target (i.e. running iOS apps on macOS). Currently, `rustc` supports the iOS and iOS simulator targets for iOS:
- iOS: ARM cpu, iOS SDK, linked agains the iOS ABI
- Simulator: X86_64 cpu, iOS SDK, linked against the iOS ABI

Apple Catalyst will add an additional target:
- Macabi: X86_64 CPU, iOS SDK, linked again the macOS ABI.

Note, it the actual SDK is the also the macOS 10.15 SDK, but the symbols are the iOS SDK symbols as they were added to macOS with 10.15.

I've collected additional information via links in the open question sections below. This is way out of my comfort zone so please excuse whatever errors I may have made.

# Open Questions:

## Clang Version
It seems to me that `macabi` has not been merged into `clang` yet, I don't know whether that is a requirement rustc to compile, or if it is sufficient if the Clang that is used on a developers system is the correct one supporting macabi (that comes with current Xcode)

## Hardcoded iOS version

`swift-llvm` actually used [x86_64-apple-ios13.0-macabi](https://github.com/apple/swift-llvm/commit/3f1fd4f46a8e82cee6fffb284ee46daf8ddf66ae) as the target triple which hard-codes the current iOS version. A post on stackoverflow [points out that `MIN_IOS_VERSION` and `MIN_OSX_VERSION` should be used when compiling C code for clang (`-target x86_64-apple-ios${MIN_IOS_VERSION}-macabi`)](https://stackoverflow.com/questions/56487645/how-to-compile-a-3rd-party-library-to-be-used-with-uikit-for-mac-catalyst). However, I wasn't entirely sure how to do that in this PR. Pointers welcome.

## Data Layout
I'm probably using the wrong data-layout. I don't know whether it should be the macOS version or the iOS version. This is probably easier to answer for somebody who understands these things much better than me. I just copied the iOS Simulator X86_64 version as it seems to be (based on what I understand) that Catalyst is just the simulator target build against a different SDK.

# Current State
1. I got it to compile
2. I could successfully compile a `macabi` `libcore` via `cargo build --target x86_64-apple-ios-macabi`

I'm not sure what needs to be done next. Supposedly I need to compile everything into a toolchain somehow that I can then test via `rustup` to make sure that a binary compiled against the toolchain also works with Catalyst. [I read this article, but I'm still lost](https://www.reddit.com/r/rust/comments/5ag60z/how_do_i_bootstrap_rust_to_crosscompile_for_a_new/d9gicr2/) and would love pointers what to do next here.

# Additional Information
- [Commit adding Catalyst support to the Swift Clang Fork](https://github.com/CocoaPods/CocoaPods/issues/8877)
- [Compiling C to Catalyst Discussion](https://github.com/CocoaPods/CocoaPods/issues/8877)
- [CocoaPods Discussion on Adding Catalyst support](https://github.com/CocoaPods/CocoaPods/issues/8877)

4 years agoRollup merge of #63306 - RalfJung:retag, r=varkor
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:34:01 +0000 (14:34 +0200)]
Rollup merge of #63306 - RalfJung:retag, r=varkor

Adapt AddRetag for shallow retagging

With https://github.com/rust-lang/miri/pull/872, Miri only retags "bare" references, not those nested in compound types. This adjust `Retag` statement generation to don't emit retags if they are definitely not a bare reference.

I also expanded the mir-opt test to cover the `Retag` in the drop shim, which had previously not been tested.

4 years agoRollup merge of #63165 - xen0n:mips64-musl-targets, r=alexcrichton
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:34:00 +0000 (14:34 +0200)]
Rollup merge of #63165 - xen0n:mips64-musl-targets, r=alexcrichton

Add builtin targets for mips64(el)-unknown-linux-muslabi64

This is prerequisite for rust-lang/libc#1449.

Tested locally to produce working static and dynamic binaries, ~~but CI config is untested for now~~ CI is to be added in a follow-up PR.

*edit: dynamic binaries also confirmed working!*

*edit 2: changed triples to include ABI, and removed stray `crt_static_default = false` declarations to be consistent with other musl targets*

4 years agoRollup merge of #63155 - mfkl:uwp-msvc, r=alexcrichton
Mazdak Farrokhzad [Thu, 15 Aug 2019 12:33:58 +0000 (14:33 +0200)]
Rollup merge of #63155 - mfkl:uwp-msvc, r=alexcrichton

Add UWP MSVC targets

Hi,

- The README URI change is the correct one for VS2019 community edition, which I suspect most people would use. Doesn't _need_ to be merged though.
- This https://github.com/rust-lang/rust/commit/5e6619edd1a3b5c3f85438166d4d32af49f800fd fixes the UWP build (msvc or not, doesn't matter). I suspect it broke with recent changes unnoticed because no CI.
- Store lib location is found through the VCToolsInstallDir env variable. The end of the path is currently for the VS2019 store lib locations only.
- I could not test the aarch64_uwp_windows_msvc target because the rust build script does not currently support arm64 msvc AFAIU.

4 years agoUse libunwind from llvm-project submodule for musl targets
Marco A L Barbosa [Tue, 30 Jul 2019 19:31:26 +0000 (16:31 -0300)]
Use libunwind from llvm-project submodule for musl targets

4 years agoignore tests on wasm32-bare
Ralf Jung [Thu, 15 Aug 2019 10:54:56 +0000 (12:54 +0200)]
ignore tests on wasm32-bare

4 years agotest Retag in drop shim
Ralf Jung [Mon, 5 Aug 2019 20:27:00 +0000 (22:27 +0200)]
test Retag in drop shim

4 years agodon't add Retag statements for compound types
Ralf Jung [Sun, 4 Aug 2019 17:59:59 +0000 (19:59 +0200)]
don't add Retag statements for compound types

4 years agoFixing broken tests #62401
Kevin Per [Thu, 11 Jul 2019 17:40:09 +0000 (19:40 +0200)]
Fixing broken tests #62401

The grouping led to a lot of `mv`. Therefore, some relative paths were
wrong. In this commit the dependent files were also moved so that the paths
work again.

4 years agoGrouping ABI tests (2) #62401
Kevin Per [Tue, 9 Jul 2019 07:05:45 +0000 (09:05 +0200)]
Grouping ABI tests (2) #62401

4 years agoGrouping ABI test #62401
Kevin Per [Thu, 15 Aug 2019 09:37:19 +0000 (11:37 +0200)]
Grouping ABI test #62401

4 years agoRemove `Spanned` from `{ast,hir}::FieldPat`
Vadim Petrochenkov [Wed, 14 Aug 2019 23:35:36 +0000 (02:35 +0300)]
Remove `Spanned` from `{ast,hir}::FieldPat`

4 years agoRemove uses of `mem::uninitialized()` from cloudabi
Lzu Tao [Wed, 14 Aug 2019 04:39:21 +0000 (04:39 +0000)]
Remove uses of `mem::uninitialized()` from cloudabi

4 years agoRemove `Spanned` from `ast::Mac`
Vadim Petrochenkov [Wed, 14 Aug 2019 23:13:53 +0000 (02:13 +0300)]
Remove `Spanned` from `ast::Mac`

4 years agoRemove `Spanned` from `mk_name_value_item_str` and `expr_to_spanned_string`
Vadim Petrochenkov [Wed, 14 Aug 2019 22:56:44 +0000 (01:56 +0300)]
Remove `Spanned` from `mk_name_value_item_str` and `expr_to_spanned_string`

4 years agoUse is_const()
Yuki Okushi [Thu, 15 Aug 2019 08:33:21 +0000 (17:33 +0900)]
Use is_const()

4 years agolibcore: more cleanups using associated_type_bounds
Mazdak Farrokhzad [Thu, 15 Aug 2019 07:59:25 +0000 (09:59 +0200)]
libcore: more cleanups using associated_type_bounds

4 years agoAdjust regression test
Yuki Okushi [Thu, 15 Aug 2019 07:59:03 +0000 (16:59 +0900)]
Adjust regression test

4 years agoUse a match guard to avoid code repetition
Yuki Okushi [Thu, 15 Aug 2019 07:58:43 +0000 (16:58 +0900)]
Use a match guard to avoid code repetition

4 years agoAdd regression test for include_str! normalization
Aleksey Kladov [Thu, 15 Aug 2019 07:32:52 +0000 (10:32 +0300)]
Add regression test for include_str! normalization

4 years agoMake sure that all file loading happens via SourceMap
Aleksey Kladov [Tue, 13 Aug 2019 16:51:32 +0000 (19:51 +0300)]
Make sure that all file loading happens via SourceMap

That way, callers don't need to repeat "let's add this to sm manually
for tracking dependencies" trick.

It should make it easier to switch to using `FileLoader` for binary
files in the future as well

4 years agoCheck FnHeader not to cause ICE
Yuki Okushi [Thu, 15 Aug 2019 04:56:57 +0000 (13:56 +0900)]
Check FnHeader not to cause ICE

4 years agoAuto merge of #62429 - cuviper:iter-closures, r=cramertj
bors [Thu, 15 Aug 2019 04:24:29 +0000 (04:24 +0000)]
Auto merge of #62429 - cuviper:iter-closures, r=cramertj

Reduce the genericity of closures in the iterator traits

By default, closures inherit the generic parameters of their scope,
including `Self`. However, in most cases, the closures used to implement
iterators don't need to be generic on the iterator type, only its `Item`
type. We can reduce this genericity by redirecting such closures through
local functions.

This does make the closures more cumbersome to write, but it will
hopefully reduce duplication in their monomorphizations, as well as
their related type lengths.

4 years agoAuto merge of #63575 - Centril:rollup-anlv9g5, r=Centril
bors [Thu, 15 Aug 2019 00:32:05 +0000 (00:32 +0000)]
Auto merge of #63575 - Centril:rollup-anlv9g5, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #62984 (Add lint for excess trailing semicolons)
 - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`)
 - #63490 (libsyntax: cleanup and refactor `pat.rs`)
 - #63507 (When needing type annotations in local bindings, account for impl Trait and closures)
 - #63509 (Point at the right enclosing scope when using `await` in non-async fn)
 - #63528 (syntax: Remove `DummyResult::expr_only`)
 - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`)
 - #63542 (Add NodeId for Arm, Field and FieldPat)
 - #63543 (Merge Variant and Variant_)
 - #63560 (move test that shouldn't be in test/run-pass/)
 - #63570 (Adjust tracking issues for `MaybeUninit<T>` gates)

Failed merges:

r? @ghost

4 years agoTest HRTB issue accepted by compiler
nivlac [Wed, 14 Aug 2019 21:31:54 +0000 (14:31 -0700)]
Test HRTB issue accepted by compiler

4 years agoRollup merge of #63570 - rust-lang:maybe-uninit-gates, r=RalfJung
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:32 +0000 (22:56 +0200)]
Rollup merge of #63570 - rust-lang:maybe-uninit-gates, r=RalfJung

Adjust tracking issues for `MaybeUninit<T>` gates

cc #63566  #63567 #63568 #63569

r? @RalfJung

4 years agoRollup merge of #63560 - Centril:mv-generator-test, r=petrochenkov
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:31 +0000 (22:56 +0200)]
Rollup merge of #63560 - Centril:mv-generator-test, r=petrochenkov

move test that shouldn't be in test/run-pass/

We no longer test `src/test/run-pass/`; the proper way now is `// run-pass` in `src/test/ui/`

r? @petrochenkov

4 years agoRollup merge of #63543 - c410-f3r:variant, r=c410-f3r
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:29 +0000 (22:56 +0200)]
Rollup merge of #63543 - c410-f3r:variant, r=c410-f3r

Merge Variant and Variant_

Extracted from #63468.

4 years agoRollup merge of #63542 - c410-f3r:node_ids, r=petrochenkov
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:28 +0000 (22:56 +0200)]
Rollup merge of #63542 - c410-f3r:node_ids, r=petrochenkov

Add NodeId for Arm, Field and FieldPat

Extracted from #63468

4 years agoRollup merge of #63537 - petrochenkov:novisit, r=alexcrichton
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:27 +0000 (22:56 +0200)]
Rollup merge of #63537 - petrochenkov:novisit, r=alexcrichton

expand: Unimplement `MutVisitor` on `MacroExpander`

Each call to `fully_expand_fragment` is something unique, interesting, and requiring attention.
It represents a "root" of expansion and its use means that something unusual is happening, like eager expansion or expansion performed outside of the primary expansion pass.
So, it shouldn't hide under a generic visitor call.

Also, from all the implemented visitor methods only two were actually used.

cc https://github.com/rust-lang/rust/pull/63468#discussion_r313504119

4 years agoRollup merge of #63528 - petrochenkov:anyany, r=estebank
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:25 +0000 (22:56 +0200)]
Rollup merge of #63528 - petrochenkov:anyany, r=estebank

syntax: Remove `DummyResult::expr_only`

The effect is that if a built-in macro both returns an erroneous AST fragment and is used in unexpected position, then the incorrect position error won't be reported.

This combination of two errors should be rare and isn't worth an extra field that makes people ask questions in comments.
(There wasn't even a test making sure it worked.)

Addresses https://github.com/rust-lang/rust/pull/63468#discussion_r313504644
r? @estebank

4 years agoRollup merge of #63509 - estebank:async-span, r=Centril
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:24 +0000 (22:56 +0200)]
Rollup merge of #63509 - estebank:async-span, r=Centril

Point at the right enclosing scope when using `await` in non-async fn

Fix #63398.

4 years agoRollup merge of #63507 - estebank:type-inference-error, r=Centril
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:22 +0000 (22:56 +0200)]
Rollup merge of #63507 - estebank:type-inference-error, r=Centril

When needing type annotations in local bindings, account for impl Trait and closures

Fix https://github.com/rust-lang/rust/issues/46680, fix https://github.com/rust-lang/rust/issues/63504, fix https://github.com/rust-lang/rust/issues/63506, fix #40014, cc https://github.com/rust-lang/rust/issues/63502.

4 years agoRollup merge of #63490 - Centril:cleanup-pat-parser, r=petrochenkov
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:21 +0000 (22:56 +0200)]
Rollup merge of #63490 - Centril:cleanup-pat-parser, r=petrochenkov

libsyntax: cleanup and refactor `pat.rs`

A smaller refactoring & cleanup of `pat.rs` (best read commit by commit).

r? @petrochenkov

4 years agoRollup merge of #63075 - RalfJung:deref-checks, r=oli-obk
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:20 +0000 (22:56 +0200)]
Rollup merge of #63075 - RalfJung:deref-checks, r=oli-obk

Miri: Check that a ptr is aligned and inbounds already when evaluating `*`

This syncs Miri with what the Nomicon and the Reference say, and resolves https://github.com/rust-lang/miri/issues/447.

Also this would not have worked without https://github.com/rust-lang/rust/pull/62982 due to new cycles. ;)

r? @oli-obk

4 years agoRollup merge of #62984 - nathanwhit:extra_semi_lint, r=varkor
Mazdak Farrokhzad [Wed, 14 Aug 2019 20:56:18 +0000 (22:56 +0200)]
Rollup merge of #62984 - nathanwhit:extra_semi_lint, r=varkor

Add lint for excess trailing semicolons

Closes #60876.
A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning.

For the following example:
```
fn main() {
    extra_semis();
}
fn extra_semis() -> i32 {
    let mut sum = 0;;;
    for i in 0..10 {
        if i == 5 {
            continue;;
        } else if i == 9 {
            break;;
        } else {
            sum += i;;
        }
    }
    return sum;;
}
```
The output is:
```
warning: unnecessary trailing semicolons
 --> src/main.rs:5:21
  |
5 |     let mut sum = 0;;;
  |                     ^^ help: remove these semicolons
  |
  = note: `#[warn(redundant_semicolon)]` on by default

warning: unnecessary trailing semicolon
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:12:22
   |
12 |             sum += i;;
   |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^ help: remove this semicolon

warning: unreachable statement
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable statement
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^

warning: unreachable statement
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^

```

4 years agoAuto merge of #63534 - Mark-Simulacrum:stage0-bump, r=Centril
bors [Wed, 14 Aug 2019 20:49:07 +0000 (20:49 +0000)]
Auto merge of #63534 - Mark-Simulacrum:stage0-bump, r=Centril

Bump to 1.39

r? @Centril

4 years agoremove unused Level::PhaseFatal
Aleksey Kladov [Wed, 14 Aug 2019 19:22:46 +0000 (22:22 +0300)]
remove unused Level::PhaseFatal

4 years agoreview comments
Esteban Küber [Wed, 14 Aug 2019 19:14:25 +0000 (12:14 -0700)]
review comments

4 years agoAdjust tracking issues for `MaybeUninit<T>` gates
Mazdak Farrokhzad [Wed, 14 Aug 2019 18:07:37 +0000 (20:07 +0200)]
Adjust tracking issues for `MaybeUninit<T>` gates

4 years agoRemap debuginfo for all crates.
Joel Galenson [Wed, 14 Aug 2019 17:47:06 +0000 (10:47 -0700)]
Remap debuginfo for all crates.

4 years agoMerge Variant and Variant_
Caio [Wed, 14 Aug 2019 00:40:21 +0000 (21:40 -0300)]
Merge Variant and Variant_

4 years agomove test that shouldn't be in test/run-pass/
Mazdak Farrokhzad [Wed, 14 Aug 2019 16:04:33 +0000 (18:04 +0200)]
move test that shouldn't be in test/run-pass/

4 years agorustc_codegen_utils: account for 1-indexed anonymous lifetimes in v0 mangling.
Eduard-Mihai Burtescu [Wed, 14 Aug 2019 15:53:22 +0000 (18:53 +0300)]
rustc_codegen_utils: account for 1-indexed anonymous lifetimes in v0 mangling.

4 years agoRemap paths for proc-macro crates.
Joel Galenson [Wed, 14 Aug 2019 15:30:59 +0000 (08:30 -0700)]
Remap paths for proc-macro crates.

The remap-debuginfo config option remaps paths in most crates, but it
does not apply to proc-macros, so they are still non-reproducible.
This patch fixes that.

4 years agoremove special handling of \r\n from the lexer
Aleksey Kladov [Wed, 14 Aug 2019 13:38:40 +0000 (16:38 +0300)]
remove special handling of \r\n from the lexer

4 years agoconvert \r\n to \n when loading files
Aleksey Kladov [Wed, 14 Aug 2019 12:35:12 +0000 (15:35 +0300)]
convert \r\n to \n when loading files

4 years agoUpdate error-format to match new Cargo flags for pipelining
Alex Crichton [Mon, 12 Aug 2019 18:49:12 +0000 (14:49 -0400)]
Update error-format to match new Cargo flags for pipelining