]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #60913 - spastorino:place2_4, r=oli-obk
bors [Sun, 21 Jul 2019 03:25:05 +0000 (03:25 +0000)]
Auto merge of #60913 - spastorino:place2_4, r=oli-obk

Place 2.0 change from enum to struct

r? @oli-obk

4 years agoAuto merge of #62789 - GuillaumeGomez:update-pulldown-cmark, r=Manishearth
bors [Sat, 20 Jul 2019 12:21:28 +0000 (12:21 +0000)]
Auto merge of #62789 - GuillaumeGomez:update-pulldown-cmark, r=Manishearth

Update pulldown-cmark version

Fixes https://github.com/rust-lang/rust/issues/62571.
Fixes #62770.
Fixes #62552.

cc @rust-lang/rustdoc @Centril @pietroalbini

4 years agoUpdate pulldown-cmark version
Guillaume Gomez [Thu, 18 Jul 2019 21:37:27 +0000 (23:37 +0200)]
Update pulldown-cmark version

4 years agoAuto merge of #62710 - estebank:bad-named-args, r=petrochenkov
bors [Sat, 20 Jul 2019 06:18:52 +0000 (06:18 +0000)]
Auto merge of #62710 - estebank:bad-named-args, r=petrochenkov

Specific error for positional args after named args in `format!()`

When writing positional arguments after named arguments in the
`format!()` and `println!()` macros, provide a targeted diagnostic.

Follow up to https://github.com/rust-lang/rust/pull/57522/files#r247278885

4 years agoAvoid cloning Place in check_and_patch
Santiago Pastorino [Sat, 20 Jul 2019 01:40:33 +0000 (03:40 +0200)]
Avoid cloning Place in check_and_patch

4 years agoAvoid cloning Place in visit_rvalue
Santiago Pastorino [Fri, 19 Jul 2019 20:49:58 +0000 (22:49 +0200)]
Avoid cloning Place in visit_rvalue

4 years agoAvoid cloning Place in assign #2
Santiago Pastorino [Fri, 19 Jul 2019 20:49:17 +0000 (22:49 +0200)]
Avoid cloning Place in assign #2

4 years agoAvoid cloning Place in assign #1
Santiago Pastorino [Fri, 19 Jul 2019 20:41:52 +0000 (22:41 +0200)]
Avoid cloning Place in assign #1

4 years agoAvoid cloning Place in in_projection_structurally
Santiago Pastorino [Fri, 19 Jul 2019 20:18:03 +0000 (22:18 +0200)]
Avoid cloning Place in in_projection_structurally

4 years agoAvoid cloning Place in is_stable
Santiago Pastorino [Fri, 19 Jul 2019 20:11:57 +0000 (22:11 +0200)]
Avoid cloning Place in is_stable

4 years agoAvoid unneeded else branches
Santiago Pastorino [Fri, 19 Jul 2019 19:58:03 +0000 (21:58 +0200)]
Avoid unneeded else branches

4 years agoAvoid cloning Place in gather_init
Santiago Pastorino [Fri, 19 Jul 2019 19:49:34 +0000 (21:49 +0200)]
Avoid cloning Place in gather_init

4 years agoAvoid cloning Place in calculate_fake_borrows
Santiago Pastorino [Fri, 19 Jul 2019 19:33:13 +0000 (21:33 +0200)]
Avoid cloning Place in calculate_fake_borrows

4 years agoAvoid cloning Place in limit_capture_mutability
Santiago Pastorino [Fri, 19 Jul 2019 18:59:59 +0000 (20:59 +0200)]
Avoid cloning Place in limit_capture_mutability

4 years agoAvoid cloning Place in report_cannot_move_from_borrowed_content
Santiago Pastorino [Fri, 19 Jul 2019 18:53:31 +0000 (20:53 +0200)]
Avoid cloning Place in report_cannot_move_from_borrowed_content

4 years agoAvoid cloning Place in report_cannot_move_from_static
Santiago Pastorino [Fri, 19 Jul 2019 18:46:16 +0000 (20:46 +0200)]
Avoid cloning Place in report_cannot_move_from_static

4 years agoAvoid cloning Place in check_access_permissions
Santiago Pastorino [Fri, 19 Jul 2019 18:42:58 +0000 (20:42 +0200)]
Avoid cloning Place in check_access_permissions

4 years agoAvoid cloning Place in append_place_to_string
Santiago Pastorino [Fri, 19 Jul 2019 17:55:49 +0000 (19:55 +0200)]
Avoid cloning Place in append_place_to_string

4 years agoAvoid cloning Place in classify_drop_access_kind
Santiago Pastorino [Fri, 19 Jul 2019 17:36:47 +0000 (19:36 +0200)]
Avoid cloning Place in classify_drop_access_kind

4 years agoAvoid cloning Place in describe_place_for_conflicting_borrow
Santiago Pastorino [Fri, 19 Jul 2019 17:04:01 +0000 (19:04 +0200)]
Avoid cloning Place in describe_place_for_conflicting_borrow

4 years agoAvoid cloning Place in report_use_of_moved_or_uninitialized and friends
Santiago Pastorino [Thu, 11 Jul 2019 17:25:37 +0000 (19:25 +0200)]
Avoid cloning Place in report_use_of_moved_or_uninitialized and friends

4 years agoRemove explicit lifetime
Santiago Pastorino [Wed, 3 Jul 2019 19:39:12 +0000 (21:39 +0200)]
Remove explicit lifetime

4 years agoRemove explicit return from last line of fn
Santiago Pastorino [Wed, 3 Jul 2019 04:20:07 +0000 (06:20 +0200)]
Remove explicit return from last line of fn

4 years agoAvoid cloning Place in codegen_place
Santiago Pastorino [Tue, 2 Jul 2019 18:29:45 +0000 (20:29 +0200)]
Avoid cloning Place in codegen_place

