Commit graph

96782 commits

Author SHA1 Message Date
Taiki Endo
2f64404ba3 Use Set1<Region> instead of Option<Region> 2019-07-27 12:28:04 +09:00
Taiki Endo
7b9a65ea6a Make is_self_ty a method on SelfVisitor 2019-07-27 12:28:03 +09:00
Taiki Endo
a1fd4fa848 Remove query for .pin_type() 2019-07-27 12:28:03 +09:00
Taiki Endo
e2eb957be0 Allow lifetime elision in Pin<&(mut) Self> 2019-07-27 12:28:02 +09:00
Stargateur
3334802c83 Refactoring use commun code between option, result and accum 2019-07-27 02:17:56 +02:00
bors
09e3989758 Auto merge of #62086 - petrochenkov:builtout, r=eddyb
Define built-in macros through libcore

This PR defines built-in macros through libcore using a scheme similar to lang items (attribute `#[rustc_builtin_macro]`).
All the macro properties (stability, visibility, etc.) are taken from the source code in libcore, with exception of the expander function transforming input tokens/AST into output tokens/AST, which is still provided by the compiler.

The macros are made available to user code through the standard library prelude (`{core,std}::prelude::v1`), so they are still always in scope.
As a result **built-in macros now have stable absolute addresses in the library**, like `core::prelude::v1::line!()`, this is an insta-stable change.

Right now `prelude::v1` is the only publicly available absolute address for these macros, but eventually they can be moved into more appropriate locations with library team approval (e.g. `Clone` derive -> `core::clone::Clone`).

