Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Sync upstream to get proc-macro goodness. #8

Merged
merged 1,523 commits into from
Mar 12, 2019
Merged

Sync upstream to get proc-macro goodness. #8

merged 1,523 commits into from
Mar 12, 2019

Conversation

vext01
Copy link
Member

@vext01 vext01 commented Mar 12, 2019

This syncs us with upstream so we can have the proc-macro stuff needed for in-compiler serde.

Sorry it took so long, the merge was non-trivial, and I messed it up first time.

ljedrz and others added 30 commits March 1, 2019 11:18
Remove NodeId from more HIR nodes

The next iteration of HirIdification (#57578).

Removes `NodeId` from:

- [x] `Stmt`
- [x] `Local`
- [x] `Field`
- [x] `AnonConst`
- [x] `TraitItem`
- [x] `ImplItem`
- [x] `TypeBinding`
- [x] `Arg`
- [x] `TraitRef`
- [x] `VisibilityKind`

It will most probably break clippy again; I'd appreciate a **delegate** again if/when it is good to go so I can attach a clippy fix later.

r? @Zoxc
This allows us to remove the "allow old toolchains" flag we pass to
LLVM, ensuring that we'll be up to date when LLVM needs us to be!
Previously, a promoted that contains a function item wouldn't have the
function items bounds propagated to
the main function body.
Type annotations are shared between the MIR of a function and the
promoted constants for that function, so keep them in the type checker
when we check the promoted MIR.
Update edition-guide

15 commits in 419edb885ec1a98c0747b3907003d79e3e6b93a9..5f3cc2a5618700efcde3bc00799744f21fa9ad2e
2018-12-04 16:43:38 -0500 to 2019-02-27 20:11:50 -0800
- Migrate to mdbook 0.2. (rust-lang/edition-guide#152)
- Remove automatic deployment. (rust-lang/edition-guide#151)
- Fix issue with rust's linkchecker and mdbook. (rust-lang/edition-guide#147)
- Fix test now that overflowing_literals is rejected in all editions. (rust-lang/edition-guide#148)
- overflowing_literals is deny on all editions (rust-lang/edition-guide#146)
- Update for uniform_path stabilization. (rust-lang/edition-guide#141)
- Add example to rustup to show overriding to specific version (rust-lang/edition-guide#144)
- Update for anonymous-lifetime stabilization. (rust-lang/edition-guide#142)
- Add minimum Rust version for Kleene operator (rust-lang/edition-guide#137)
- Add 2018-specific changes. (rust-lang/edition-guide#130)
- aborting-on-panic.md: Typo in example config (rust-lang/edition-guide#125)
- Clarify uniform paths are not yet in Rust 2018 (rust-lang/edition-guide#124)
- update several version numbers
- Fixes outdated link (rust-lang/edition-guide#131)
- Fixed typo in transitioning page. (rust-lang/edition-guide#127)
Add support for using a jobserver with Rayon

The Rayon changes are here: Zoxc/rayon#2

cc @alexcrichton
r? @nikomatsakis
The old logic would incorrectly look for "python2.exe" when searching
for "python2.7.exe".
Before this commit, if you're running x.py directly on a system where
`python` is symlinked to Python 3, then the `python` config option will
default to a Python 3 interpreter. This causes debuginfo tests to fail
with an opaque error message, since they have a hard requirement on
Python 2.

This commit modifies the Python probe behavior to look for python2.7 and
python2 *before* using the interpreter used to execute `x.py`.
Include bounds from promoted constants in NLL

Previously a promoted function wouldn't have its bound propagated out to
the main function body.

When we visit a promoted, we now type check the MIR of the promoted
and transfer any lifetime constraints to back to the main function's MIR.

Fixes #57170

r? @nikomatsakis
Add debug-info to access variables from generator state
 Set secure flags when opening a named pipe on Windows

Fixes rust-lang/rust#42036, see also the previous attempt in rust-lang/rust#44556.

Whether this is correct depends on if it is somehow possible to create a symlink to a named pipe, outside the named pipe filesystem (NPFS). But as far as I can tell that should be impossible.

Also fixes that `security_qos_flags(SECURITY_ANONYMOUS)` does not set the `SECURITY_SQOS_PRESENT` flag, and the incorrect documentation about the default value of `security_qos_flags`.
Have all methods of Filter and FilterMap use internal iteration

This PR changes `Filter::{next, next_back, count}` and `FilterMap::{next, next_back}` to all use internal iteration. The `next` and `next_back` methods are changed to directly forward to `try_for_each` and `try_rfold` respectively, using `Result` as the `Try` type. I think that's okay? Alternatively, I could change their implementations to use `LoopState` instead if there's any benefit in doing so.

r? @scottmcm
Centril and others added 20 commits March 9, 2019 17:18
MaybeUninit: add read_initialized, add examples

This adds a new `read_initialized` method, similar to suggestions by @Amanieu and @shepmaster. I also added examples to this and other methods.
look for python2 symlinks before bootstrap python

Before this commit, if you're running x.py directly on a system where
`python` is symlinked to Python 3, then the `python` config option will
default to a Python 3 interpreter. This causes debuginfo tests to fail
with an opaque error message, since they have a hard requirement on
Python 2.

This commit modifies the Python probe behavior to look for python2.7 and
python2 *before* using the interpreter used to execute `x.py`.
Refactor passes and pass execution to be more parallel

For `syntex_syntax` (with 16 threads and 8 cores):
- Cuts `misc checking 1` from `0.096s` to `0.08325s`.
- Cuts `misc checking 2` from `0.3575s` to `0.2545s`.
- Cuts `misc checking 3` from `0.34625s` to `0.21375s`.
- Cuts `wf checking` from `0.3085s` to `0.05025s`.

Reduces overall execution time for `syntex_syntax` (with 8 threads and cores) from `4.92s` to `4.34s`.

Subsumes rust-lang/rust#58494
Blocked on rust-lang/rust#58250

r? @michaelwoerister
Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const
Mention `unwind(aborts)` in diagnostics for `#[unwind]`

Simplify input validation for `#[unwind]`, add tests

cc rust-lang/rust#58760
r? @Mark-Simulacrum
Add as_slice() to slice::IterMut and vec::Drain

In indexmap-rs/indexmap#88, we found that there was no easy way to implement
`Debug` for our `IterMut` and `Drain` iterators. Those are built on
`slice::IterMut` and `vec::Drain`, which implement `Debug` themselves,
but have no other way to access their data. With a new `as_slice()`
method, we can read the data and customize its presentation.
std: Delete a by-definition spuriously failing test

This commit deletes the `connect_timeout_unbound` test from the standard
library which, unfortunately, is by definition eventually going to be a
spuriously failing test. There's no way to reserve a port as unbound so
we can rely on ecosystem testing for this feature for now.

Closes #52590
… r=Centril

Expose new_sub_parser_from_file

This function is useful when external tools like rustfmt want to parse
internal files without parsing a whole crate.

cc rust-lang/rustfmt#3427.
Rollup of 13 pull requests

Successful merges:

 - #58518 (Use early unwraps instead of bubbling up errors just to unwrap in the end)
 - #58626 (rustdoc: add option to calculate "documentation coverage")
 - #58629 (rust-lldb: fix crash when printing empty string)
 - #58660 (MaybeUninit: add read_initialized, add examples)
 - #58670 (fixes rust-lang#52482)
 - #58676 (look for python2 symlinks before bootstrap python)
 - #58679 (Refactor passes and pass execution to be more parallel)
 - #58750 (Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const)
 - #58762 (Mention `unwind(aborts)` in diagnostics for `#[unwind]`)
 - #58924 (Add as_slice() to slice::IterMut and vec::Drain)
 - #58990 (Actually publish miri in the manifest)
 - #59018 (std: Delete a by-definition spuriously failing test)
 - #59045 (Expose new_sub_parser_from_file)

Failed merges:

r? @ghost
Make the rustc driver and interface demand driven

This introduces a new crate `rustc_interface` which is the canonical interface for creating and using the compiler. It allows you to access a `Compiler` type in a closure and that types have methods to run passes on demand. The interesting parts are found [here (defining the queries)](https://github.com/Zoxc/rust/blob/rustc-interface/src/librustc_interface/queries.rs#L78) and [here (methods to create a `Compiler`)](https://github.com/Zoxc/rust/blob/rustc-interface/src/librustc_interface/interface.rs).

cc @rust-lang/compiler @rust-lang/dev-tools @rust-lang/rustdoc
This removes some tests from the i686-gnu job. This job clocks in at 2hr 56min, and removing these should cut about 10 to 15 minutes, giving a little more breathing room. I suspect these don't need to be tested on every platform.
CI: Trim some tests from i686-gnu

This removes some tests from the i686-gnu job. This job clocks in at 2hr 56min, and removing these should cut about 10 to 15 minutes, giving a little more breathing room. I suspect these don't need to be tested on every platform.
Don't promote function calls to nonpromotable things

fixes rust-lang/rust#58767 and fixes rust-lang/rust#58634

r? @eddyb

should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
Make migrate mode work at item level granularity

Migrate mode now works entirely at the item level rather than the body level,
ensuring that we don't lose any errors in contained closures.

Closes #58776

r? @pnkfelix
@vext01
Copy link
Member Author

vext01 commented Mar 12, 2019

bors try

bors bot added a commit that referenced this pull request Mar 12, 2019
@bors
Copy link
Contributor

bors bot commented Mar 12, 2019

try

Build succeeded

@ltratt
Copy link
Member

ltratt commented Mar 12, 2019

bors r+

bors bot added a commit that referenced this pull request Mar 12, 2019
8: Sync upstream to get proc-macro goodness. r=ltratt a=vext01

This syncs us with upstream so we can have the proc-macro stuff needed for in-compiler serde.

Sorry it took so long, the merge was non-trivial, and I messed it up first time.

Co-authored-by: ljedrz <[email protected]>
Co-authored-by: Mazdak Farrokhzad <[email protected]>
Co-authored-by: Jens Hausdorf <[email protected]>
Co-authored-by: Mateusz Mikuła <[email protected]>
Co-authored-by: bors <[email protected]>
Co-authored-by: Oliver Scherer <[email protected]>
Co-authored-by: Alex Crichton <[email protected]>
Co-authored-by: Matthew Jasper <[email protected]>
Co-authored-by: Esteban Küber <[email protected]>
Co-authored-by: Andy Russell <[email protected]>
Co-authored-by: kennytm <[email protected]>
@bors
Copy link
Contributor

bors bot commented Mar 12, 2019

Build succeeded

@bors bors bot merged commit 74c4dd4 into master Mar 12, 2019
@bors bors bot deleted the yk-sync-upstream-proc2 branch March 12, 2019 12:32
vext01 pushed a commit to vext01/ykrustc that referenced this pull request Oct 12, 2020
This is a combination of 18 commits.

Commit softdevteam#2:

Additional examples and some small improvements.

Commit softdevteam#3:

fixed mir-opt non-mir extensions and spanview title elements

Corrected a fairly recent assumption in runtest.rs that all MIR dump
files end in .mir. (It was appending .mir to the graphviz .dot and
spanview .html file names when generating blessed output files. That
also left outdated files in the baseline alongside the files with the
incorrect names, which I've now removed.)

Updated spanview HTML title elements to match their content, replacing a
hardcoded and incorrect name that was left in accidentally when
originally submitted.

Commit softdevteam#4:

added more test examples

also improved Makefiles with support for non-zero exit status and to
force validation of tests unless a specific test overrides it with a
specific comment.

Commit softdevteam#5:

Fixed rare issues after testing on real-world crate

Commit softdevteam#6:

Addressed PR feedback, and removed temporary -Zexperimental-coverage

-Zinstrument-coverage once again supports the latest capabilities of
LLVM instrprof coverage instrumentation.

Also fixed a bug in spanview.

Commit softdevteam#7:

Fix closure handling, add tests for closures and inner items

And cleaned up other tests for consistency, and to make it more clear
where spans start/end by breaking up lines.

Commit softdevteam#8:

renamed "typical" test results "expected"

Now that the `llvm-cov show` tests are improved to normally expect
matching actuals, and to allow individual tests to override that
expectation.

Commit softdevteam#9:

test coverage of inline generic struct function

Commit softdevteam#10:

Addressed review feedback

* Removed unnecessary Unreachable filter.
* Replaced a match wildcard with remining variants.
* Added more comments to help clarify the role of successors() in the
CFG traversal

Commit softdevteam#11:

refactoring based on feedback

* refactored `fn coverage_spans()`.
* changed the way I expand an empty coverage span to improve performance
* fixed a typo that I had accidently left in, in visit.rs

Commit softdevteam#12:

Optimized use of SourceMap and SourceFile

Commit softdevteam#13:

Fixed a regression, and synched with upstream

Some generated test file names changed due to some new change upstream.

Commit softdevteam#14:

Stripping out crate disambiguators from demangled names

These can vary depending on the test platform.

Commit softdevteam#15:

Ignore llvm-cov show diff on test with generics, expand IO error message

Tests with generics produce llvm-cov show results with demangled names
that can include an unstable "crate disambiguator" (hex value). The
value changes when run in the Rust CI Windows environment. I added a sed
filter to strip them out (in a prior commit), but sed also appears to
fail in the same environment. Until I can figure out a workaround, I'm
just going to ignore this specific test result. I added a FIXME to
follow up later, but it's not that critical.

I also saw an error with Windows GNU, but the IO error did not
specify a path for the directory or file that triggered the error. I
updated the error messages to provide more info for next, time but also
noticed some other tests with similar steps did not fail. Looks
spurious.

Commit softdevteam#16:

Modify rust-demangler to strip disambiguators by default

Commit softdevteam#17:

Remove std::process::exit from coverage tests

Due to Issue #77553, programs that call std::process::exit() do not
generate coverage results on Windows MSVC.

Commit softdevteam#18:

fix: test file paths exceeding Windows max path len
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.