4 years agoImplement Place::as_place_ref
Santiago Pastorino [Tue, 2 Jul 2019 19:01:20 +0000 (21:01 +0200)]
Implement Place::as_place_ref

4 years agoAvoid cloning place in LocalAnalyzer visitor
Santiago Pastorino [Mon, 1 Jul 2019 21:30:38 +0000 (23:30 +0200)]
Avoid cloning place in LocalAnalyzer visitor

4 years agoMigrate from Place enum to Place struct
Santiago Pastorino [Tue, 30 Apr 2019 16:58:24 +0000 (18:58 +0200)]
Migrate from Place enum to Place struct

4 years agoAuto merge of #62008 - ia0:issues_61053, r=petrochenkov
bors [Sat, 20 Jul 2019 02:39:04 +0000 (02:39 +0000)]
Auto merge of #62008 - ia0:issues_61053, r=petrochenkov

Add meta-variable checks in macro definitions

This is an implementation of #61053. It is not sound (some errors are not reported) and not complete (reports may not be actual errors). This is due to the possibility to define macros in macros in indirect ways. See module documentation of `macro_check` for more details.

What remains to be done:
- [x] Migrate from an error to an allow-by-default lint.
- [x] Add more comments in particular for the handling of nested macros.
- [x] Add more tests if needed.
- [x] Try to avoid cloning too much (one idea is to use lists on the stack).
- [ ] Run crater with deny-by-default lint (measure rate of false positives).
    - [ ] Remove extra commit for deny-by-default lint
- [x] Create a PR to remove the old `question_mark_macro_sep` lint #62160

4 years agoAuto merge of #62705 - petrochenkov:oh-bye-mark, r=matthewjasper
bors [Fri, 19 Jul 2019 21:11:23 +0000 (21:11 +0000)]
Auto merge of #62705 - petrochenkov:oh-bye-mark, r=matthewjasper

libsyntax: Rename `Mark` into `ExpnId`

"`Mark`" is an ID that identifies both a macro invocation (`foo!()`), and expansion process, and expansion result of that macro invocation.
The problem is that it's pretty hard to infer that from its name.

This PR renames it into `ExpnId` reflecting its meaning in most contexts.
(The contexts where it's meaning is closer to "macro invocation ID" are rarer.)

I've kept "mark" in the names of functions that add or remove marks to/from syntactic contexts, those marks are not just expansion IDs, but something more complex.

4 years agoImplement checks for meta-variables in macros
Julien Cretin [Thu, 30 May 2019 10:53:27 +0000 (12:53 +0200)]
Implement checks for meta-variables in macros

4 years agoRemember the span of the Kleene operator in macros
Julien Cretin [Wed, 29 May 2019 18:29:51 +0000 (20:29 +0200)]
Remember the span of the Kleene operator in macros

This is needed for having complete error messages where reporting macro variable
errors. Here is what they would look like:

error: meta-variable repeats with different kleene operator
  --> $DIR/issue-61053-different-kleene.rs:3:57
   |
LL |     ( $( $i:ident = $($j:ident),+ );* ) => { $( $( $i = $j; )* )* };
   |                                 - expected repetition   ^^   - conflicting repetition

4 years agoAuto merge of #62690 - alexcrichton:azure-update, r=pietroalbini
bors [Fri, 19 Jul 2019 15:49:18 +0000 (15:49 +0000)]
Auto merge of #62690 - alexcrichton:azure-update, r=pietroalbini

azure: Prepare configuration for 4-core machines

This commit updates some of our assorted Azure/CI configuration to
prepare for some 4-core machines coming online. We're still in the
process of performance testing them to get final numbers, but some
changes are worth landing ahead of this. The updates here are:

* Use `C:/` instead of `D:/` for submodule checkout since it should have
  plenty of space and the 4-core machines won't have `D:/`

* Update `lzma-sys` to 0.1.14 which has support for VS2019, where 0.1.10
  doesn't.

* Update `src/ci/docker/run.sh` to work when it itself is running inside
  of a docker container (see the comment in the file for more info)

* Print step timings on the `try` branch in addition to the `auto`
  branch in. The logs there should be seen by similarly many humans (not
  many) and can be useful for performance analysis after a `try` build
  runs.

* Install the WIX and InnoSetup tools manually on Windows instead of
  relying on pre-installed copies on the VM. This gives us more control
  over what's being used on the Azure cloud right now (we control the
  version) and in the 4-core machines these won't be pre-installed. Note
  that on AppVeyor we actually already were installing InnoSetup, we
  just didn't carry that over on Azure!

4 years agoazure: Prepare configuration for 4-core machines
Alex Crichton [Mon, 15 Jul 2019 15:23:56 +0000 (08:23 -0700)]
azure: Prepare configuration for 4-core machines

This commit updates some of our assorted Azure/CI configuration to
prepare for some 4-core machines coming online. We're still in the
process of performance testing them to get final numbers, but some
changes are worth landing ahead of this. The updates here are:

* Use `C:/` instead of `D:/` for submodule checkout since it should have
  plenty of space and the 4-core machines won't have `D:/`

* Update `lzma-sys` to 0.1.14 which has support for VS2019, where 0.1.10
  doesn't.

* Update `src/ci/docker/run.sh` to work when it itself is running inside
  of a docker container (see the comment in the file for more info)

* Print step timings on the `try` branch in addition to the `auto`
  branch in. The logs there should be seen by similarly many humans (not
  many) and can be useful for performance analysis after a `try` build
  runs.

* Install the WIX and InnoSetup tools manually on Windows instead of
  relying on pre-installed copies on the VM. This gives us more control
  over what's being used on the Azure cloud right now (we control the
  version) and in the 4-core machines these won't be pre-installed. Note
  that on AppVeyor we actually already were installing InnoSetup, we
  just didn't carry that over on Azure!

