]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRemove SyntaxContext from {ast, hir}::{GlobalAsm, InlineAsm}
Matthew Jasper [Mon, 12 Aug 2019 21:12:53 +0000 (22:12 +0100)]
Remove SyntaxContext from {ast, hir}::{GlobalAsm, InlineAsm}

We now store it in the `Span` of the expression or item.

4 years agoMove type parameter shadowing errors to resolve
Matthew Jasper [Sun, 11 Aug 2019 17:09:50 +0000 (18:09 +0100)]
Move type parameter shadowing errors to resolve

For some reason type checking did this. Further it didn't consider
hygiene.

4 years agoRemove gensyms from built-in derives
Matthew Jasper [Sun, 11 Aug 2019 13:16:12 +0000 (14:16 +0100)]
Remove gensyms from built-in derives

Also make them generally more hygienic with name resolution.

4 years agoMake fmt-internal functions private
Matthew Jasper [Sun, 11 Aug 2019 12:31:11 +0000 (13:31 +0100)]
Make fmt-internal functions private

4 years agoMake built-in derives opaque macros
Matthew Jasper [Fri, 9 Aug 2019 20:15:00 +0000 (21:15 +0100)]
Make built-in derives opaque macros

4 years agoStop emulating cross-crate hygiene with gensyms
Matthew Jasper [Sun, 11 Aug 2019 10:48:22 +0000 (11:48 +0100)]
Stop emulating cross-crate hygiene with gensyms

Most `Ident`s are serialized as `InternedString`s the exceptions are:

* Reexports
* Attributes
* Idents in macro definitions

Using gensyms helped reexports emulate hygiene. However, the actual item
wouldn't have a gensymmed name so would be usable cross-crate. So
removing this case until we have proper cross-crate hygiene seems
sensible.

Codegen attributes (`inline`, `export_name`) are resolved by their
`Symbol`. This meant that opaque macro-expanded codegen attributes could
cause linker errors. This prevented making built-in derives hygienic.

4 years agoAuto merge of #63648 - Centril:rollup-2kpdrj1, r=Centril
bors [Sat, 17 Aug 2019 01:04:36 +0000 (01:04 +0000)]
Auto merge of #63648 - Centril:rollup-2kpdrj1, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #63149 (resolve: Populate external modules in more automatic and lazy way)
 - #63545 (Feature gate 'yield $expr?' pre-expansion)
 - #63548 (Update rustc-demangle to 0.1.16.)
 - #63558 (Remap paths for proc-macro crates.)
 - #63641 (add git keyword to submodule comments in config.example.toml)
 - #63642 (Rename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}.)

Failed merges:

r? @ghost

4 years agoRollup merge of #63642 - eddyb:wrap-it-up, r=rkruppe,Mark-Simulacrum
Mazdak Farrokhzad [Sat, 17 Aug 2019 01:03:02 +0000 (03:03 +0200)]
Rollup merge of #63642 - eddyb:wrap-it-up, r=rkruppe,Mark-Simulacrum

Rename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}.

These confused @Gankra, and then, also me, especially since `overflowing_*` *methods* also exist, but they map to `*_with_overflow` intrinsics!

r? @oli-obk / @nikomatsakis cc @Mark-Simulacrum (on the rustbuild workaround)

4 years agoRollup merge of #63641 - DieracDelta:master, r=eddyb
Mazdak Farrokhzad [Sat, 17 Aug 2019 01:03:01 +0000 (03:03 +0200)]
Rollup merge of #63641 - DieracDelta:master, r=eddyb

add git keyword to submodule comments in config.example.toml

I searched over config.example.toml file looking for a place to disable git submodules from being updated, and missed the two options related to this because they did not include the keyword git. This pr simply adds git to the relevant comments so hopefully others won't also miss that these options exist.

4 years agoRollup merge of #63558 - jgalenson:move-remap, r=alexcrichton
Mazdak Farrokhzad [Sat, 17 Aug 2019 01:02:59 +0000 (03:02 +0200)]
Rollup merge of #63558 - jgalenson:move-remap, r=alexcrichton

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.

I'm not completely sure if this is the best way to do this, but to get reproducible builds we need librustc_macros to be built with --remap-path-prefix.  I was previously modifying Cargo to pass that argument to all child crates, so this seems simpler and more correct.

I did not add a test since there do not seem to be any existing tests for RUSTC_DEBUGINFO_MAP.

r? @alexcrichton

4 years agoRollup merge of #63548 - eddyb:unicode-demangling, r=alexcrichton
Mazdak Farrokhzad [Sat, 17 Aug 2019 01:02:57 +0000 (03:02 +0200)]
Rollup merge of #63548 - eddyb:unicode-demangling, r=alexcrichton