Now when built-in macros have canonical definitions they can be imported or reexported without issues (https://github.com/rust-lang/rust/issues/61687).

Other changes:
- You can now define a derive macro with a name matching one of the built-in derives (https://github.com/rust-lang/rust/issues/52269). This was an artificial restriction that could be worked around with import renaming anyway.

Known regressions:
- Empty library crate with a crate-level `#![test]` attribute no longer compiles without `--test`. Previously it didn't compile *with* `--test` or with the bin crate type.

Fixes https://github.com/rust-lang/rust/issues/61687
Fixes https://github.com/rust-lang/rust/issues/61804
r? @eddyb
2019-07-26 23:29:02 +00:00
bors
c43753f910 Auto merge of #63015 - Centril:rollup-ydhpcas, r=Centril
Rollup of 22 pull requests

Successful merges:

 - #62084 (allow clippy::unreadable_literal in unicode tables)
 - #62120 (Add missing type links in documentation)
 - #62310 (Add missing doc links in boxed module)
 - #62421 (Introduce `as_deref` to Option)
 - #62583 (Implement Unpin for all raw pointers)
 - #62692 (rustc: precompute the largest Niche and store it in LayoutDetails.)
 - #62801 (Remove support for -Zlower-128bit-ops)
 - #62828 (Remove vector fadd/fmul reduction workarounds)
 - #62862 (code cleanup)
 - #62904 (Disable d32 on armv6 hf targets)
 - #62907 (Initialize the MSP430 AsmParser)
 - #62956 (Implement slow-path for FirstSets::first)
 - #62963 (Allow lexer to recover from some homoglyphs)
 - #62964 (clarify and unify some type test names)
 - #62970 (ci: gate toolstate repo pushes on the TOOLSTATE_PUBLISH envvar)
 - #62980 (std: Add more accessors for `Metadata` on Windows)
 - #62983 (Remove needless indirection through Rc)
 - #62985 (librustc_errors: Support ui-testing flag in annotate-snippet emitter)
 - #63002 (error_index_generator should output stdout/stderr when it panics.)
 - #63004 (Add test for issue-54062)
 - #63007 (ci: debug network failures while downloading awscli from PyPI)
 - #63009 (Remove redundant `mut` from variable declaration.)

Failed merges:

r? @ghost
2019-07-26 16:57:54 +00:00
Mazdak Farrokhzad
232d27c306
Rollup merge of #63009 - Rosto75:master, r=matklad
Remove redundant `mut` from variable declaration.
2019-07-26 18:57:08 +02:00
Mazdak Farrokhzad
0222498610
Rollup merge of #63007 - pietroalbini:debug-awscli-install, r=Mark-Simulacrum
ci: debug network failures while downloading awscli from PyPI

This adds some random debug code to our CI script while downloading awscli, to *hopefully* pinpoint what's causing the network failures.

r? @Mark-Simulacrum
cc #62967
2019-07-26 18:57:06 +02:00
Mazdak Farrokhzad
3a1ee9b70d
Rollup merge of #63004 - JohnTitor:add-tests-for-54062, r=Centril
Add test for issue-54062

The ICE is no longer reproduced.

Closes #54062
2019-07-26 18:57:05 +02:00
Mazdak Farrokhzad
8882e424f8
Rollup merge of #63002 - gilescope:better-build-diagnostics, r=Mark-Simulacrum
error_index_generator should output stdout/stderr when it panics.

**bootstrap change**

Call error_index_generator tool using run_quiet which will additionally print std out and std err of the command when it returns an error.
(was `run` uses `run_silent` under the covers.)

Why: PR #62871 is hitting a build error but the panic isn't getting shown so its unclear what the problem is.
2019-07-26 18:57:03 +02:00
Mazdak Farrokhzad
571a965143
Rollup merge of #62985 - phansch:support_ui_testing_flag, r=estebank
librustc_errors: Support ui-testing flag in annotate-snippet emitter

This adds support for the `-Z ui-testing` flag to the new
annotate-snippet diagnostic emitter.

Support for the flag was added to `annotate-snippet-rs` in these PRs:

* https://github.com/rust-lang/annotate-snippets-rs/pull/3
* https://github.com/rust-lang/annotate-snippets-rs/pull/5

r? @estebank

Closes #61811
2019-07-26 18:57:01 +02:00
Mazdak Farrokhzad
0614a94d67
Rollup merge of #62983 - Mark-Simulacrum:remove-needless-rc, r=petrochenkov
Remove needless indirection through Rc

NamedMatch is already cheap to clone due to Lrc's inside.
2019-07-26 18:56:59 +02:00
Mazdak Farrokhzad
15398b6b35
Rollup merge of #62980 - alexcrichton:windows-metadata, r=sfackler
std: Add more accessors for `Metadata` on Windows

This commit adds accessors for more fields in `fs::Metadata` on Windows
which weren't previously exposed. There's two sources of `fs::Metadata`
on Windows currently, one from `DirEntry` and one from a file itself.
These two sources of information don't actually have the same set of
fields exposed in their stat information, however. To handle this the
platform-specific accessors of Windows-specific information all return
`Option` to return `None` in the case a metadata comes from a
`DirEntry`, but they're guaranteed to return `Some` if it comes from a
file itself.

This is motivated by some changes in CraneStation/wasi-common#42, and
I'm curious how others feel about this platform-specific functionality!
2019-07-26 18:56:58 +02:00
Mazdak Farrokhzad
7e1ce7da80
Rollup merge of #62970 - pietroalbini:fix-tools-builder, r=alexcrichton
ci: gate toolstate repo pushes on the TOOLSTATE_PUBLISH envvar

This PR fixes toolstate failing to push on the LinuxTools PR builder by gating the pushes on the new `TOOLSTATE_PUBLISH` environment variable, which is set on prod credentials but not on the PR ones. The old code checked whether the access token was set, but that doesn't work due to an Azure quirk.

For a bit of background, secret environment variables are not available by default, but each step needs to explicitly declare which secret vars to load:

```yaml
- bash: echo foo
  env:
    SECRET_VAR: $(SECRET_VAR)
```

This works fine when the variable is present but when it's missing, instead of setting `SECRET_VAR` to an empty string or just not setting it at all, Azure Pipelines puts the literal `$(SECRET_VAR)` as the content, which completly breaks the old check we had. I tried almost every thing to make this work in a sensible way, and the only conclusion I reached is to set the variable at the top level with the runtime expression evaluation syntax, which sets the variable to an empty string if missing:

```yaml
# At the top:
variables:
  - name: MAYBE_SECRET_VAR
    value: $[ variables.MAYBE_SECRET_VAR ]

# In the step:
- bash: echo foo
  env:
    SECRET_VAR: $(MAYBE_SECRET_VAR)
```

While that *could've worked* it was ugly and messy, so I just opted to add yet another non-secret variable.

r? @alexcrichton
fixes #62811
2019-07-26 18:56:56 +02:00
Mazdak Farrokhzad
035078f73e
Rollup merge of #62964 - RalfJung:ty-tests, r=Centril
clarify and unify some type test names

* `is_mutable_pointer`: use `ptr` suffix for consistency with `is_region_ptr`, `is_fn_ptr`, `is_unsafe_ptr`.
* `is_pointer_sized`: the name is misleading as this only tests for pointer-sized *integers*, so rename to `is_ptr_sized_integral`.
2019-07-26 18:56:55 +02:00
Mazdak Farrokhzad
1893ac6db3
Rollup merge of #62963 - estebank:homoglyph-recovery, r=petrochenkov
Allow lexer to recover from some homoglyphs
2019-07-26 18:56:53 +02:00
Mazdak Farrokhzad
c6c8693b4c
Rollup merge of #62956 - ia0:fix_62831, r=petrochenkov
Implement slow-path for FirstSets::first

When 2 or more sequences share the same span, we can't use the precomputed map
for their first set. So we compute it recursively.

Fixes #62831.
2019-07-26 18:56:52 +02:00
Mazdak Farrokhzad
183aab3575
Rollup merge of #62907 - nikic:msp430-asmparser, r=alexcrichton
Initialize the MSP430 AsmParser

Hopefully fixes #59077.

r? @alexcrichton
2019-07-26 18:56:50 +02:00
Mazdak Farrokhzad
ba835dffe6
Rollup merge of #62904 - nikic:arm-d32, r=alexcrichton
Disable d32 on armv6 hf targets

We already do this on armv7 targets. It seems that this now gets enabled by default if '+vfp2` is specified, so disable it explicitly.

Hopefully fixes #62841.

r? @alexcrichton
2019-07-26 18:56:48 +02:00
Mazdak Farrokhzad
ceea0be207
Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichton
code cleanup

remove all codes that are not used by vxWorks
2019-07-26 18:56:47 +02:00
Mazdak Farrokhzad
5ffdca77c4
Rollup merge of #62828 - nikic:fadd-mul-reductions, r=eddyb
Remove vector fadd/fmul reduction workarounds

The bugs that this was working around have been fixed in LLVM 9.

r? @gnzlbg
2019-07-26 18:56:45 +02:00
Mazdak Farrokhzad
632ce7402f
Rollup merge of #62801 - bjorn3:remove_lower_128bit_ops, r=alexcrichton
Remove support for -Zlower-128bit-ops

It is broken and unused

cc https://github.com/rust-lang/rust/issues/58969

blocked https://github.com/rust-lang-nursery/compiler-builtins/pull/302 (removes definitions of the lang items removed in this PR)

r? @alexcrichton
2019-07-26 18:56:43 +02:00
Mazdak Farrokhzad
9d122670fd
Rollup merge of #62692 - eddyb:precompute-niches, r=oli-obk
rustc: precompute the largest Niche and store it in LayoutDetails.

Since we only ever can use at most one niche, it makes sense to just store that in the layout, for the simplest caching (especially as it's almost trivial to compute).

There might be a speedup from this, but even if it's marginal now, the caching would be a more significant benefit for future optimization attempts.
2019-07-26 18:56:41 +02:00
Mazdak Farrokhzad
d1f86c13e4
Rollup merge of #62583 - sfackler:unpin-raw, r=cramertj
Implement Unpin for all raw pointers

Like references and boxes, moving the pointer doesn't move the
pointed-to value, so this is safe.

r? @cramertj
2019-07-26 18:56:40 +02:00
Mazdak Farrokhzad
625aa60b3a
Rollup merge of #62421 - JohnTitor:U007D-master, r=alexcrichton
Introduce `as_deref` to Option

This is re-submission for #59628.
Renames `deref()` to `as_deref()` and adds `deref_mut()` impls and tests.

CC #50264

r? @Kimundi
(I picked you as you're the previous reviewer.)
2019-07-26 18:56:38 +02:00
Mazdak Farrokhzad
67009d3677
Rollup merge of #62310 - GuillaumeGomez:add-missing-doc-links-boxed, r=Centril
Add missing doc links in boxed module

r? @rust-lang/docs
2019-07-26 18:56:36 +02:00
Mazdak Farrokhzad
58b53d1add
Rollup merge of #62120 - GuillaumeGomez:add-missing-type-links, r=Centril
Add missing type links in documentation

r? @rust-lang/docs
2019-07-26 18:56:34 +02:00
Mazdak Farrokhzad
68d94bd741
Rollup merge of #62084 - euclio:unicode-table-tweak, r=kennytm
allow clippy::unreadable_literal in unicode tables

Also modifies the generation script to emit 2018 edition paths.
2019-07-26 18:56:33 +02:00
Pietro Albini
fb9f3e6dec
ci: add debug checks for pypi network outages 2019-07-26 18:51:01 +02:00
David Wood
cae8680544
lowering: Omit bare trait lint on macro call sites
This commit implements a hacky fix for detecting when a span is pointing
at a macro call site so that bare trait lints are not made incorrectly.
2019-07-26 17:31:39 +01:00
Niv Kaminer
d7b211025e add repr(transparent) to IoSliceMut where missing 2019-07-26 18:56:47 +03:00
Oliver Scherer
0cd71678e1
Update src/librustc_mir/interpret/memory.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
2019-07-26 17:44:11 +02:00
Oliver Scherer
6e04ca7fb6
Update src/librustc_mir/interpret/memory.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
2019-07-26 17:43:49 +02:00
Oliver Scherer
796e7a8d7c Address review comments 2019-07-26 17:12:10 +02:00
Alex Crichton
c69f367baf std: Add more accessors for Metadata on Windows
This commit adds accessors for more fields in `fs::Metadata` on Windows
which weren't previously exposed. There's two sources of `fs::Metadata`
on Windows currently, one from `DirEntry` and one from a file itself.
These two sources of information don't actually have the same set of
fields exposed in their stat information, however. To handle this the
platform-specific accessors of Windows-specific information all return
`Option` to return `None` in the case a metadata comes from a
`DirEntry`, but they're guaranteed to return `Some` if it comes from a
file itself.

This is motivated by some changes in CraneStation/wasi-common#42, and
I'm curious how others feel about this platform-specific functionality!
2019-07-26 07:35:59 -07:00
Tomasz Różański
4a2f9b6d62 Remove redundant mut from variable declaration. 2019-07-26 15:07:55 +02:00
Vadim Petrochenkov
8eaf17bca2 Introduce built-in macros through libcore 2019-07-26 13:09:54 +03:00
bors
1a56336286 Auto merge of #62914 - ehuss:update-cargo, r=alexcrichton
Update cargo

11 commits in e3563dbdcd2e370bc4f11d080f739d82d25773fd..d0f828419d6ce6be21a90866964f58eb2c07cd56
2019-07-16 19:22:44 +0000 to 2019-07-23 21:58:59 +0000
- Remove include/exclude glob warning. (rust-lang/cargo#7170)
- Optimize lock file format for git merge conflicts (rust-lang/cargo#7070)
- Set up CI with Azure Pipelines (rust-lang/cargo#7139)
- Force clippy to run. (rust-lang/cargo#7157)
- Work around rust-lang/rust#61440 (rust-lang/cargo#7158)
- initial working version of cargo fix --clippy (rust-lang/cargo#7069)
- Optimize runtime of `#[cargo_test_macro]` (rust-lang/cargo#7146)
- Don't fail if we can't acquire readonly lock (rust-lang/cargo#7149)
- Add support for multiple --features options (rust-lang/cargo#7084)
- Fix a typo in an env var name (rust-lang/cargo#7145)
- Add a way to disable all nightly tests (rust-lang/cargo#7142)
2019-07-26 08:57:13 +00:00
Yuki Okushi
328447279d Add test for issue-54062 2019-07-26 17:39:58 +09:00
Oliver Scherer
3bc1d01bb9 Clear up get_size_and_align 2019-07-26 10:34:54 +02:00
Ralf Jung
057606264f clarify and unify some type test names 2019-07-26 08:50:15 +02:00
Oliver Scherer
34e7a3cc4d Fix tidy 2019-07-26 08:10:09 +02:00
Giles Cope
9d796ebb5b run_quiet outputs stdout/stderr when things go wrong.
(was `run` uses `run_silent` under the covers.)
2019-07-26 06:16:40 +01:00
Eric Huss
78f25e308c Update cargo 2019-07-25 19:49:18 -07:00
bors
4268e7ee22 Auto merge of #60260 - videolabs:rust_uwp2, r=alexcrichton
Add support for UWP targets

Hi,

This pull request aims at adding support for UWP (Universal Windows Apps) platform.
A few notes:
- This requires a very recent mingw-w64 version (containing this commit and the previous related ones: e8c433c871 (diff-eefdfbfe9cec5f4ebab88c9a64d423a9))
- This was tested using LLVM/clang rather than gcc, and so far it assumes that LLVM/clang will be the native compiler. This is mostly due to the fact that the support for exceptions/stack unwinding for UWP got much more attention in libunwind
- The "uwp" part of the target needs support for it in the `cc-rs` & `backtrace-rs` crates. I'll create the MR there right after I submit this one and will link everything together, but I'm not sure what's the correct way of dealing with external dependencies in the context of rust
- Enabling import libraries and copying them across stages requires a change in cargo, for which I'll open a MR right after I submit this one as well
- The i686 stack unwinding is unsupported for now, because LLVM assumes SjLj, while rust seems to assume SEH will be used. I'm unsure how to fix this

Also, this is my first encounter with rust, so please bear with my code, it might not feel so idiomatic or even correct :)

I'm pretty sure there's a way of doing things in a cleaner way when it comes to win/c.rs, maybe having a UWP & desktop specific modules, and import those conditionally? It doesn't feel right to sprinkle `#[cfg(...)]` all over the place

Off course, I'll gladly update anything you see fit (to the extent of my abilities/knowledge :) )!

Thanks,
2019-07-26 02:18:12 +00:00
bors
18630677cf Auto merge of #62990 - Centril:rollup-k9n0hvs, r=Centril
Rollup of 15 pull requests

Successful merges:

 - #60066 (Stabilize the type_name intrinsic in core::any)
 - #60938 (rustdoc: make #[doc(include)] relative to the containing file)
 - #61884 (Stablize Euclidean Modulo (feature euclidean_division))
 - #61890 (Fix some sanity checks)
 - #62528 (Add joining slices of slices with a slice separator, not just a single item)
 - #62707 (Add tests for overlapping explicitly dropped locals in generators)
 - #62735 (Turn `#[global_allocator]` into a regular attribute macro)
 - #62822 (Improve some pointer-related documentation)
 - #62887 (Make the parser TokenStream more resilient after mismatched delimiter recovery)
 - #62921 (Add method disambiguation help for trait implementation)
 - #62930 (Add test for #51559)
 - #62942 (Use match ergonomics in Condvar documentation)
 - #62977 (Fix inconsistent highlight blocks.)
 - #62978 (Remove `cfg(bootstrap)` code for array implementations)
 - #62981 (Add note suggesting to borrow a String argument to find)

Failed merges:

 - #62964 (clarify and unify some type test names)

r? @ghost
2019-07-25 22:34:23 +00:00
Oliver Scherer
d9ac0c67ed Rewrite get_size_and_align so it doesn't duplicate work 2019-07-25 23:53:05 +02:00
Julien Cretin
df4b23e721 Implement slow-path for FirstSets::first
When 2 or more sequences share the same span, we can't use the precomputed map
for their first set. So we compute it recursively.

Fixes #62831.
2019-07-25 23:28:47 +02:00
Mazdak Farrokhzad
1a775b3b55
Rollup merge of #62981 - estebank:issue-62843, r=Centril
Add note suggesting to borrow a String argument to find

Fix #62843.
2019-07-25 23:21:13 +02:00