Add lossless debug implementation for unix OsStrs
Fixes#22766
Invalid utf8 byte sequences are replaced with `\xFF` style escape codes, while valid utf8 goes through the normal `Debug` implementation.
This is necessarily different from the windows Debug implementation, which uses `\u{xxxx}` style escape sequences for unpaired surrogates, but both implementations are consistent in that they are both lossless, and display invalid sequences in the way most similar to existing language syntax.
r? @dtolnay
Add sync module to rustc_data_structures
This PR is split out from https://github.com/rust-lang/rust/pull/45912, since github apparently can't handle such large PRs.
r? @arielb1
Improve error messages on LLVM bitcode parsing failure
The LLVM error causing the parse failure is now printed, in the style
of the other thin LTO error messages. This prevents a flood of
assertion failure messages if the bitcode can’t be parsed.
fix broken assertion in type_param
Nested generics (aka method generics) in trait methods don't have an
*additional* Self parameter in their own type parameter list (they have
a Self parameter in the parent generics), so don't try to check we're
correctly adjusting for it.
Fixes#46568.
r? @eddyb
This simple patch resolves#46756 (which was specifically about the case of
casts, but it would be poor form indeed to fix a reported issue without at
least a cursory attempt at answering the immortal question, "How does this bug
generalize?").
Point at var in short lived borrows instead of drop location
For RLS' sake, point at the borrow location as primary span for short lived borrows, instead of the borrow drop location.
Fix#39268.
Loading the dependency graph in the background
Patch is a bit longer than I expected, due to the fact that most of this code relies upon a `Session` value, which is not `Sync`.
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
The LLVM error causing the parse failure is now printed, in the style
of the other thin LTO error messages. This prevents a flood of
assertion failure messages if the bitcode can’t be parsed.
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