Update rustc-demangle to 0.1.16.

Includes https://github.com/alexcrichton/rustc-demangle/pull/29 and https://github.com/alexcrichton/rustc-demangle/pull/30.
You can see the effects of the former in the testcase changes.

r? @alexcrichton cc @davidtwco @michaelwoerister

4 years agoRollup merge of #63545 - Centril:gate-yield-preexp, r=oli-obk
Mazdak Farrokhzad [Sat, 17 Aug 2019 01:02:56 +0000 (03:02 +0200)]
Rollup merge of #63545 - Centril:gate-yield-preexp, r=oli-obk

Feature gate 'yield $expr?' pre-expansion

Also improve the overall ergonomics of pre-expansion gating in general.

r? @Zoxc

4 years agoRollup merge of #63149 - petrochenkov:lazypop2, r=eddyb
Mazdak Farrokhzad [Sat, 17 Aug 2019 01:02:54 +0000 (03:02 +0200)]
Rollup merge of #63149 - petrochenkov:lazypop2, r=eddyb

resolve: Populate external modules in more automatic and lazy way

So, resolve had this function `populate_module_if_necessary` for loading module children from other crates from metadata.
I never really understood when it should've been called and when not.
This PR removes the function and loads the module children automatically on the first access instead.

r? @eddyb

4 years agoAuto merge of #63640 - Centril:rollup-yeb8o66, r=Centril
bors [Fri, 16 Aug 2019 18:35:17 +0000 (18:35 +0000)]
Auto merge of #63640 - Centril:rollup-yeb8o66, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #60492 (Add custom nth_back for Chain)
 - #61780 (Finalize the error type for `try_reserve`)
 - #63495 ( Remove redundant `ty` fields from `mir::Constant` and `hair::pattern::PatternRange`.)
 - #63525 (Make sure that all file loading happens via SourceMap)
 - #63595 (add sparc64-unknown-openbsd target)
 - #63604 (Some update for vxWorks)
 - #63613 (Hygienize use of built-in macros in the standard library)
 - #63632 (A couple of comment fixes.)
 - #63634 (ci: properly set the job name in CPU stats)
 - #63636 (ci: move linkcheck from mingw-2 to mingw-1)

Failed merges:

r? @ghost

4 years agoFix rebase
Vadim Petrochenkov [Fri, 16 Aug 2019 18:19:43 +0000 (21:19 +0300)]
Fix rebase

Move some code into `build_reduced_graph.rs` to keep `BuildReducedGraphVisitor` it private
Also move the def collector call to `build_reduced_graph.rs`, it belongs there.

4 years agoresolve: Move some code around
Vadim Petrochenkov [Thu, 15 Aug 2019 22:18:14 +0000 (01:18 +0300)]
resolve: Move some code around

4 years agoresolve: Populate external traits lazily as well
Vadim Petrochenkov [Thu, 15 Aug 2019 22:15:36 +0000 (01:15 +0300)]
resolve: Populate external traits lazily as well

4 years agoresolve: Populate external modules in more automatic and lazy way
Vadim Petrochenkov [Mon, 29 Jul 2019 18:19:50 +0000 (21:19 +0300)]
resolve: Populate external modules in more automatic and lazy way

The modules are now populated implicitly on the first access

4 years agoSimplify pre-expansion gating in general.
Mazdak Farrokhzad [Wed, 14 Aug 2019 04:09:11 +0000 (06:09 +0200)]
Simplify pre-expansion gating in general.

4 years agoFeature gate 'yield ?' pre-expansion.
Mazdak Farrokhzad [Wed, 14 Aug 2019 03:44:32 +0000 (05:44 +0200)]
Feature gate 'yield ?' pre-expansion.

4 years agorustbuild: work around the stdarch cfg(bootstrap) bug.
Eduard-Mihai Burtescu [Fri, 16 Aug 2019 17:12:10 +0000 (20:12 +0300)]
rustbuild: work around the stdarch cfg(bootstrap) bug.

4 years agoRename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}.
Eduard-Mihai Burtescu [Fri, 16 Aug 2019 17:02:31 +0000 (20:02 +0300)]
Rename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}.

4 years agoadd git keyword to submodule option
Justin Restivo [Fri, 16 Aug 2019 16:39:45 +0000 (12:39 -0400)]
add git keyword to submodule option

4 years agoRollup merge of #63636 - pietroalbini:ci-mingw, r=alexcrichton
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:34 +0000 (18:22 +0200)]
Rollup merge of #63636 - pietroalbini:ci-mingw, r=alexcrichton

ci: move linkcheck from mingw-2 to mingw-1

Running UI tests now takes a huge amount of time on mingw builders
(between 40 and 50 minutes), with mingw-1 builders taking even an hour
less to finish than mingw-2. This PR moves linkcheck from mingw-2 to
mingw-1, removing between 10 and 20 minutes of runtime on the -2
builders.

