incr.comp.: Revert hashing optimization that caused regression.
This PR reverts part of #46562 which caused [a regression in the crossbeam rust-icci](https://travis-ci.org/rust-icci/crossbeam/builds/316574774) test. I don't know what the problem is exactly yet. Fortunately, the problematic part is also the less important one, so reverting should not have much impact on performance.
r? @eddyb
save-analysis: add parents to imports
This PR populates the `parent` field added to `Import` in `rls-data` 0.14.
I'm not quite sure if I handled nested imports' parents correctly: this is a new feature to me.
r? @nrc
cc https://github.com/nrc/rls-analysis/issues/123
rustc_trans: approximate ABI alignment for padding/union fillers.
Before #45225 and after this PR, unions and enums are filled with integers of size and alignment matching their alignment (e.g. `Option<u32>` becomes `[u32; 2]`) instead of mere bytes.
Also, the alignment padding between struct fields gets this treatment after this PR.
Partially helps with some reduced testcases in #46449, although it doesn't solve the bug itself.
Remove Sync and Send implementation for RawTable
The implementation was introduced when changing hash storage from Unique to *mut, but it was changed back to Unique.
Help Cargo tolerate RUSTFLAGS="--print=native-static-libs"
Alternative to https://github.com/rust-lang/cargo/pull/4807
Having this "error" message was a mistake, as it's firing at exactly wrong time when Cargo is trying to read the output of other print commands.
Expose the line and column fields from the proc_macro::LineColumn struct
Right now the `LineColumn` struct is pretty useless because the fields are private.
This patch just marks the fields as public, which seems like the easiest solution.
Use a better link for method resolution in Deref docs
rust-lang-nursery/reference#149 breaks these links, so make them point to somewhere which won't break and provides a more deatailed description of method resolution.
cc @Havvy
r? @steveklabnik
Lifetime Resolution for Generic Associated Types
Tracking Issue: https://github.com/rust-lang/rust/issues/44265
r? @nikomatsakis
This PR implements lifetime resolution for generic associated types. 🎉
## Remaining Work Before Merge
I'm going to go do these things in the next day or so. Please let me know if you spot anything in my changes until then.
- [x] If I'm not mistaken, at least some tests should pass now. I need to go through the tests and re-enable the ones that should work by removing the appropriate `~ ERROR` comments
[MIR-borrowck] Two phase borrows
This adds limited support for two-phase borrows as described in
http://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/
The support is off by default; you opt into it via the flag `-Z two-phase-borrows`
I have written "*limited* support" above because there are simple variants of the simple `v.push(v.len())` example that one would think should work but currently do not, such as the one documented in the test compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs
(To be clear, that test is not describing something that is unsound. It is just providing an explicit example of a limitation in the implementation given in this PR. I have ideas on how to fix, but I want to land the work that is in this PR first, so that I can stop repeatedly rebasing this branch.)
rustc: unpack newtyped of #[repr(simd)] vector types.
Prerequisite for a `#[repr(transparent)]` implementation that works with SIMD vectors.
cc @rkruppe
Instead, filter out (non-)conflicts of activiations with themselves in
the same manner that we filter out non-conflict between an activation
and its reservation.
In reality the currently generated MIR has at least one of the activations
in a copy that occurs before the merge. But still, good to have a test,
in anticipation of that potentially changing...
trait alias infrastructure
This will be an implementation of trait aliases (RFC 1733, #41517).
Progress so far:
- [x] Feature gate
- [x] Add to parser
- [x] `where` clauses
- [x] prohibit LHS type parameter bounds via AST validation https://github.com/rust-lang/rust/pull/45047#discussion_r143575575
- [x] Add to AST and HIR
- [x] make a separate PathSource for trait alias contexts https://github.com/rust-lang/rust/pull/45047#discussion_r143353932
- [x] Stub out enough of typeck and resolve to just barely not ICE
Postponed:
- [ ] Actually implement the alias part
- [ ] #21903
- [ ] #24010
I need some pointers on where to start with that last one. The test currently does this:
```
error[E0283]: type annotations required: cannot resolve `_: CD`
--> src/test/run-pass/trait-alias.rs:34:16
|
34 | let both = foo();
| ^^^
|
= note: required by `foo`
```
incr.comp.: Speed up span hashing by caching expansion context hashes.
This PR fixes the performance regressions from https://github.com/rust-lang/rust/pull/46338.
r? @nikomatsakis
Validate miri against the HIR const evaluator
r? @eddyb
cc @alexcrichton @arielb1 @RalfJung
The interesting parts are the last few functions in `librustc_const_eval/eval.rs`
* We warn if miri produces an error while HIR const eval does not.
* We warn if miri produces a value that does not match the value produced by HIR const eval
* if miri succeeds and HIR const eval fails, nothing is emitted, but we still return the HIR error
* if both error, nothing is emitted and the HIR const eval error is returned
So there are no actual changes, except that miri is forced to produce the same values as the old const eval.
* This does **not** touch the const evaluator in trans at all. That will come in a future PR.
* This does **not** cause any code to compile that didn't compile before. That will also come in the future
It would be great if someone could start a crater run if travis passes