Improve the librustc on-demand/query API ergonomics.
Queries are now performed through these two forms:
* `tcx.type_of(def_id)` (the most common usage)
* `tcx.at(span).type_of(def_id)` (to provide a more specific location in the cycle stack)
Several queries were renamed to work better as method names, i.e. by suffixing with `_of`.
r? @nikomatsakis
More methods for str boxes. (reduce Box<[u8]> ↔ Box<str> transmutes)
This is a follow-up to #41096 that adds safer methods for converting between `Box<str>` and `Box<[u8]>`. They're gated under a different feature from the `&mut str` methods because they may be too niche to include in public APIs, although having them internally helps reduce the number of transmutes the standard library uses.
What's added:
* `From<Box<str>> for Box<[u8]>`
* `<Box<str>>::into_boxed_bytes` (just calls `Into::into`)
* `alloc::str` (new module)
* `from_boxed_utf8` and `from_boxed_utf8_unchecked`, defined in `alloc:str`, exported in `collections::str`
* exports `from_utf8_mut` in `collections::str` (missed from previous PR)
Clarify the doc index
With regards to the unstable book, the reference, and the
processes involved.
Also, fix up a link by pointing to the new tracking issue rather than
the older one.
Fixes#41285
r? @frewsxcv
Specify behavior of `write_all` for `ErrorKind::Interrupted` errors
Also spell out that read and write operations should be retried on
`ErrorKind::Interrupted` errors.
Fixes#38494.
Adds rust-windbg.cmd script
Adds rust-gdb/rust-lldb equivalent for windbg that loads the Rust .natvis files on start.
This change modifies the bootstrap code to add rust-windbg to bin and the .natvis files to lib/rustlib/etc.
Example usage from cmd or PowerShell:
```
rust-windbg -c "bu rs_f442289d74765418!rs::main;g" target\debug\rs.exe
```
Check privacy of trait items in all contexts
Fixes https://github.com/rust-lang/rust/issues/28514
This is a sufficiently rare scenario and it's currently guarded by `private_in_public` lint, so it shouldn't be a [breaking-change] in practice.
Run tests for the cargo submodule in tree
Previously the `cargotest` suite would run some arbitrary revision of Cargo's
test suite, but now that we're bundling it in tree we should be running the
Cargo submodule's test suite instead.
Implement Vec::splice and String::splice (RFC 1432)
RFC: rust-lang/rfcs#1432, tracking issue: #32310
A rebase of https://github.com/rust-lang/rust/pull/32355 with a few more tests.
Let me know if you have any ideas for more tests.
cc @SimonSapin
With regards to the unstable book, the reference, and the
processes involved.
Also, fix up a link by pointing to the new tracking issue rather than
the older one.
Fixes#41285
LLVM 4.0 Upgrade
Since nobody has done this yet, I decided to get things started:
**Todo:**
* [x] push the relevant commits to `rust-lang/llvm` and `rust-lang/compiler-rt`
* [x] cleanup `.gitmodules`
* [x] Verify if there are any other commits from `rust-lang/llvm` which need backporting
* [x] Investigate / fix debuginfo ("`<optimized out>`") failures
* [x] Use correct emscripten version in docker image
---
Closes#37609.
---
**Test results:**
Everything is green 🎉
Previously the `cargotest` suite would run some arbitrary revision of Cargo's
test suite, but now that we're bundling it in tree we should be running the
Cargo submodule's test suite instead.
traits::select: quickly filter out predicates from other traits
this improves most pre-trans passes's performance by ~1%.
That missed the spring cleaning PR because I wanted to ship it.
r? @eddyb