r? @alexcrichton

4 years agoRollup merge of #63634 - pietroalbini:cpu-stats-name, r=alexcrichton
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:33 +0000 (18:22 +0200)]
Rollup merge of #63634 - pietroalbini:cpu-stats-name, r=alexcrichton

ci: properly set the job name in CPU stats

r? @alexcrichton

4 years agoRollup merge of #63632 - vext01:vext01-comment-fixes, r=eddyb
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:31 +0000 (18:22 +0200)]
Rollup merge of #63632 - vext01:vext01-comment-fixes, r=eddyb

A couple of comment fixes.

This change fixes a couple of comments in the compiler code.

The first change was discussed with @eddyb. This one confused me because I thought only *public* defs were in the table (not so).

The second was a typo I noticed yesterday.

OK to go in?

4 years agoRollup merge of #63613 - petrochenkov:stdhyg, r=alexcrichton
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:30 +0000 (18:22 +0200)]
Rollup merge of #63613 - petrochenkov:stdhyg, r=alexcrichton

Hygienize use of built-in macros in the standard library

Same as https://github.com/rust-lang/rust/pull/61629, but for built-in macros.

Closes https://github.com/rust-lang/rust/issues/48781
r? @alexcrichton

4 years agoRollup merge of #63604 - Wind-River:master, r=alexcrichton
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:28 +0000 (18:22 +0200)]
Rollup merge of #63604 - Wind-River:master, r=alexcrichton

Some update for vxWorks

1. support crt-static
2. change armv7_wrs_vxworks to armv7_wrs_vxworks_eabihf.
3. change vx-cxx to wr-c++,  vx-ar to wr-ar and vx-run to wr-run.
4. code cleanup

r? @alexcrichton

4 years agoRollup merge of #63595 - semarie:openbsd-sparc64, r=alexcrichton
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:26 +0000 (18:22 +0200)]
Rollup merge of #63595 - semarie:openbsd-sparc64, r=alexcrichton

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 agoRollup merge of #63525 - matklad:centraliza-file-loading, r=petrochenkov
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:24 +0000 (18:22 +0200)]
Rollup merge of #63525 - matklad:centraliza-file-loading, r=petrochenkov

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

cc #62948

r? @petrochenkov

4 years agoRollup merge of #63495 - eddyb:mir-constant-ty, r=oli-obk
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:23 +0000 (18:22 +0200)]
Rollup merge of #63495 - eddyb:mir-constant-ty, r=oli-obk

 Remove redundant `ty` fields from `mir::Constant` and `hair::pattern::PatternRange`.

Fixes #56137.

As a side-effect, associated const literals have the correct type now, which should make things easier for #61041.

r? @oli-obk / @matthewjasper cc @davidtwco @varkor

4 years agoRollup merge of #61780 - SimonSapin:container-error, r=Amanieu
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:21 +0000 (18:22 +0200)]
Rollup merge of #61780 - SimonSapin:container-error, r=Amanieu

Finalize the error type for `try_reserve`

See tracking issue comments from https://github.com/rust-lang/rust/issues/48043#issuecomment-500828346.

It is now:

```rust
/// The error type for `try_reserve` methods.
#[derive(Clone, PartialEq, Eq, Debug)]
#[unstable(feature = "try_reserve", reason = "new API", issue="48043")]
pub enum TryReserveError {
    /// Error due to the computed capacity exceeding the collection's maximum
    /// (usually `isize::MAX` bytes).
    CapacityOverflow,

    /// The memory allocator returned an error
    AllocError {
        /// The layout of allocation request that failed
        layout: Layout,

        #[doc(hidden)]
        #[unstable(feature = "container_error_extra", issue = "0", reason = "\
            Enable exposing the allocator’s custom error value \
            if an associated type is added in the future: \
            https://github.com/rust-lang/wg-allocators/issues/23")]
        non_exhaustive: (),
    },
}

#[unstable(feature = "try_reserve", reason = "new API", issue="48043")]
impl From<LayoutErr> for TryReserveError {
    #[inline]
    fn from(_: LayoutErr) -> Self {
        TryReserveError::CapacityOverflow
    }
}
```

Changes:

* A `Layout` is included. Firefox wants to log the size of failed allocations. If this were not part of the return value of e.g. `HashMap::try_reserve`, users would only be able to estimate based on `HashMap::capacity` and assumptions about the allocation strategy of `HashMap`.

