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
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)
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).
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.
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>
~~(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.)~~
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.
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.
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)
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)
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...
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
````
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.
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.
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)
Mark Rousskov [Tue, 16 Jul 2019 15:38:55 +0000 (11:38 -0400)]
Rollup merge of #62693 - alexcrichton:rm-travis-appveyor, r=Mark-Simulacrum
ci: Remove Travis/AppVeyor configuration
Now that we've fully moved to Azure Pipelines and bors has been updated
to only gate on Azure this commit removes the remaining Travis/AppVeyor
support contained in this repository. Most of the deletions here are
related to producing better output on Travis by folding certain
sections. This isn't supported by Azure so there's no need to keep it
around, and if Azure ever adds support we can always add it back!
Auto merge of #62322 - wesleywiser:promoted_query, r=oli-obk
Add a query to get the `promoted`s for a `mir::Body`
This is a builidng block toward removing a lot of duplicated code
between miri and the cosnt-propagator pass.
See this thread for more info:
https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Using.20.60InterpCx.60.20more/near/169030661
r? @spastorino but feel free to hand it off to somebody else
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
````
Auto merge of #62704 - Mark-Simulacrum:rollup-oi94s2j, r=Mark-Simulacrum
Rollup of 14 pull requests
Successful merges:
- #62103 (Add debug assertions to write_bytes and copy*)
- #62405 (Remove never_type feature requirement for exhaustive patterns)
- #62491 (Fix Pin urls in Option documentation)
- #62533 (Add missing links for CannotReallocInPlace type)
- #62634 (Less unsafe in the array example of MaybeUninit docs)
- #62639 (Make VaListImpl<'f> invariant over the 'f lifetime)
- #62646 (Tweak wording in feature gate errors)
- #62662 (add spaces in front of trait requirements in libcore/cell.rs)
- #62668 (Fix #62660)
- #62673 (miri validation: better error messages for dangling references)
- #62680 (Actually call `visit_block_entry` in `DataflowResultsConsumer`)
- #62685 (Add info about undefined behavior to as_ref suggestions)
- #62689 (Fix typo in RawWaker::new documentation)
- #62698 (SGX target: don't pretend to be GNU/Linux to LLVM)
Mark Rousskov [Mon, 15 Jul 2019 23:55:10 +0000 (19:55 -0400)]
Rollup merge of #62668 - goodmanjonathan:fix-62660, r=estebank
Fix #62660
If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE.
Mark Rousskov [Mon, 15 Jul 2019 23:55:06 +0000 (19:55 -0400)]
Rollup merge of #62639 - immunant:invariant_valistimpl, r=eddyb
Make VaListImpl<'f> invariant over the 'f lifetime
After doing some research on variance and going back to look at `VaList` and `VaListImpl`, I realized that `VaList<'a, 'f>` is invariant over the `'f` lifetime (and covariant over `'a`), but `VaListImpl<'f>` isn't invariant but probably should be. This patch makes `VaListImpl<'f>` invariant over `'f`.
Mark Rousskov [Mon, 15 Jul 2019 23:55:04 +0000 (19:55 -0400)]
Rollup merge of #62634 - llogiq:uninit-array-docs, r=RalfJung
Less unsafe in the array example of MaybeUninit docs
I believe this is an acceptable way to initialize elements of `[MaybeUninit<T>; _]` arrays. Miri agrees. Conceptually, we are working at the array level, above the `MaybeUninit`, and as we are replacing it wholesale, this should pose no problem to soundness. And the code is easier to read.
Mark Rousskov [Mon, 15 Jul 2019 23:54:58 +0000 (19:54 -0400)]
Rollup merge of #62103 - RalfJung:debug-assert, r=alexcrichton
Add debug assertions to write_bytes and copy*
Looks like @nitnelave went MIA in https://github.com/rust-lang/rust/pull/58783, so I am re-submitting their PR, tweaked just a bit. I took care to preserve commit authorship.
Alex Crichton [Mon, 15 Jul 2019 16:18:32 +0000 (09:18 -0700)]
ci: Remove Travis/AppVeyor configuration
Now that we've fully moved to Azure Pipelines and bors has been updated
to only gate on Azure this commit removes the remaining Travis/AppVeyor
support contained in this repository. Most of the deletions here are
related to producing better output on Travis by folding certain
sections. This isn't supported by Azure so there's no need to keep it
around, and if Azure ever adds support we can always add it back!
Auto merge of #62687 - gnzlbg:stdarch, r=alexcrichton
Update stdsimd to stdarch
The stdsimd repository no longer lives in `rust-lang-nursery/stdsimd` but now lives in `rust-lang/stdarch` instead. This PR updates the stdsimd submodule to the stdarch master branch.