4 years agoAuto merge of #62679 - Xanewok:after-expansion, r=Zoxc
bors [Fri, 19 Jul 2019 10:38:09 +0000 (10:38 +0000)]
Auto merge of #62679 - Xanewok:after-expansion, r=Zoxc

Add an `after_expansion` callback in the driver

To format a given file RLS needs to know the Rust edition associated with it. It's not enough to look at the `edition` key in Cargo.toml - each crate target can have a different edition associated with it so the sure way to fetch a correct edition is to scan the input files used to compile a given crate target.

Right now this was done in the `after_analysis` callback of our shim, however this leads to other problems - if a crate cannot be successfully compiled (e.g. it has a type error) then a callback would not be invoked meaning we can't populate the files -> edition mapping.

However, doing this only after parsing is not enough, since expansion can pull in additional source files (e.g. by invoking `macro_rules! include_my_mod { () => { mod some_mod; }; }`).

Without copy-pasting the entire driver setup it's also not possible to expand the crate ourselves in the `after_parsing` callback - to expand crate we'd need to register plugins and initialize session ourselves. However, this is done normally after executing the callback itself, thus triggering the `Once::set` assertions in `Session::init_features`.

r? @Zoxc

cc @RalfJung @oli-obk this affects public driver interface used by Miri and Clippy

4 years agohygiene: Tweak naming some more
Vadim Petrochenkov [Mon, 15 Jul 2019 23:59:53 +0000 (02:59 +0300)]
hygiene: Tweak naming some more

4 years agoAdjust other names after the `Mark` renaming
Vadim Petrochenkov [Mon, 15 Jul 2019 22:42:58 +0000 (01:42 +0300)]
Adjust other names after the `Mark` renaming

4 years agolibsyntax: Remove `Mark` into `ExpnId`
Vadim Petrochenkov [Mon, 15 Jul 2019 22:04:05 +0000 (01:04 +0300)]
libsyntax: Remove `Mark` into `ExpnId`

4 years agoAuto merge of #62694 - lundibundi:help-infer-fn-ret, r=eddyb
bors [Fri, 19 Jul 2019 04:04:17 +0000 (04:04 +0000)]
Auto merge of #62694 - lundibundi:help-infer-fn-ret, r=eddyb

rustc_typeck: improve diagnostics for -> _ fn return type

This should implement IIUC the mentioned issue.

~~I'm not sure if there is a better way than `get_infer_ret_ty` to get/check the return type without code duplication.~~

~~Also, is this unwrap be okay `ty::Binder::bind(*tables.liberated_fn_sigs().get(hir_id).unwrap())`?~~

r? @eddyb
Closes: https://github.com/rust-lang/rust/issues/56132
4 years agoAuto merge of #62684 - petrochenkov:scopevisit, r=davidtwco
bors [Fri, 19 Jul 2019 00:24:39 +0000 (00:24 +0000)]
Auto merge of #62684 - petrochenkov:scopevisit, r=davidtwco

resolve: Improve candidate search for unresolved macro suggestions

Use same scope visiting machinery for both collecting suggestion candidates and actually resolving the names.

The PR is better read in per-commit fashion with whitespace changes ignored (the first commit in particular moves some code around).

This should be the last pre-requisite for https://github.com/rust-lang/rust/pull/62086.
r? @davidtwco

4 years agoAuto merge of #61749 - davidtwco:rfc-2203-const-array-repeat-exprs, r=eddyb
bors [Thu, 18 Jul 2019 20:41:40 +0000 (20:41 +0000)]
Auto merge of #61749 - davidtwco:rfc-2203-const-array-repeat-exprs, r=eddyb

rustc/rustc_mir: Implement RFC 2203.

This PR implements RFC 2203, allowing constants in array repeat
expressions. Part of #49147.

r? @eddyb

4 years agoAuto merge of #62782 - Mark-Simulacrum:rollup-1hz5ya6, r=Mark-Simulacrum
bors [Thu, 18 Jul 2019 17:03:37 +0000 (17:03 +0000)]
Auto merge of #62782 - Mark-Simulacrum:rollup-1hz5ya6, r=Mark-Simulacrum

Rollup of 15 pull requests

Successful merges:

 - #61926 (Fix hyperlinks in From impls between Vec and VecDeque)
 - #62615 ( Only error about MSVC + PGO + unwind if we're generating code)
 - #62696 (Check that trait is exported or public before adding hint)
 - #62712 (Update the help message on error for self type)
 - #62728 (Fix repeated wording in slice documentation)
 - #62730 (Consolidate hygiene tests)
 - #62732 (Remove last use of mem::uninitialized from std::io::util)
 - #62740 (Add missing link to Infallible in TryFrom doc)
 - #62745 (update data_layout and features for armv7-wrs-vxworks)
 - #62749 (Document link_section arbitrary bytes)
 - #62752 (Disable Z3 in LLVM build)
 - #62764 (normalize use of backticks in compiler messages for librustc/lint)
 - #62774 (Disable simd_select_bitmask test on big endian)
 - #62777 (Self-referencial type now called a recursive type)
 - #62778 (Emit artifact notifications for dependency files)

Failed merges:

 - #62746 ( do not use mem::uninitialized in std::io)

r? @ghost

4 years agoRollup merge of #62778 - jsgf:notify-dep-info, r=petrochenkov
Mark Rousskov [Thu, 18 Jul 2019 15:29:58 +0000 (11:29 -0400)]
Rollup merge of #62778 - jsgf:notify-dep-info, r=petrochenkov

Emit artifact notifications for dependency files

Emit `dep-info` artifact notifications for `.d` files.

4 years agoRollup merge of #62777 - gilescope:self-referencial-to-recursion, r=eddyb
Mark Rousskov [Thu, 18 Jul 2019 15:29:57 +0000 (11:29 -0400)]
Rollup merge of #62777 - gilescope:self-referencial-to-recursion, r=eddyb

Self-referencial type now called a recursive type

As per Boat's suggestion - #62539, this makes the error message clearer.