* There’s a dummy field that can stay unstable when `try_reserve` and the rest of this enum are stabilized. This forces non-exhaustive matching ~(https://github.com/rust-lang/rust/issues/44109 is not implemented yet for variants)~ and allows adding another field in the future if we want to expose custom error values from the allocator. See https://github.com/rust-lang/wg-allocators/issues/23.

  - If the `Alloc` trait is stabilized without an associated error type and with a zero-size `AllocErr` type, we can simply remove this dummy field.
  - If an associated type is added, we can add a default type parameter to `ContainerError` and a generic field to the `AllocError` variant.

* ~Moved from the `collections` module to the `alloc` module, and replaced `Collection` in the enum name with `Container`. The wold collection implies a multiplicity of items which is not relevant to this type. For example we may want to use this error type in a future `Box::try_new` method.~

  - Renamed to `TryReserveError`, after the methods that involve this type: https://github.com/rust-lang/rust/pull/61780#issuecomment-501392487

* Replaced `Err` with `Error` in the enum and variant names. There is more precedent for this in https://doc.rust-lang.org/std/error/trait.Error.html#implementors, `AllocErr` and `LayoutErr` are the odd ones.

* ~Dropped `Alloc` in the enum name. `ContainerAllocError` with a mouthful, and being in the `alloc` module already provides the same indication.~

4 years agoRollup merge of #60492 - acrrd:issues/54054_chain, r=SimonSapin
Mazdak Farrokhzad [Fri, 16 Aug 2019 16:22:20 +0000 (18:22 +0200)]
Rollup merge of #60492 - acrrd:issues/54054_chain, r=SimonSapin

Add custom nth_back for Chain

Implementation of nth_back for Chain.
Part of #54054

4 years agoAdd the Layout of the failed allocation to TryReserveError::AllocError
Simon Sapin [Wed, 12 Jun 2019 16:47:58 +0000 (18:47 +0200)]
Add the Layout of the failed allocation to TryReserveError::AllocError

… and add a separately-unstable field to force non-exhaustive matching
(`#[non_exhaustive]` is no implemented yet on enum variants)
so that we have the option to later expose the allocator’s error value.

CC https://github.com/rust-lang/wg-allocators/issues/23

4 years agoUpdate hashbrown to 0.5.0
Simon Sapin [Wed, 12 Jun 2019 16:31:32 +0000 (18:31 +0200)]
Update hashbrown to 0.5.0

4 years agoRename CollectionAllocError to TryReserveError
Simon Sapin [Wed, 12 Jun 2019 18:02:01 +0000 (20:02 +0200)]
Rename CollectionAllocError to TryReserveError

4 years agoci: move linkcheck from mingw-2 to mingw-1
Pietro Albini [Fri, 16 Aug 2019 15:02:01 +0000 (17:02 +0200)]
ci: move linkcheck from mingw-2 to mingw-1

Running UI tests now takes a huge amount of time on mingw builders
(between 40 and 50 minutes), with mingw-1 builders taking even an hour
less to finish than mingw-2. This PR moves linkcheck from mingw-2 to
mingw-1, removing between 10 and 20 minutes of runtime on the -2
builders.

4 years agoAuto merge of #63470 - Mark-Simulacrum:rustc-depdep, r=alexcrichton
bors [Fri, 16 Aug 2019 14:41:13 +0000 (14:41 +0000)]
Auto merge of #63470 - Mark-Simulacrum:rustc-depdep, r=alexcrichton

Utilize -Zbinary-dep-depinfo in rustbuild

We no longer utilize stamp-file mtimes at all inside rustbuild, and a future PR may be able to entirely eliminate them by eagerly copying to the appropriate sysroot. The only mtime-based dependency tracking left is for documentation because we lie to Cargo about the rustdoc binary, so Cargo does not track changes to the real binary, and codegen-backends because binary-dep-depinfo does not emit that information into the depfiles.

Both of these are fixable in the longer term but this existing patch gives us the following benefits:
 * We no longer delete Cargo target directories manually within a stage. Cross-stage, changes to codegen backends will still clear out target directories. This means that incremental state persists across individual steps (e.g., rebuilding libstd does not clear out librustc incremental state). Fixes #54712.
 * Dependency tracking across steps within a given stage is now fully precise. We will not clear out all codegen backend dependencies due to changes in librustc_driver, for example, only deleting the final librustc_codegen_llvm crate. Fixes #54008, fixes #50481.
 * We properly track codegen backends as a dependency (equivalent to rustc) across changes. Fixes #53284, and fixes #52719.
 * Cross-stage dependency tracking of crates is also much more accurate and reliable. Most likely fixes #49979 (but no reproduction steps in that issue). Fixes #59105.

cc #63012

4 years agoci: properly set the job name in CPU stats
Pietro Albini [Fri, 16 Aug 2019 13:36:55 +0000 (15:36 +0200)]
ci: properly set the job name in CPU stats

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 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 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 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