Update the book to promote second edition
This updates the book repository, but mostly to include
https://github.com/rust-lang/book/pull/1180
TL;DR: the second edition is close enough to done that we should
universally recommend it over the first edition.
Fix exponential projection complexity on nested types
This implements solution 1 from https://github.com/rust-lang/rust/issues/38528#issuecomment-366263076.
The code quality is currently extremely poor, but we can improve them during review.
Blocking issues:
- we probably don't want a quadratic deduplication for obligations.
- is there an alternative to deduplication?
Based on #48315.
Needs changelog. Noticable improvement on compile time is expected.
Fix#38528Close#39684Close#43757
Allow two-phase borrows of &mut self in ops
We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes#48129.
CC @pnkfelix and @nikomatsakis
r? @pnkfelix
Fix borrow checker unsoundness with unions
Fixes#45157. After discussion with @nikomatsakis on Gitter, this PR only adds a test since the original issue was resolved elsewhere.
r? @nikomatsakis
Allow for instantiating statics from upstream crates
This PR makes the infrastructure around translating statics a bit more flexible so that it can also instantiate statics from upstream crates if the need arises. This is preparatory work for a MIR-only RLIBs prototype, where the instantiation of a `static` may be deferred until a leaf crate.
r? @eddyb (feel free to assign to someone else if you're busy)
save-analysis: power through bracket mis-counts
Closes#47981
This is pretty unsatisfying since it is working around a span bug. However, I can't track down the span bug and it could be in the parser, proc macro expansion, the user macro, or Syn (or any other library that can manipulate spans). Given that user code can cause this error, I think we need to be more robust here.
r? @eddyb
Remove "static item recursion checking" in favor of relying on cycle checks in the query engine
Tests are changed to use the cycle check error message instead. Some duplicate tests are removed.
r? @eddyb
A user in a reddit thread was confused by the name of the variable
"num_as_int"; they thought the example was trying to convert the
string "10" as if it were binary 2 by calling str::len(). In reality,
the example is simply demonstrating how to take an immutable reference
to the value of an Option. The confusion comes from the coincidence
that the length of the string "10" is also its binary representation,
and the implication from the variable names that a conversion was
occuring ("num_as_str" to "num_as_int").
This PR changes the example number to 12 instead of 10, and changes
the variable name from "num_as_int" to "num_length" to better
communicate what the example is doing.
The reddit thread:
https://www.reddit.com/r/rust/comments/7zpvev/notyetawesome_rust_what_use_cases_would_you_like/dur39xw/
Split MinGW tests into two builders on AppVeyor
Run-pass and compile-fail tests appear to take the most significant chunk of time, so split them into their own builder.
Should help with https://github.com/rust-lang/rust/issues/46903.
r? @kennytm
cc @alexcrichton
Previously, if the gdb command was available, but threw an error, compiletest would panic. This is obviously not good. Now, gdb is treated as missing if calling `gdb --version` does not output anything on stdout.
[docs] Minor wording changes to drain_filter docs
The docs currently say, "If the closure returns false, it will try again, and call the closure on the next element." But this happens regardless of whether the closure returns true or false.
Overhaul improper_ctypes output
This snowballed into a rather big set of improvements to the diagnostics of the improper_ctypes lint. See commits for details, including effects of each change on the `compile-fail/improper-ctypes.rs` test (now a UI test), which is pretty gnarly and hopefully not representative of real code, but covers a lot of different error cases.
Fixes#42050