4 years agoRollup merge of #62774 - smaeul:pr/simd-tests, r=petrochenkov
Mark Rousskov [Thu, 18 Jul 2019 15:29:55 +0000 (11:29 -0400)]
Rollup merge of #62774 - smaeul:pr/simd-tests, r=petrochenkov

Disable simd_select_bitmask test on big endian

Per #59356 it is expected that the interpretation of the bitmask depends
on target endianness.

Closes #59356

4 years agoRollup merge of #62764 - fakenine:normalize_use_of_backticks_compiler_messages_p7...
Mark Rousskov [Thu, 18 Jul 2019 15:29:53 +0000 (11:29 -0400)]
Rollup merge of #62764 - fakenine:normalize_use_of_backticks_compiler_messages_p7, r=alexreg

normalize use of backticks in compiler messages for librustc/lint

https://github.com/rust-lang/rust/issues/60532

4 years agoRollup merge of #62752 - nikic:llvm-disable-z3, r=alexcrichton
Mark Rousskov [Thu, 18 Jul 2019 15:29:52 +0000 (11:29 -0400)]
Rollup merge of #62752 - nikic:llvm-disable-z3, r=alexcrichton

Disable Z3 in LLVM build

Avoid building LLVM with Z3 if it happens to be installed.

Fixes #62750.

r? @alexcrichton

4 years agoRollup merge of #62749 - chocol4te:fix_60633, r=estebank
Mark Rousskov [Thu, 18 Jul 2019 15:29:50 +0000 (11:29 -0400)]
Rollup merge of #62749 - chocol4te:fix_60633, r=estebank

Document link_section arbitrary bytes

Closes #60633.

4 years agoRollup merge of #62745 - BaoshanPang:master, r=nikic
Mark Rousskov [Thu, 18 Jul 2019 15:29:48 +0000 (11:29 -0400)]
Rollup merge of #62745 - BaoshanPang:master, r=nikic

update data_layout and features for armv7-wrs-vxworks

4 years agoRollup merge of #62740 - lzutao:patch-2, r=alexcrichton
Mark Rousskov [Thu, 18 Jul 2019 15:29:46 +0000 (11:29 -0400)]
Rollup merge of #62740 - lzutao:patch-2, r=alexcrichton

Add missing link to Infallible in TryFrom doc

4 years agoRollup merge of #62732 - nathanwhit:fix_mem_uninit, r=Amanieu
Mark Rousskov [Thu, 18 Jul 2019 15:29:45 +0000 (11:29 -0400)]
Rollup merge of #62732 - nathanwhit:fix_mem_uninit, r=Amanieu

Remove last use of mem::uninitialized from std::io::util

Addresses #62397 for std::io::util

4 years agoRollup merge of #62730 - matthewjasper:hygiene-tests, r=petrochenkov
Mark Rousskov [Thu, 18 Jul 2019 15:29:43 +0000 (11:29 -0400)]
Rollup merge of #62730 - matthewjasper:hygiene-tests, r=petrochenkov

Consolidate hygiene tests

Some general clean-up extracted out from another PR

4 years agoRollup merge of #62728 - DutchGhost:fix-double-wording, r=jonas-schievink
Mark Rousskov [Thu, 18 Jul 2019 15:29:42 +0000 (11:29 -0400)]
Rollup merge of #62728 - DutchGhost:fix-double-wording, r=jonas-schievink

Fix repeated wording in slice documentation

Changes `of the slice of the slice` to `of the slice` in the chunk- and friends documentation of slices

4 years agoRollup merge of #62712 - limira:self-type-help, r=estebank
Mark Rousskov [Thu, 18 Jul 2019 15:29:40 +0000 (11:29 -0400)]
Rollup merge of #62712 - limira:self-type-help, r=estebank

Update the help message on error for self type

Fix #62609

4 years agoRollup merge of #62696 - chocol4te:fix_#62194, r=estebank
Mark Rousskov [Thu, 18 Jul 2019 15:29:39 +0000 (11:29 -0400)]
Rollup merge of #62696 - chocol4te:fix_#62194, r=estebank

Check that trait is exported or public before adding hint

Closes #62194.

This PR checks the `AccessLevels` of a trait to check whether adding the intercrate ambiguity hint is valid or not.

I am unsure of both the use of `.unwrap()` as well as removing hints for [downstream *and* [upstream](https://github.com/rust-lang/rust/blob/92b0f52584c9375505ecdefdd7855b93a5919d51/src/librustc/traits/select.rs#L112-L142).

4 years agoRollup merge of #62615 - wesleywiser:pgo_error, r=nagisa
Mark Rousskov [Thu, 18 Jul 2019 15:29:37 +0000 (11:29 -0400)]
Rollup merge of #62615 - wesleywiser:pgo_error, r=nagisa

 Only error about MSVC + PGO + unwind if we're generating code

In #61853, we changed the error when using PGO & MSVC toolchain & panic=unwind into a warning. However, in the compiler team meeting on 2019-07-11, we found that not everybody was in favor of that change because of the possibility of broken binaries.

This PR reverts that change so this is again an error. However, to work around an [issue the Firefox team is having](https://github.com/rust-lang/rust/issues/61002#issuecomment-500075739), we will only emit the error if we're actually supposed to generate a binary. If the `rustc` is invoked with `--print` arguments (which means that no binary will actually be emitted), then we won't emit the error because there is not a possibility of the issue occurring.

cc @EricRahm @nikomatsakis @pnkfelix @Centril

4 years agoRollup merge of #61926 - scottmcm:vec-vecdeque, r=Mark-Simulacrum
Mark Rousskov [Thu, 18 Jul 2019 15:29:36 +0000 (11:29 -0400)]
Rollup merge of #61926 - scottmcm:vec-vecdeque, r=Mark-Simulacrum

Fix hyperlinks in From impls between Vec and VecDeque

I'd been trying to link them, but apparently actually just added brackets: <https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#impl-From%3CVec%3CT%3E%3E>

~~This reverts commit 5168f5d220d0b30d322f254f51142931a9054056.~~

~~(I'd previously tried to make relative links, but those failed linkcheck because the types are exported at different levels.  So just skip the links -- they're already linked in the function signature anyway.)~~

This makes the links now work.

4 years agoAuto merge of #62682 - alessandrod:issue-58375, r=eddyb
bors [Thu, 18 Jul 2019 13:09:01 +0000 (13:09 +0000)]
Auto merge of #62682 - alessandrod:issue-58375, r=eddyb

Normalize type parameters in create_mono_items_for_default_impls.

Fix for https://github.com/rust-lang/rust/issues/58375. I've added a test in `src/tests/run-pass` to reproduce the bug, not sure that's the best place for it.

See https://github.com/rust-lang/rust/issues/58375#issuecomment-509156977 for more context.

4 years agoresolve: Support resolving macro paths without macro kind restrictions
Vadim Petrochenkov [Mon, 15 Jul 2019 21:10:34 +0000 (00:10 +0300)]
resolve: Support resolving macro paths without macro kind restrictions

4 years agoresolve: Attempt to resolve unresolved paths in macro namespace
Vadim Petrochenkov [Mon, 15 Jul 2019 00:28:17 +0000 (03:28 +0300)]
resolve: Attempt to resolve unresolved paths in macro namespace

4 years agoresolve: Move some common code into the scope visitor
Vadim Petrochenkov [Sun, 14 Jul 2019 20:04:51 +0000 (23:04 +0300)]
resolve: Move some common code into the scope visitor

4 years agoresolve: Visit all scopes to collect suggestion candidates for unresolved macros
Vadim Petrochenkov [Thu, 11 Jul 2019 23:29:28 +0000 (02:29 +0300)]
resolve: Visit all scopes to collect suggestion candidates for unresolved macros

4 years agoresolve: Use `feature(custom_attribute)` fallback only if the feature is enabled
Vadim Petrochenkov [Thu, 11 Jul 2019 22:00:20 +0000 (01:00 +0300)]
resolve: Use `feature(custom_attribute)` fallback only if the feature is enabled

Normally `#![feature(...)]` shouldn't change behavior, but custom attributes in particular are in the process of retirement, and we should not produce a message telling to enable them.
It also helps with unifying diagnostics for unresolved macros.

4 years agoresolve: Decouple scope visiting process from visitor actions
Vadim Petrochenkov [Thu, 11 Jul 2019 20:05:35 +0000 (23:05 +0300)]
resolve: Decouple scope visiting process from visitor actions

4 years agoresolve: Rename `WhereToResolve` into `Scope`
Vadim Petrochenkov [Thu, 11 Jul 2019 18:45:43 +0000 (21:45 +0300)]
resolve: Rename `WhereToResolve` into `Scope`

Also move it into the crate root, it's no longer used for macros only

4 years agoresolve: Move some diagnostic code into `diagnostics.rs`
Vadim Petrochenkov [Thu, 11 Jul 2019 18:13:11 +0000 (21:13 +0300)]
resolve: Move some diagnostic code into `diagnostics.rs`

4 years agoAuto merge of #62671 - lzutao:tidy-lldb, r=alexcrichton
bors [Thu, 18 Jul 2019 08:38:56 +0000 (08:38 +0000)]
Auto merge of #62671 - lzutao:tidy-lldb, r=alexcrichton

Check for lldb existences

4 years agoEmit artifact notifications for dependency files
Jeremy Fitzhardinge [Thu, 18 Jul 2019 08:02:22 +0000 (01:02 -0700)]
Emit artifact notifications for dependency files

4 years agoSelf-referencial type renamed to recursive type.
Giles Cope [Thu, 18 Jul 2019 06:30:51 +0000 (07:30 +0100)]
Self-referencial type renamed to recursive type.

4 years agoAuto merge of #62669 - estebank:suggest-assoc-type, r=cramertj
bors [Thu, 18 Jul 2019 05:07:36 +0000 (05:07 +0000)]
Auto merge of #62669 - estebank:suggest-assoc-type, r=cramertj

Suggest assoc type on type not found in trait method definition

Given

```
trait A {
    type Bla;
    fn to_bla(&self) -> Bla;
}
```
suggest using `Self::Bla`:

```
error[E0412]: cannot find type `Bla` in this scope
  --> file.rs:3:25
   |
LL |     fn to_bla(&self) -> Bla;
   |                         ^^^ help: try: `Self::Bla`
```

Fix #62650.

4 years agoDisable simd_select_bitmask test on big endian
Samuel Holland [Thu, 18 Jul 2019 01:26:59 +0000 (20:26 -0500)]
Disable simd_select_bitmask test on big endian

Per #59356 it is expected that the interpretation of the bitmask depends
on target endianness.

Closes #59356

4 years agoAuto merge of #62733 - ehuss:update-mdbook, r=alexcrichton
bors [Wed, 17 Jul 2019 23:20:20 +0000 (23:20 +0000)]
Auto merge of #62733 - ehuss:update-mdbook, r=alexcrichton

Update mdbook, cargo, books

This updates the last of the books using mdbook 0.1, finally removing it from the build.  Cargo, the reference, and the rustc book were the last to change.  This should have a noticeable impact on CI times.

I decided to remove the version switcher from the rustbook tool.  It seemed a little awkward keeping it with one version.  If we ever need it in the future, we can always add it back, it is a relatively small amount of code.  I would just like to avoid the temptation to split the versions in the future.

## cargo

12 commits in 677a180f4c8ca1dcef594f68dd0e63e4f08621f5..e3563dbdcd2e370bc4f11d080f739d82d25773fd
2019-07-08 13:43:02 +0000 to 2019-07-16 19:22:44 +0000
- Add Cirrus CI badge to manifest (rust-lang/cargo#7119)
- Update mdbook to 0.3. (rust-lang/cargo#7140)
- Remove unused feature filter. (rust-lang/cargo#7131)
- Remove now-unused `WorkspaceResolve` (rust-lang/cargo#7127)
- Fix some clippy warnings. (rust-lang/cargo#7135)
- Also ignore remap-path-prefix in metadata for `cargo rustc`. (rust-lang/cargo#7134)
- Fix some formatting for some strings. (rust-lang/cargo#7129)
- Handle activation conflicts for `[patch]` sources (rust-lang/cargo#7118)
- [BETA] Fix `cargo new` in root directory. (rust-lang/cargo#7126)
- Remove MyFnOnce (rust-lang/cargo#7125)
- Don't suppress error messages with `-q` (rust-lang/cargo#7116)
- Fix changelog date (rust-lang/cargo#7115)

## book

2 commits in 6c0d83499c8e77e06a71d28c5e1adccec278d4f3..7ddc46460f09a5cd9bd2a620565bdc20b3315ea9
2019-06-23 20:25:30 -0400 to 2019-06-27 09:50:36 -0400
- reexport to re-export
- Fixes made in final layout check

## reference

4 commits in 7a5aab5fd50d6290679beb4cf42fa5f46ed22aec..8e7d614303b0dec7492e048e63855fcd3b944ec8
2019-06-20 17:38:52 +0200 to 2019-07-16 21:02:33 +0100
- Update to mdbook 0.3. (rust-lang-nursery/reference#641)
- Remove extra parenthesis (rust-lang-nursery/reference#621)
- Correct sentence about unsized coercions (rust-lang-nursery/reference#628)
- unions: call out field offset issues (rust-lang-nursery/reference#627)

## edition-guide

4 commits in f8072acde5ce29c7570d7986180bbded2d22e287..f6c8b92d4e63edd28e862be952f33861f35956f8
2019-06-14 23:27:05 +0200 to 2019-07-06 22:10:32 +0200
- Fix syntax highlighting in macro guide (rust-lang-nursery/edition-guide#182)
- Fix error example for modern compilers. (rust-lang-nursery/edition-guide#160)
- Try cargo install-upgrade for mdbook. (rust-lang-nursery/edition-guide#181)
- correct the travis build badge URL (rust-lang-nursery/edition-guide#180)

## embedded-book

2 commits in ef27b517dcd0b990c888c0d7caeff52a5a115619..ff334e74fdb9f197e621efa6d7c3105be892e888
2019-06-18 22:59:47 +0000 to 2019-07-16 13:47:34 +0000
- use_core() is required for #![no_std] compatible generated bindings  (rust-embedded/book#197)
- concurrency: update shared resource examples  (rust-embedded/book#196)

## nomicon

7 commits in 341c221116a8b9f1010cf1eece952b80c5ec7f54..b7f0aba2f88a8feade70595efcfa3438e54e96c0
2019-06-19 09:08:47 -0700 to 2019-07-11 15:11:36 -0400
- chore: Remove redundant Eq import
- Fix link to rfc1857
- Move word "reading" out of the link to "The Book"
- update the link to `mdbook`
- re-wrap more text
- re-wrap the text to 80 columns
- Better explain how to use `mdbook`

## rust-by-example

8 commits in 62b3ff2cb44dd8b648c3ef2a9347c3706d148014..e3679e214d8db44586aca9b20aa27517007d1923
2019-06-24 09:17:21 -0300 to 2019-07-15 11:13:44 -0300
- Collection of fixes for the 'Vectors` chapter. (rust-lang/rust-by-example#1216)
- Changed mutable collected_iterator into immutable (rust-lang/rust-by-example#1219)
- Fix minor formatting inconsistencies (rust-lang/rust-by-example#1220)
- Make `use` example runnable (rust-lang/rust-by-example#1215)
- Fix: Automatically Typo (rust-lang/rust-by-example#1214)
- Collection of fixes for the `Strings` chapter. (rust-lang/rust-by-example#1212)
- Added link to russian translation (rust-lang/rust-by-example#1213)
- A couple of fixes for the `HashMap` chapter. (rust-lang/rust-by-example#1211)

4 years agonormalize use of backticks in compiler messages for librustc/lint
Samy Kacimi [Tue, 16 Jul 2019 20:17:38 +0000 (22:17 +0200)]
normalize use of backticks in compiler messages for librustc/lint

https://github.com/rust-lang/rust/issues/60532

4 years agoTest case for #62506.
Giles Cope [Wed, 17 Jul 2019 17:31:25 +0000 (18:31 +0100)]
Test case for #62506.

4 years agoUpdate mdbook, cargo, books
Eric Huss [Mon, 8 Jul 2019 21:52:07 +0000 (14:52 -0700)]
Update mdbook, cargo, books

This updates the last of the books using mdbook 0.1, finally
removing it from the build.

4 years agoAuto merge of #62757 - pietroalbini:fix-linuxtools, r=alexcrichton
bors [Wed, 17 Jul 2019 19:40:33 +0000 (19:40 +0000)]
Auto merge of #62757 - pietroalbini:fix-linuxtools, r=alexcrichton

ci: fix LinuxTools PR builder missing environment variables

This PR includes the new `public-credentials` variables group in PR builders, hopefully fixing sccache and toolstate.

~~Do not merge this yet as I want to do a test build first.~~

r? @alexcrichton
fixes https://github.com/rust-lang/rust/issues/62754 https://github.com/rust-lang/rust/issues/62753

4 years agoRequested change
Ferdia McKeogh [Wed, 17 Jul 2019 17:55:44 +0000 (19:55 +0200)]
Requested change

4 years agoci: include public credentials in the linuxtools pr job
Pietro Albini [Wed, 17 Jul 2019 16:15:20 +0000 (18:15 +0200)]
ci: include public credentials in the linuxtools pr job

This allows the use of sccache to compile LLVM, and should fix toolstate
not working.

4 years agoAuto merge of #62688 - topecongiro:rustfmt-1.3.3, r=alexcrichton
bors [Wed, 17 Jul 2019 16:02:09 +0000 (16:02 +0000)]
Auto merge of #62688 - topecongiro:rustfmt-1.3.3, r=alexcrichton

Update rustfmt to 1.3.3

This PR updates rustfmt to 1.3.3 which fixes the bug in https://github.com/rust-lang/rust/pull/62432#issuecomment-509411620.

4 years agoDisable Z3 in LLVM build
Nikita Popov [Wed, 17 Jul 2019 14:59:14 +0000 (16:59 +0200)]
Disable Z3 in LLVM build

4 years agorustc_typeck: improve diagnostics for -> _ fn return type
Denys Otrishko [Mon, 15 Jul 2019 16:30:48 +0000 (19:30 +0300)]
rustc_typeck: improve diagnostics for -> _ fn return type

Closes: https://github.com/rust-lang/rust/issues/56132
4 years agorustc_typeck: extract common placeholder type diagnostic code
Denys Otrishko [Wed, 17 Jul 2019 06:55:15 +0000 (09:55 +0300)]
rustc_typeck: extract common placeholder type diagnostic code

4 years agoDocument link_section arbitrary bytes
Ferdia McKeogh [Wed, 17 Jul 2019 13:00:14 +0000 (15:00 +0200)]
Document link_section arbitrary bytes

4 years agoAuto merge of #61339 - jridgewell:pointer-alignment, r=BurntSushi
bors [Wed, 17 Jul 2019 12:13:36 +0000 (12:13 +0000)]
Auto merge of #61339 - jridgewell:pointer-alignment, r=BurntSushi

Optimize pointer alignment in utf8 validation

This uses (and reuses) the u8 arrays's inherent block alignment when checking whether the current index is block aligned.

I initially thought that this would just move the expensive `align_offset` call out of the while loop and replace it with a subtraction and bitwise AND. But it appears this optimizes much better, too...

before: https://rust.godbolt.org/z/WIPvWl
after: https://rust.godbolt.org/z/-jBPoW

## Benchmarks

https://github.com/jridgewell/faster-from_utf8/tree/pointer-alignment

```
test from_utf8_2_bytes_fast      ... bench:         310 ns/iter (+/- 42) = 1290 MB/s
test from_utf8_2_bytes_regular   ... bench:         309 ns/iter (+/- 24) = 1294 MB/s

test from_utf8_3_bytes_fast      ... bench:       1,027 ns/iter (+/- 62) = 1168 MB/s
test from_utf8_3_bytes_regular   ... bench:       1,513 ns/iter (+/- 611) = 793 MB/s

test from_utf8_4_bytes_fast      ... bench:       1,788 ns/iter (+/- 26) = 1342 MB/s
test from_utf8_4_bytes_regular   ... bench:       1,907 ns/iter (+/- 181) = 1258 MB/s

test from_utf8_all_bytes_fast    ... bench:       3,463 ns/iter (+/- 97) = 1155 MB/s
test from_utf8_all_bytes_regular ... bench:       4,083 ns/iter (+/- 89) = 979 MB/s

test from_utf8_ascii_fast        ... bench:          88 ns/iter (+/- 4) = 28988 MB/s
test from_utf8_ascii_regular     ... bench:          88 ns/iter (+/- 8) = 28988 MB/s

test from_utf8_cyr_fast          ... bench:       7,707 ns/iter (+/- 531) = 665 MB/s
test from_utf8_cyr_regular       ... bench:       8,202 ns/iter (+/- 135) = 625 MB/s

test from_utf8_enwik8_fast       ... bench:   1,135,756 ns/iter (+/- 84,450) = 8804 MB/s
test from_utf8_enwik8_regular    ... bench:   1,145,468 ns/iter (+/- 79,601) = 8730 MB/s

test from_utf8_jawik10_fast      ... bench:  12,723,844 ns/iter (+/- 473,247) = 785 MB/s
test from_utf8_jawik10_regular   ... bench:  13,384,596 ns/iter (+/- 666,997) = 747 MB/s

test from_utf8_mixed_fast        ... bench:       2,321 ns/iter (+/- 123) = 2081 MB/s
test from_utf8_mixed_regular     ... bench:       2,702 ns/iter (+/- 408) = 1788 MB/s

test from_utf8_mostlyasc_fast    ... bench:         249 ns/iter (+/- 10) = 14666 MB/s
test from_utf8_mostlyasc_regular ... bench:         276 ns/iter (+/- 5) = 13231 MB/s
```

4 years agoAuto merge of #62596 - cuviper:expect_none, r=rkruppe
bors [Wed, 17 Jul 2019 08:29:02 +0000 (08:29 +0000)]
Auto merge of #62596 - cuviper:expect_none, r=rkruppe

Add Option::expect_none(msg) and unwrap_none()

These are `Option` analogues to `Result::expect_err` and `unwrap_err`.

4 years agoupdate data_layout and features
Baoshan Pang [Wed, 17 Jul 2019 07:06:12 +0000 (00:06 -0700)]
update data_layout and features

4 years agoUpdate rustfmt to the latest master
topecongiro [Tue, 16 Jul 2019 10:35:22 +0000 (19:35 +0900)]
Update rustfmt to the latest master

4 years agoUpdate rustfmt to 1.3.3
topecongiro [Mon, 15 Jul 2019 13:51:42 +0000 (22:51 +0900)]
Update rustfmt to 1.3.3

4 years agoAdd missing link to Infallible in TryFrom doc
lzutao [Wed, 17 Jul 2019 03:44:12 +0000 (10:44 +0700)]
Add missing link to Infallible in TryFrom doc

4 years agoAuto merge of #62714 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Wed, 17 Jul 2019 02:49:51 +0000 (02:49 +0000)]
Auto merge of #62714 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from b0290424 to 164310dd

Changes:
````
Lint
Fix float_cmp false positive when comparing signum
grep only lines, that start with 'changelog: '
Get PR number from bors commit message
Authenticate with github_api_token
Check PRs for changelog entry in the body
Deny warnings in CI
Disable dogfood on windows for faster build time on travis
Revert "Remove `CARGO_INCREMENTAL=0` from windows build"
Remove `CARGO_INCREMENTAL=0` from windows build
Test with different sysroots dependent on the OS
Build sys_root in driver with PathBuf instead of String
Don't re-set the LD_LIBRARY_PATH in base_tests.sh
Add master toolchain binaries to the PATH
Change conditional
Stop allowing failures in Travis windows build
Fix bug in `implicit_hasher` causing crashes
Avoid rustfmt bug on Windows
Add rustfmt nightly to appveyor install
Work around rustup fallback error on Windows
Update documentation to the dev fmt command
Remove format checks from CI scripts again.
Remove format checks from CI script
Improve fmt test failure message
Fix crash on `dev --limit-stderr-length`
Add dev fmt subcommand
don't strip blank lines in lint documentation
````

4 years agoRemove last use of mem::uninitialized from std::io::util
nathanwhit [Tue, 16 Jul 2019 19:41:43 +0000 (15:41 -0400)]
Remove last use of mem::uninitialized from std::io::util

4 years agoAuto merge of #62592 - nikic:actually-update-llvm, r=alexcrichton
bors [Tue, 16 Jul 2019 23:05:06 +0000 (23:05 +0000)]
Auto merge of #62592 - nikic:actually-update-llvm, r=alexcrichton

Update to LLVM 9 trunk

Following the preparatory changes in #62474, this updates the LLVM submodule to https://github.com/rust-lang/llvm-project/tree/rustc/9.0-2019-07-12 and:

 * Changes the LLVM Rust bindings to account for the new SubtargetSubTypeKV.
 * Adjusts a codegen test for the new form of the byval attribute that takes a type.
 * Makes a PGO codegen test more liberal with regard to order and linkage.
 * Builds InstrProfilingPlatformWindows.c as part of libprofiler_builtins.
 * Moves registration of additional passes (in particular sanitizers) to the end of the module pass manager.
 * Disables LLDB on builders.

r? @alexcrichton

4 years agoMake pretty-expanded-hygiene a `ui` test
Matthew Jasper [Mon, 15 Jul 2019 21:26:45 +0000 (22:26 +0100)]
Make pretty-expanded-hygiene a `ui` test

`normalize-stdout-test` removes the need for Make, and it can be updated
with `--bless` this way

4 years agoChange all run-pass hygiene tests to `ui` tests
Matthew Jasper [Sun, 14 Jul 2019 10:34:13 +0000 (11:34 +0100)]
Change all run-pass hygiene tests to `ui` tests

Change some tests to `check-pass` that are only testing name resolution.

4 years agofound more repeated wording
Dodo [Tue, 16 Jul 2019 19:57:32 +0000 (21:57 +0200)]
found more repeated wording

4 years agofix double wording
Dodo [Tue, 16 Jul 2019 19:49:01 +0000 (21:49 +0200)]
fix double wording

4 years agoAuto merge of #61946 - BaoshanPang:vxworks, r=alexcrichton
bors [Tue, 16 Jul 2019 19:26:53 +0000 (19:26 +0000)]
Auto merge of #61946 - BaoshanPang:vxworks, r=alexcrichton

port rust for vxWorks

The supporting for vxWorks has been enabled in this branch. Although there are still a lots of work to do, I would like to upstream the code and fix the problems later.

Please let me know if there is anything I have to do before upstream the code.

r? @alexcrichton

Thanks,
Baoshan

4 years agoAuto merge of #62723 - Mark-Simulacrum:rollup-vjdzlam, r=Mark-Simulacrum
bors [Tue, 16 Jul 2019 15:50:44 +0000 (15:50 +0000)]
Auto merge of #62723 - Mark-Simulacrum:rollup-vjdzlam, r=Mark-Simulacrum

Rollup of 6 pull requests

Successful merges:

 - #62666 (Cancel unemitted diagnostics during error recovery)
 - #62683 (Chapter for `param_attrs`)
 - #62693 (ci: Remove Travis/AppVeyor configuration)
 - #62702 (normalize use of backticks in compiler messages for libsyntax_ext)
 - #62703 (normalize use of backticks in compiler messages for libsyntax/parse)
 - #62722 (ci: Bump time limit of tools builder on PRs)

Failed merges:

r? @ghost

4 years agoRollup merge of #62722 - alexcrichton:unlimit-tools, r=pietroalbini
Mark Rousskov [Tue, 16 Jul 2019 15:39:00 +0000 (11:39 -0400)]
Rollup merge of #62722 - alexcrichton:unlimit-tools, r=pietroalbini

ci: Bump time limit of tools builder on PRs

This should give it enough time to finish instead of being killed after
an hour.

4 years agoRollup merge of #62703 - fakenine:normalize_use_of_backticks_compiler_messages_p6...
Mark Rousskov [Tue, 16 Jul 2019 15:38:58 +0000 (11:38 -0400)]
Rollup merge of #62703 - fakenine:normalize_use_of_backticks_compiler_messages_p6, r=eddyb

normalize use of backticks in compiler messages for libsyntax/parse

https://github.com/rust-lang/rust/issues/60532

4 years agoRollup merge of #62702 - fakenine:normalize_use_of_backticks_compiler_messages_p5...
Mark Rousskov [Tue, 16 Jul 2019 15:38:57 +0000 (11:38 -0400)]
Rollup merge of #62702 - fakenine:normalize_use_of_backticks_compiler_messages_p5, r=Centril

normalize use of backticks in compiler messages for libsyntax_ext

https://github.com/rust-lang/rust/issues/60532